@aligent/nx-cdk 0.1.0 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aligent/nx-cdk",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./src/index.d.ts",
@@ -10,7 +10,7 @@
10
10
  "directory": "packages/nx-cdk"
11
11
  },
12
12
  "dependencies": {
13
- "@nx/devkit": "20.8.1",
13
+ "@nx/devkit": "22.4.1",
14
14
  "ts-morph": "^27.0.2"
15
15
  },
16
16
  "generators": "./generators.json",
@@ -8,7 +8,7 @@ exports.NX_JSON = {
8
8
  plugins: [
9
9
  { plugin: '@nx/eslint/plugin', options: {} },
10
10
  { plugin: '@nx/js/typescript', options: { build: false } },
11
- { plugin: '@nx/vitest', options: { testMode: 'run' } },
11
+ { plugin: '@nx/vitest', options: {} },
12
12
  ],
13
13
  namedInputs: {
14
14
  default: ['{projectRoot}/**/*', 'sharedGlobals'],
@@ -28,7 +28,6 @@ exports.NX_JSON = {
28
28
  inputs: ['production', '^production'],
29
29
  outputs: ['{projectRoot}/dist'],
30
30
  },
31
- cdk: { dependsOn: ['^build'], inputs: ['production', '^production'] },
32
31
  lint: { cache: true, inputs: ['default', '^production'] },
33
32
  test: {
34
33
  cache: true,
@@ -11,8 +11,8 @@ export declare const PACKAGE_JSON: {
11
11
  readonly typecheck: "nx affected -t typecheck";
12
12
  readonly 'typecheck:all': "nx run-many -t typecheck";
13
13
  readonly postinstall: "[ -d .git ] && git config core.hooksPath '.git-hooks' && chmod +x .git-hooks/* || true";
14
- readonly 'pg:synth': "nx run application:cdk synth 'dev/**' --exclusively --profile playground";
15
- readonly 'pg:deploy': "nx run application:cdk deploy --method 'direct' 'dev/**' --exclusively --require-approval never --profile playground";
14
+ readonly 'pg:synth': "nx run application:cdk synth 'dev/**' --exclusively --bundle-mode=dev --profile=playground";
15
+ readonly 'pg:deploy': "nx run application:cdk deploy 'dev/**' --method=direct --require-approval=never --exclusively --bundle-mode=dev --profile=playground";
16
16
  readonly 'pg:destroy': "nx run application:cdk destroy 'dev/**' --profile playground";
17
17
  readonly audit: "nx run-many -t lint typecheck test --configuration coverage --skip-nx-cache";
18
18
  };
@@ -50,7 +50,7 @@ export declare const PACKAGE_JSON: {
50
50
  readonly 'jsonc-eslint-parser': "^2.4.0";
51
51
  readonly nx: "22.1.3";
52
52
  readonly prettier: "^3.6.2";
53
- readonly rolldown: "1.0.0-beta.53";
53
+ readonly rolldown: "1.0.0-rc.1";
54
54
  readonly 'store-parameters': "^1.1.3";
55
55
  readonly tslib: "^2.8.1";
56
56
  readonly tsx: "^4.21.0";
@@ -14,8 +14,8 @@ exports.PACKAGE_JSON = {
14
14
  typecheck: 'nx affected -t typecheck',
15
15
  'typecheck:all': 'nx run-many -t typecheck',
16
16
  postinstall: `[ -d .git ] && git config core.hooksPath '.git-hooks' && chmod +x .git-hooks/* || true`,
17
- 'pg:synth': `nx run application:cdk synth 'dev/**' --exclusively --profile playground`,
18
- 'pg:deploy': `nx run application:cdk deploy --method 'direct' 'dev/**' --exclusively --require-approval never --profile playground`,
17
+ 'pg:synth': `nx run application:cdk synth 'dev/**' --exclusively --bundle-mode=dev --profile=playground`,
18
+ 'pg:deploy': `nx run application:cdk deploy 'dev/**' --method=direct --require-approval=never --exclusively --bundle-mode=dev --profile=playground`,
19
19
  'pg:destroy': "nx run application:cdk destroy 'dev/**' --profile playground",
20
20
  audit: 'nx run-many -t lint typecheck test --configuration coverage --skip-nx-cache',
21
21
  },
@@ -53,8 +53,8 @@ exports.PACKAGE_JSON = {
53
53
  'jsonc-eslint-parser': '^2.4.0',
54
54
  nx: '22.1.3',
55
55
  prettier: '^3.6.2',
56
- // FIXME: [MI-251] Rolldown is still in beta. We pin the version and can upgrade with precaution.
57
- rolldown: '1.0.0-beta.53',
56
+ // FIXME: [MI-251] Rolldown is still in RC. We pin the version and can upgrade with precaution.
57
+ rolldown: '1.0.0-rc.1',
58
58
  'store-parameters': '^1.1.3',
59
59
  tslib: '^2.8.1',
60
60
  tsx: '^4.21.0',
@@ -19,8 +19,8 @@ export declare function constructPackageJsonFile(input: PackageJsonInput): {
19
19
  readonly typecheck: "nx affected -t typecheck";
20
20
  readonly 'typecheck:all': "nx run-many -t typecheck";
21
21
  readonly postinstall: "[ -d .git ] && git config core.hooksPath '.git-hooks' && chmod +x .git-hooks/* || true";
22
- readonly 'pg:synth': "nx run application:cdk synth 'dev/**' --exclusively --profile playground";
23
- readonly 'pg:deploy': "nx run application:cdk deploy --method 'direct' 'dev/**' --exclusively --require-approval never --profile playground";
22
+ readonly 'pg:synth': "nx run application:cdk synth 'dev/**' --exclusively --bundle-mode=dev --profile=playground";
23
+ readonly 'pg:deploy': "nx run application:cdk deploy 'dev/**' --method=direct --require-approval=never --exclusively --bundle-mode=dev --profile=playground";
24
24
  readonly 'pg:destroy': "nx run application:cdk destroy 'dev/**' --profile playground";
25
25
  readonly audit: "nx run-many -t lint typecheck test --configuration coverage --skip-nx-cache";
26
26
  } | {
@@ -49,7 +49,7 @@ export declare function constructPackageJsonFile(input: PackageJsonInput): {
49
49
  };
50
50
  };
51
51
  name: string;
52
- node?: undefined;
52
+ node?: never;
53
53
  };
54
54
  };
55
55
  export declare function constructProjectTsConfigFiles(type: 'application' | 'service'): {
@@ -14,7 +14,14 @@
14
14
  "color": true,
15
15
  "command": "cdk",
16
16
  "cwd": "{projectRoot}"
17
- }
17
+ },
18
+ "dependsOn": [
19
+ {
20
+ "target": "build",
21
+ "params": "forward",
22
+ "projects": "@services/*"
23
+ }
24
+ ]
18
25
  }
19
26
  }
20
27
  }
@@ -18,6 +18,7 @@ export function defineLambdaConfig(subPath) {
18
18
  return handlers.map(handler => {
19
19
  const bundledPath = handler.replace(`${handlersPath}/`, '');
20
20
  const entryName = bundledPath.replace(extname(bundledPath), '');
21
+ const bundleMode = process.env.BUNDLE_MODE?.toLowerCase() || 'prd';
21
22
 
22
23
  return defineConfig({
23
24
  input: { [entryName]: handler },
@@ -29,9 +30,8 @@ export function defineLambdaConfig(subPath) {
29
30
  output: {
30
31
  entryFileNames: '[name]/index.mjs',
31
32
  format: 'esm',
32
- // TODO: [MI-251] Support sourcemap enable/disable base on environment
33
- sourcemap: true,
34
- // FIXME: [MI-251] Rolldown is still in Beta and built-in minification is not production ready yet
33
+ sourcemap: bundleMode === 'prd' ? false : true,
34
+ // FIXME: [MI-251] Rolldown is still in RC and built-in minification is not production ready yet
35
35
  minify: false,
36
36
  legalComments: 'none',
37
37
  inlineDynamicImports: true,
@@ -20,7 +20,7 @@
20
20
  "build": {
21
21
  "executor": "nx:run-commands",
22
22
  "options": {
23
- "command": "rolldown -c rolldown.config.mjs",
23
+ "command": "rolldown -c rolldown.config.mjs --environment BUNDLE_MODE:{args.bundle-mode}",
24
24
  "color": true,
25
25
  "cwd": "{projectRoot}"
26
26
  }