Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions graphile/graphile-llm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,3 @@ query {
}
}
```

## License

MIT
4 changes: 0 additions & 4 deletions graphile/graphile-plugin-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,3 @@ const computed = Object.values(build.input.pgRegistry.pgResources).filter(
isComputedScalarAttributeResource
);
```

## License

MIT
4 changes: 0 additions & 4 deletions graphile/graphile-postgis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,3 @@ the plugin detects that at schema-build time and skips type, filter,
aggregate, and spatial-relation registration instead of breaking the
build. Turning PostGIS on later only requires restarting the server
(or invalidating the schema cache) — no config change.

## License

MIT
6 changes: 0 additions & 6 deletions graphile/graphile-schema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,3 @@ Fetches a GraphQL SDL string from a running GraphQL endpoint via introspection q
| `opts.headerHost` | `string` | Override the `Host` header |
| `opts.auth` | `string` | `Authorization` header value |
| `opts.headers` | `Record<string, string>` | Additional request headers |

## Disclaimer

AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.

No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
4 changes: 0 additions & 4 deletions graphile/graphile-settings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,3 @@ COMMENT ON FUNCTION full_name(users) IS E'@filterable';
| Variable | Description |
|----------|-------------|
| `INFLECTOR_LOG=1` | Enable inflector debug logging |

## License

MIT
4 changes: 0 additions & 4 deletions graphql/codegen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,3 @@ pnpm test
- PostGraphile endpoint with `_meta` query enabled
- React Query v5 (peer dependency for React Query hooks)
- No dependencies for ORM client (uses native fetch)

## License

MIT
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,6 @@ Use \`--no-tty\` to skip all interactive prompts (useful for scripts and CI):
\`\`\`bash
myapp --no-tty car create --name "Sedan" --year 2024
\`\`\`

---

Built by the [Constructive](https://constructive.io) team.

## Disclaimer

AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.

No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
"
`;

Expand Down Expand Up @@ -1584,16 +1574,6 @@ Authenticate a user
|----------|------|
| \`email\` | String (required) |
| \`password\` | String (required) |

---

Built by the [Constructive](https://constructive.io) team.

## Disclaimer

AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.

No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
"
`;

Expand Down Expand Up @@ -2028,16 +2008,6 @@ Use \`--no-tty\` to skip all interactive prompts (useful for scripts and CI):
\`\`\`bash
myapp --no-tty auth:user create --name "Example"
\`\`\`

---

Built by the [Constructive](https://constructive.io) team.

## Disclaimer

AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.

No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
"
`;

Expand Down Expand Up @@ -4040,16 +4010,6 @@ Authenticate a user
\`\`\`typescript
const result = await db.mutation.login({ email: '<String>', password: '<String>' }).execute();
\`\`\`

---

Built by the [Constructive](https://constructive.io) team.

## Disclaimer

AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.

No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
"
`;

Expand Down Expand Up @@ -4273,16 +4233,6 @@ See [hooks/README.md](./hooks/README.md) for full hook reference.
inquirerer-based CLI commands for \`myapp\`.

See [cli/README.md](./cli/README.md) for command reference.

---

Built by the [Constructive](https://constructive.io) team.

## Disclaimer

AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.

No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
"
`;

Expand All @@ -4301,15 +4251,5 @@ exports[`target docs generator generates root-root README for multi-target 1`] =
|-----|----------|------------|------|
| auth | http://auth.localhost/graphql | ORM | [./generated/auth/README.md](./generated/auth/README.md) |
| app | http://app.localhost/graphql | ORM, React Query, CLI | [./generated/app/README.md](./generated/app/README.md) |

---

Built by the [Constructive](https://constructive.io) team.

## Disclaimer

AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.

No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
"
`;
3 changes: 0 additions & 3 deletions graphql/codegen/src/core/codegen/cli/docs-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
flattenArgs,
flattenedArgsToFlags,
getEditableFields,
getReadmeFooter,
getReadmeHeader,
} from '../docs-utils';
import {
Expand Down Expand Up @@ -221,7 +220,6 @@ export function generateReadme(
lines.push('```');
lines.push('');

lines.push(...getReadmeFooter());

return {
fileName: 'README.md',
Expand Down Expand Up @@ -901,7 +899,6 @@ export function generateMultiTargetReadme(
lines.push('```');
lines.push('');

lines.push(...getReadmeFooter());

return {
fileName: 'README.md',
Expand Down
15 changes: 0 additions & 15 deletions graphql/codegen/src/core/codegen/docs-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,6 @@ export function getReadmeHeader(title: string): string[] {
];
}

export function getReadmeFooter(): string[] {
return [
'---',
'',
'Built by the [Constructive](https://constructive.io) team.',
'',
'## Disclaimer',
'',
'AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.',
'',
'No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.',
'',
];
}

export function resolveDocsConfig(
docs: DocsConfig | boolean | undefined,
): DocsConfig {
Expand Down
2 changes: 0 additions & 2 deletions graphql/codegen/src/core/codegen/hooks-docs-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
buildSkillReference,
fieldPlaceholder,
formatArgType,
getReadmeFooter,
getReadmeHeader,
pkPlaceholder,
} from './docs-utils';
Expand Down Expand Up @@ -210,7 +209,6 @@ export function generateHooksReadme(
}
}

lines.push(...getReadmeFooter());

return {
fileName: 'README.md',
Expand Down
2 changes: 0 additions & 2 deletions graphql/codegen/src/core/codegen/orm/docs-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
fieldPlaceholder,
formatArgType,
getEditableFields,
getReadmeFooter,
getReadmeHeader,
pkPlaceholder,
} from '../docs-utils';
Expand Down Expand Up @@ -184,7 +183,6 @@ export function generateOrmReadme(
}
}

lines.push(...getReadmeFooter());

return {
fileName: 'README.md',
Expand Down
4 changes: 1 addition & 3 deletions graphql/codegen/src/core/codegen/target-docs-generator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { GraphQLSDKConfigTarget } from '../../types/config';
import type { GeneratedDocFile } from './docs-utils';
import { getReadmeFooter,getReadmeHeader } from './docs-utils';
import { getReadmeHeader } from './docs-utils';

export interface TargetReadmeOptions {
hasOrm: boolean;
Expand Down Expand Up @@ -108,7 +108,6 @@ export function generateTargetReadme(
lines.push('');
}

lines.push(...getReadmeFooter());

return {
fileName: 'README.md',
Expand Down Expand Up @@ -143,7 +142,6 @@ export function generateRootRootReadme(
}
lines.push('');

lines.push(...getReadmeFooter());

return {
fileName: 'README.md',
Expand Down
4 changes: 0 additions & 4 deletions graphql/server-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,3 @@ const { query } = await getConnections({
| `@constructive-io/graphql-test` | None | Direct PostGraphile execution |
| `@constructive-io/playwright-test` | Real HTTP | Direct PostGraphile execution |
| **`graphql-server-test`** | Real HTTP | **SuperTest HTTP requests** |

## License

MIT
52 changes: 52 additions & 0 deletions packages/12factor-env/__tests__/validators.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ import {
cleanEnv,
distinct,
duration,
email,
enumerated,
env,
host,
int,
list,
mutuallyExclusive,
num,
oneOf,
port,
redactEnvError,
requiredWhen,
str,
url,
uuid,
withDefault} from '../src';

describe('list()', () => {
Expand Down Expand Up @@ -324,3 +328,51 @@ describe('secret redaction', () => {
expect(redactEnvError(untouched)).toBe(untouched);
});
});

describe('value-shape validators (shared with @constructive-io/coerce)', () => {
it('accepts the shapes each one names', () => {
const config = cleanEnv(
{
PORT: '5432',
API_URL: 'https://api.constructive.io',
PGHOST: 'db.internal',
SUPPORT_EMAIL: 'developers@constructive.io',
TENANT_ID: '3f2504e0-4f89-11d3-9a0c-0305e82c3301'
},
{
PORT: port(),
API_URL: url(),
PGHOST: host(),
SUPPORT_EMAIL: email(),
TENANT_ID: uuid()
}
);
expect(config.PORT).toBe(5432);
expect(config.API_URL).toBe('https://api.constructive.io');
expect(config.PGHOST).toBe('db.internal');
expect(config.SUPPORT_EMAIL).toBe('developers@constructive.io');
expect(config.TENANT_ID).toBe('3f2504e0-4f89-11d3-9a0c-0305e82c3301');
});

it('throws on a port outside 1..65535 rather than booting on it', () => {
expect(() => cleanEnv({ PORT: '65536' }, { PORT: port() })).toThrow(/PORT/);
expect(() => cleanEnv({ PORT: 'http' }, { PORT: port() })).toThrow(/PORT/);
});

it('throws on a scheme-less url and a host carrying a port', () => {
expect(() => cleanEnv({ API_URL: 'api.constructive.io' }, { API_URL: url() })).toThrow(/API_URL/);
expect(() => cleanEnv({ PGHOST: 'db.internal:5432' }, { PGHOST: host() })).toThrow(/PGHOST/);
});

it('throws on a malformed email and a truncated uuid', () => {
expect(() => cleanEnv({ SUPPORT_EMAIL: 'developers' }, { SUPPORT_EMAIL: email() })).toThrow(
/SUPPORT_EMAIL/
);
expect(() => cleanEnv({ TENANT_ID: '3f2504e0' }, { TENANT_ID: uuid() })).toThrow(/TENANT_ID/);
});

it('resolves a typed default through the same coercion', () => {
const config = cleanEnv({}, { PORT: port({ default: 3000 }) });
expect(config.PORT).toBe(3000);
});
});
Loading
Loading