@aws/nx-plugin 0.1.6 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-THIRD-PARTY +114 -244
- package/generators.json +1 -7
- package/package.json +1 -1
- package/src/cloudscape-website/app/README.md +84 -48
- package/src/cloudscape-website/app/__snapshots__/generator.spec.ts.snap +157 -218
- package/src/cloudscape-website/app/files/app/README.md.template +44 -0
- package/src/cloudscape-website/app/files/app/src/layouts/App/index.tsx.template +40 -43
- package/src/cloudscape-website/app/files/app/src/layouts/App/navitems.ts.template +3 -3
- package/src/cloudscape-website/app/files/app/src/layouts/Routes/index.tsx.template +4 -6
- package/src/cloudscape-website/app/files/app/src/main.tsx.template +7 -10
- package/src/cloudscape-website/app/files/app/src/pages/Home/index.tsx.template +0 -2
- package/src/cloudscape-website/app/files/common/constructs/src/app/static-websites/__websiteNameKebabCase__.ts.template +13 -0
- package/src/cloudscape-website/app/files/common/constructs/src/{__websiteNameKebabCase__ → core}/static-website.ts.template +74 -144
- package/src/cloudscape-website/app/generator.js +74 -64
- package/src/cloudscape-website/app/generator.js.map +1 -1
- package/src/cloudscape-website/app/schema.d.ts +3 -4
- package/src/cloudscape-website/app/schema.json +1 -24
- package/src/cloudscape-website/cognito-auth/README.md +53 -32
- package/src/cloudscape-website/cognito-auth/__snapshots__/generator.spec.ts.snap +161 -125
- package/src/cloudscape-website/cognito-auth/files/app/components/CognitoAuth/index.tsx.template +53 -39
- package/src/cloudscape-website/cognito-auth/files/common/constructs/src/core/user-identity.ts.template +168 -0
- package/src/cloudscape-website/cognito-auth/generator.js +129 -46
- package/src/cloudscape-website/cognito-auth/generator.js.map +1 -1
- package/src/cloudscape-website/cognito-auth/schema.d.ts +1 -0
- package/src/cloudscape-website/cognito-auth/schema.json +7 -1
- package/src/cloudscape-website/runtime-config/__snapshots__/generator.spec.ts.snap +15 -17
- package/src/cloudscape-website/runtime-config/files/app/components/RuntimeConfig/index.tsx.template +7 -10
- package/src/cloudscape-website/runtime-config/files/app/hooks/useRuntimeConfig.tsx.template +13 -0
- package/src/cloudscape-website/runtime-config/generator.js +3 -1
- package/src/cloudscape-website/runtime-config/generator.js.map +1 -1
- package/src/infra/app/README.md +71 -46
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +114 -252
- package/src/infra/app/files/app/README.md.template +76 -0
- package/src/infra/app/files/app/src/main.ts.template +18 -0
- package/src/infra/app/files/common/constructs/src/core/cfn-guard-rules/aws-prototyping.guard +1282 -0
- package/src/infra/app/files/common/constructs/src/core/cfn-guard-rules/cfn-nag.guard +6839 -0
- package/src/infra/app/files/common/constructs/src/core/cfn-guard-rules/hipaa-security.guard +2807 -0
- package/src/infra/app/files/common/constructs/src/core/cfn-guard-rules/nist-csf.guard +2585 -0
- package/src/infra/app/files/common/constructs/src/core/cfn-guard-rules/pci-dss-3-2-1.guard +2236 -0
- package/src/infra/app/files/common/constructs/src/core/cfn-guard-rules/wa-reliability-pillar.guard +885 -0
- package/src/infra/app/files/common/constructs/src/core/cfn-guard-rules/wa-security-pillar.guard +2205 -0
- package/src/infra/app/files/common/constructs/src/core/cfn-guard.ts.template +63 -0
- package/src/infra/app/generator.js +17 -3
- package/src/infra/app/generator.js.map +1 -1
- package/src/infra/app/schema.d.ts +10 -1
- package/src/infra/app/schema.json +16 -8
- package/src/trpc/backend/README.md +102 -80
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +37 -17
- package/src/trpc/backend/files/backend/README.md.template +33 -0
- package/src/trpc/backend/files/common/constructs/src/app/trpc-apis/__apiNameKebabCase__.ts.template +18 -0
- package/src/trpc/backend/files/common/constructs/src/{__apiNameKebabCase__/index.ts.template → core/trpc-api.ts.template} +12 -16
- package/src/trpc/backend/files/schema/README.md.template +33 -0
- package/src/trpc/backend/generator.js +29 -43
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.ts +3 -1
- package/src/trpc/backend/schema.json +8 -13
- package/src/trpc/react/README.md +46 -66
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +104 -65
- package/src/trpc/react/files/src/components/TrpcClients/IsolatedTrpcProvider.tsx.template +75 -0
- package/src/trpc/react/files/src/components/TrpcClients/TrpcApis.tsx.template +1 -0
- package/src/trpc/react/files/src/components/TrpcClients/TrpcClientProviders.tsx.template +10 -0
- package/src/trpc/react/files/src/components/TrpcClients/index.tsx.template +5 -0
- package/src/trpc/react/files/src/hooks/useSigV4.tsx.template +38 -0
- package/src/trpc/react/files/src/hooks/use__apiNameClassName__.tsx.template +3 -0
- package/src/trpc/react/generator.js +123 -24
- package/src/trpc/react/generator.js.map +1 -1
- package/src/trpc/react/schema.json +2 -2
- package/src/ts/cjs-to-esm/generator.js.map +1 -1
- package/src/ts/lib/eslint.d.ts +1 -1
- package/src/ts/lib/eslint.js +59 -11
- package/src/ts/lib/eslint.js.map +1 -1
- package/src/ts/lib/files/README.md.template +33 -0
- package/src/ts/lib/generator.js +11 -4
- package/src/ts/lib/generator.js.map +1 -1
- package/src/ts/lib/schema.d.ts +1 -3
- package/src/ts/lib/schema.json +2 -15
- package/src/ts/lib/ts-project-utils.js.map +1 -1
- package/src/ts/lib/vitest.js +14 -0
- package/src/ts/lib/vitest.js.map +1 -1
- package/src/utils/ast.d.ts +13 -0
- package/src/utils/ast.js +102 -0
- package/src/utils/ast.js.map +1 -0
- package/src/utils/files/common/constructs/src/app/index.ts.template +0 -0
- package/src/utils/files/common/constructs/src/{runtime-config → core}/runtime-config.ts.template +3 -5
- package/src/utils/files/common/constructs/src/index.ts.template +2 -1
- package/src/utils/files/common/readme/README.md.template +33 -0
- package/src/utils/files/common/types/src/runtime-config.ts.template +1 -13
- package/src/utils/format.js.map +1 -1
- package/src/utils/names.d.ts +2 -0
- package/src/utils/names.js +27 -0
- package/src/utils/names.js.map +1 -0
- package/src/utils/npm-scope.js.map +1 -1
- package/src/utils/paths.js.map +1 -1
- package/src/utils/shared-constructs.js +37 -4
- package/src/utils/shared-constructs.js.map +1 -1
- package/src/utils/versions.d.ts +15 -9
- package/src/utils/versions.js +14 -8
- package/src/utils/versions.js.map +1 -1
- package/src/cloudscape-website/app/files/common/constructs/src/__websiteNameKebabCase__/cloudfront-web-acl.ts.template +0 -317
- package/src/cloudscape-website/app/files/common/constructs/src/__websiteNameKebabCase__/index.ts.template +0 -4
- package/src/cloudscape-website/app/files/common/constructs/src/__websiteNameKebabCase__/webacl_event_handler/index.ts.template +0 -301
- package/src/cloudscape-website/cognito-auth/files/common/constructs/src/identity/index.ts.template +0 -4
- package/src/cloudscape-website/cognito-auth/files/common/constructs/src/identity/user-identity.ts.template +0 -66
- package/src/cloudscape-website/cognito-auth/files/common/constructs/src/identity/userpool-with-mfa.ts.template +0 -70
- package/src/gitlab/generator.d.ts +0 -8
- package/src/gitlab/generator.js +0 -16
- package/src/gitlab/generator.js.map +0 -1
- package/src/gitlab/schema.d.ts +0 -9
- package/src/gitlab/schema.json +0 -52
- package/src/infra/app/files/src/main.ts.template +0 -37
- package/src/trpc/react/files/src/components/TRPCClientProvider/index.tsx.template +0 -34
- package/src/trpc/react/files/src/hooks/useTrpc.tsx.template +0 -5
- /package/src/infra/app/files/{cdk.json → app/cdk.json} +0 -0
- /package/src/infra/app/files/{src → app/src}/stacks/application-stack.ts.template +0 -0
- /package/src/utils/files/common/constructs/src/{runtime-config → core}/index.ts.template +0 -0
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/*! Copyright [Amazon.com](http://amazon.com/), Inc. or its affiliates. All Rights Reserved.
|
|
2
|
-
SPDX-License-Identifier: Apache-2.0 */
|
|
3
|
-
import { PDKNag } from '@aws/pdk/pdk-nag';
|
|
4
|
-
import { Duration, Stack } from 'aws-cdk-lib';
|
|
5
|
-
import {
|
|
6
|
-
AccountRecovery,
|
|
7
|
-
AdvancedSecurityMode,
|
|
8
|
-
Mfa,
|
|
9
|
-
UserPool,
|
|
10
|
-
} from 'aws-cdk-lib/aws-cognito';
|
|
11
|
-
import { Construct } from 'constructs';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Configures a UserPool with MFA across SMS/TOTP using sane defaults.
|
|
15
|
-
*/
|
|
16
|
-
export class UserPoolWithMfa extends UserPool {
|
|
17
|
-
constructor(scope: Construct, id: string) {
|
|
18
|
-
super(scope, id, {
|
|
19
|
-
deletionProtection: true,
|
|
20
|
-
passwordPolicy: {
|
|
21
|
-
minLength: 8,
|
|
22
|
-
requireLowercase: true,
|
|
23
|
-
requireUppercase: true,
|
|
24
|
-
requireDigits: true,
|
|
25
|
-
requireSymbols: true,
|
|
26
|
-
tempPasswordValidity: Duration.days(3),
|
|
27
|
-
},
|
|
28
|
-
mfa: Mfa.REQUIRED,
|
|
29
|
-
mfaSecondFactor: { sms: true, otp: true },
|
|
30
|
-
signInCaseSensitive: false,
|
|
31
|
-
advancedSecurityMode: AdvancedSecurityMode.ENFORCED,
|
|
32
|
-
signInAliases: { username: true, email: true },
|
|
33
|
-
accountRecovery: AccountRecovery.EMAIL_ONLY,
|
|
34
|
-
selfSignUpEnabled: <%= allowSignup %>,
|
|
35
|
-
standardAttributes: {
|
|
36
|
-
phoneNumber: { required: false },
|
|
37
|
-
email: { required: true },
|
|
38
|
-
givenName: { required: true },
|
|
39
|
-
familyName: { required: true },
|
|
40
|
-
},
|
|
41
|
-
autoVerify: {
|
|
42
|
-
email: true,
|
|
43
|
-
phone: true,
|
|
44
|
-
},
|
|
45
|
-
keepOriginal: {
|
|
46
|
-
email: true,
|
|
47
|
-
phone: true,
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
const stack = Stack.of(this);
|
|
52
|
-
|
|
53
|
-
['AwsSolutions-IAM5', 'AwsPrototyping-IAMNoWildcardPermissions'].forEach(
|
|
54
|
-
(RuleId) => {
|
|
55
|
-
PDKNag.addResourceSuppressionsByPathNoThrow(
|
|
56
|
-
stack,
|
|
57
|
-
`${PDKNag.getStackPrefix(stack)}${id}/UserPool/smsRole/Resource`,
|
|
58
|
-
[
|
|
59
|
-
{
|
|
60
|
-
id: RuleId,
|
|
61
|
-
reason:
|
|
62
|
-
'MFA requires sending a text to a users phone number which cannot be known at deployment time.',
|
|
63
|
-
appliesTo: ['Resource::*'],
|
|
64
|
-
},
|
|
65
|
-
]
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/
|
|
5
|
-
import { Tree } from '@nx/devkit';
|
|
6
|
-
import { GitlabGeneratorSchema } from './schema';
|
|
7
|
-
export declare function gitlabGenerator(tree: Tree, options: GitlabGeneratorSchema): Promise<void>;
|
|
8
|
-
export default gitlabGenerator;
|
package/src/gitlab/generator.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.gitlabGenerator = gitlabGenerator;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
/**
|
|
6
|
-
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
8
|
-
*/
|
|
9
|
-
const devkit_1 = require("@nx/devkit");
|
|
10
|
-
function gitlabGenerator(tree, options) {
|
|
11
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
-
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), '.', options);
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
exports.default = gitlabGenerator;
|
|
16
|
-
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/gitlab/generator.ts"],"names":[],"mappings":";;AAOA,0CAKC;;AAZD;;;GAGG;AACH,uCAAoE;AAGpE,SAAsB,eAAe,CACnC,IAAU,EACV,OAA8B;;QAE9B,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,0BAAiB,EAAC,SAAS,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;CAAA;AAED,kBAAe,eAAe,CAAC"}
|
package/src/gitlab/schema.d.ts
DELETED
package/src/gitlab/schema.json
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/schema",
|
|
3
|
-
"$id": "Gitlab",
|
|
4
|
-
"title": "",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"infraProject": {
|
|
8
|
-
"description": "The infrastructure project.",
|
|
9
|
-
"type": "string",
|
|
10
|
-
"alias": "dir",
|
|
11
|
-
"x-priority": "important",
|
|
12
|
-
"x-prompt": "the infrastructure project",
|
|
13
|
-
"x-dropdown": "projects"
|
|
14
|
-
},
|
|
15
|
-
"roleArn": {
|
|
16
|
-
"description": "The role ARN to assume.",
|
|
17
|
-
"type": "string",
|
|
18
|
-
"x-priority": "important",
|
|
19
|
-
"x-prompt": "the role ARN to assume"
|
|
20
|
-
},
|
|
21
|
-
"region": {
|
|
22
|
-
"description": "The region to deploy into.",
|
|
23
|
-
"type": "string",
|
|
24
|
-
"x-priority": "important",
|
|
25
|
-
"x-prompt": {
|
|
26
|
-
"message": "Which region would you like to deploy into?",
|
|
27
|
-
"type": "list",
|
|
28
|
-
"items": [
|
|
29
|
-
{ "value": "us-east-1", "label": "us-east-1" },
|
|
30
|
-
{ "value": "us-east-2", "label": "us-east-2" },
|
|
31
|
-
{ "value": "us-west-1", "label": "us-west-1" },
|
|
32
|
-
{ "value": "us-west-2", "label": "us-west-2" },
|
|
33
|
-
{ "value": "ca-central-1", "label": "ca-central-1" },
|
|
34
|
-
{ "value": "eu-west-1", "label": "eu-west-1" },
|
|
35
|
-
{ "value": "eu-central-1", "label": "eu-central-1" },
|
|
36
|
-
{ "value": "eu-west-2", "label": "eu-west-2" },
|
|
37
|
-
{ "value": "eu-west-3", "label": "eu-west-3" },
|
|
38
|
-
{ "value": "eu-north-1", "label": "eu-north-1" },
|
|
39
|
-
{ "value": "ap-northeast-1", "label": "ap-northeast-1" },
|
|
40
|
-
{ "value": "ap-northeast-2", "label": "ap-northeast-2" },
|
|
41
|
-
{ "value": "ap-southeast-1", "label": "ap-southeast-1" },
|
|
42
|
-
{ "value": "ap-southeast-2", "label": "ap-southeast-2" },
|
|
43
|
-
{ "value": "ap-south-1", "label": "ap-south-1" },
|
|
44
|
-
{ "value": "sa-east-1", "label": "sa-east-1" },
|
|
45
|
-
{ "value": "us-gov-west-1", "label": "us-gov-west-1" },
|
|
46
|
-
{ "value": "us-gov-east-1", "label": "us-gov-east-1" }
|
|
47
|
-
]
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"required": ["infraProject", "roleArn", "region"]
|
|
52
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { CdkGraph, FilterPreset, Filters } from '@aws/pdk/cdk-graph';
|
|
2
|
-
import { CdkGraphDiagramPlugin } from '@aws/pdk/cdk-graph-plugin-diagram';
|
|
3
|
-
import { CdkGraphThreatComposerPlugin } from '@aws/pdk/cdk-graph-plugin-threat-composer';
|
|
4
|
-
import { AwsPrototypingChecks, PDKNag } from '@aws/pdk/pdk-nag';
|
|
5
|
-
import { ApplicationStack } from './stacks/application-stack.js';
|
|
6
|
-
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-floating-promises */
|
|
8
|
-
(async () => {
|
|
9
|
-
const app = PDKNag.app({
|
|
10
|
-
nagPacks: [new AwsPrototypingChecks()],
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
// Use this to deploy your own sandbox environment (assumes your CLI credentials)
|
|
14
|
-
new ApplicationStack(app, '<%= name %>-sandbox', {
|
|
15
|
-
env: {
|
|
16
|
-
account: process.env.CDK_DEFAULT_ACCOUNT,
|
|
17
|
-
region: process.env.CDK_DEFAULT_REGION,
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const graph = new CdkGraph(app, {
|
|
22
|
-
plugins: [
|
|
23
|
-
new CdkGraphDiagramPlugin({
|
|
24
|
-
defaults: {
|
|
25
|
-
filterPlan: {
|
|
26
|
-
preset: FilterPreset.COMPACT,
|
|
27
|
-
filters: [{ store: Filters.pruneCustomResources() }],
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
}),
|
|
31
|
-
new CdkGraphThreatComposerPlugin(),
|
|
32
|
-
],
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
app.synth();
|
|
36
|
-
await graph.report();
|
|
37
|
-
})();
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
2
|
-
import { httpBatchLink } from '@trpc/react-query';
|
|
3
|
-
import { useContext, useState, FC } from 'react';
|
|
4
|
-
import { useTrpc } from '../../hooks/useTrpc';
|
|
5
|
-
import { RuntimeConfigContext } from '../RuntimeConfig';
|
|
6
|
-
<% if(auth === 'IAM') { %> import useSigV4Client from "@aws-northstar/ui/components/CognitoAuth/hooks/useSigv4Client"; <% } %>
|
|
7
|
-
|
|
8
|
-
const TRPCClientProvider: FC<any> = ({ children }) => {
|
|
9
|
-
const trpc = useTrpc();
|
|
10
|
-
const runtimeContext = useContext(RuntimeConfigContext);
|
|
11
|
-
const [queryClient] = useState(() => new QueryClient());
|
|
12
|
-
<% if(auth === 'IAM') { %> const sigv4Client = useSigV4Client(); <% } %>
|
|
13
|
-
|
|
14
|
-
const [trpcClient] = useState(() =>
|
|
15
|
-
trpc.createClient({
|
|
16
|
-
links: [
|
|
17
|
-
httpBatchLink({
|
|
18
|
-
url: runtimeContext?.trpcApis?.['<%= apiName %>']!,
|
|
19
|
-
<% if(auth === 'IAM') { %> fetch: sigv4Client <% } %>
|
|
20
|
-
})
|
|
21
|
-
],
|
|
22
|
-
}),
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<trpc.Provider client={trpcClient} queryClient={queryClient}>
|
|
27
|
-
<QueryClientProvider client={queryClient}>
|
|
28
|
-
{children}
|
|
29
|
-
</QueryClientProvider>
|
|
30
|
-
</trpc.Provider>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export default TRPCClientProvider;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|