@aws/nx-plugin 1.0.0-rc.39 → 1.0.0-rc.40

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.
@@ -4964,7 +4964,7 @@ SOFTWARE.
4964
4964
 
4965
4965
  ---
4966
4966
 
4967
- The following software may be included in this product: @nx/devkit (23.0.2)
4967
+ The following software may be included in this product: @nx/devkit (23.1.0)
4968
4968
  This software contains the following license and notice below:
4969
4969
 
4970
4970
  MIT License
@@ -4988,7 +4988,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
4988
4988
 
4989
4989
  ---
4990
4990
 
4991
- The following software may be included in this product: @nx/eslint (23.0.2)
4991
+ The following software may be included in this product: @nx/eslint (23.1.0)
4992
4992
  This software contains the following license and notice below:
4993
4993
 
4994
4994
  MIT License
@@ -5012,7 +5012,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
5012
5012
 
5013
5013
  ---
5014
5014
 
5015
- The following software may be included in this product: @nx/js (23.0.2)
5015
+ The following software may be included in this product: @nx/js (23.1.0)
5016
5016
  This software contains the following license and notice below:
5017
5017
 
5018
5018
  MIT License
@@ -5036,7 +5036,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
5036
5036
 
5037
5037
  ---
5038
5038
 
5039
- The following software may be included in this product: @nx/module-federation (23.0.2)
5039
+ The following software may be included in this product: @nx/module-federation (23.1.0)
5040
5040
  This software contains the following license and notice below:
5041
5041
 
5042
5042
  MIT License
@@ -5060,7 +5060,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
5060
5060
 
5061
5061
  ---
5062
5062
 
5063
- The following software may be included in this product: @nx/nx-linux-x64-gnu (23.0.2)
5063
+ The following software may be included in this product: @nx/nx-linux-x64-gnu (23.1.0)
5064
5064
  This software contains the following license and notice below:
5065
5065
 
5066
5066
  (The MIT License)
@@ -5088,7 +5088,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
5088
5088
 
5089
5089
  ---
5090
5090
 
5091
- The following software may be included in this product: @nx/playwright (23.0.2)
5091
+ The following software may be included in this product: @nx/playwright (23.1.0)
5092
5092
  This software contains the following license and notice below:
5093
5093
 
5094
5094
  MIT License
@@ -5112,7 +5112,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
5112
5112
 
5113
5113
  ---
5114
5114
 
5115
- The following software may be included in this product: @nx/react (23.0.2)
5115
+ The following software may be included in this product: @nx/react (23.1.0)
5116
5116
  This software contains the following license and notice below:
5117
5117
 
5118
5118
  MIT License
@@ -5136,7 +5136,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
5136
5136
 
5137
5137
  ---
5138
5138
 
5139
- The following software may be included in this product: @nx/rollup (23.0.2)
5139
+ The following software may be included in this product: @nx/rollup (23.1.0)
5140
5140
  This software contains the following license and notice below:
5141
5141
 
5142
5142
  MIT License
@@ -5160,7 +5160,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
5160
5160
 
5161
5161
  ---
5162
5162
 
5163
- The following software may be included in this product: @nx/vite (23.0.2)
5163
+ The following software may be included in this product: @nx/vite (23.1.0)
5164
5164
  This software contains the following license and notice below:
5165
5165
 
5166
5166
  MIT License
@@ -5184,7 +5184,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
5184
5184
 
5185
5185
  ---
5186
5186
 
5187
- The following software may be included in this product: @nx/vitest (23.0.2)
5187
+ The following software may be included in this product: @nx/vitest (23.1.0)
5188
5188
  This software contains the following license and notice below:
5189
5189
 
5190
5190
  MIT License
@@ -5208,7 +5208,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
5208
5208
 
5209
5209
  ---
5210
5210
 
5211
- The following software may be included in this product: @nx/web (23.0.2)
5211
+ The following software may be included in this product: @nx/web (23.1.0)
5212
5212
  This software contains the following license and notice below:
5213
5213
 
5214
5214
  MIT License
@@ -5232,7 +5232,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
5232
5232
 
5233
5233
  ---
5234
5234
 
5235
- The following software may be included in this product: @nx/workspace (23.0.2)
5235
+ The following software may be included in this product: @nx/workspace (23.1.0)
5236
5236
  This software contains the following license and notice below:
5237
5237
 
5238
5238
  MIT License
@@ -5881,7 +5881,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
5881
5881
 
5882
5882
  ---
5883
5883
 
5884
- The following software may be included in this product: @rspack/binding (1.6.8)
5884
+ The following software may be included in this product: @rspack/binding (2.1.4)
5885
5885
  This software contains the following license and notice below:
5886
5886
 
5887
5887
  MIT License
@@ -5909,7 +5909,7 @@ SOFTWARE.
5909
5909
 
5910
5910
  ---
5911
5911
 
5912
- The following software may be included in this product: @rspack/binding-linux-x64-gnu (1.6.8)
5912
+ The following software may be included in this product: @rspack/binding-linux-x64-gnu (2.1.4)
5913
5913
  This software contains the following license and notice below:
5914
5914
 
5915
5915
  MIT License
@@ -5936,35 +5936,7 @@ SOFTWARE.
5936
5936
 
5937
5937
  ---
5938
5938
 
5939
- The following software may be included in this product: @rspack/core (1.6.8)
5940
- This software contains the following license and notice below:
5941
-
5942
- MIT License
5943
-
5944
- Copyright (c) 2022-present Bytedance, Inc. and its affiliates.
5945
-
5946
-
5947
- Permission is hereby granted, free of charge, to any person obtaining a copy
5948
- of this software and associated documentation files (the "Software"), to deal
5949
- in the Software without restriction, including without limitation the rights
5950
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5951
- copies of the Software, and to permit persons to whom the Software is
5952
- furnished to do so, subject to the following conditions:
5953
-
5954
- The above copyright notice and this permission notice shall be included in all
5955
- copies or substantial portions of the Software.
5956
-
5957
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
5958
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
5959
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
5960
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
5961
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
5962
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
5963
- SOFTWARE.
5964
-
5965
- ---
5966
-
5967
- The following software may be included in this product: @rspack/lite-tapable (1.1.0)
5939
+ The following software may be included in this product: @rspack/core (2.1.4)
5968
5940
  This software contains the following license and notice below:
5969
5941
 
5970
5942
  MIT License
@@ -9426,19 +9398,6 @@ SOFTWARE.
9426
9398
 
9427
9399
  ---
9428
9400
 
9429
- The following software may be included in this product: axios (1.16.0)
9430
- This software contains the following license and notice below:
9431
-
9432
- # Copyright (c) 2014-present Matt Zabriskie & Collaborators
9433
-
9434
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9435
-
9436
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9437
-
9438
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9439
-
9440
- ---
9441
-
9442
9401
  The following software may be included in this product: axios (1.16.1)
9443
9402
  This software contains the following license and notice below:
9444
9403
 
@@ -21053,7 +21012,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
21053
21012
 
21054
21013
  ---
21055
21014
 
21056
- The following software may be included in this product: nx (23.0.2)
21015
+ The following software may be included in this product: nx (23.1.0)
21057
21016
  This software contains the following license and notice below:
21058
21017
 
21059
21018
  (The MIT License)
@@ -38634,67 +38593,6 @@ END OF TERMS AND CONDITIONS
38634
38593
 
38635
38594
  ---
38636
38595
 
38637
- The following software may be included in this product: typescript (5.9.3)
38638
- This software contains the following license and notice below:
38639
-
38640
- Apache License
38641
-
38642
- Version 2.0, January 2004
38643
-
38644
- http://www.apache.org/licenses/
38645
-
38646
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
38647
-
38648
- 1. Definitions.
38649
-
38650
- "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
38651
-
38652
- "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
38653
-
38654
- "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
38655
-
38656
- "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
38657
-
38658
- "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
38659
-
38660
- "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
38661
-
38662
- "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
38663
-
38664
- "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
38665
-
38666
- "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
38667
-
38668
- "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
38669
-
38670
- 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
38671
-
38672
- 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
38673
-
38674
- 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
38675
-
38676
- You must give any other recipients of the Work or Derivative Works a copy of this License; and
38677
-
38678
- You must cause any modified files to carry prominent notices stating that You changed the files; and
38679
-
38680
- You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
38681
-
38682
- If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
38683
-
38684
- 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
38685
-
38686
- 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
38687
-
38688
- 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
38689
-
38690
- 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
38691
-
38692
- 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
38693
-
38694
- END OF TERMS AND CONDITIONS
38695
-
38696
- ---
38697
-
38698
38596
  The following software may be included in this product: typescript (6.0.3)
38699
38597
  This software contains the following license and notice below:
38700
38598
 
@@ -40418,6 +40316,27 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
40418
40316
 
40419
40317
  ---
40420
40318
 
40319
+ The following software may be included in this product: semver (7.8.4)
40320
+ This software contains the following license and notice below:
40321
+
40322
+ The ISC License
40323
+
40324
+ Copyright (c) Isaac Z. Schlueter and Contributors
40325
+
40326
+ Permission to use, copy, modify, and/or distribute this software for any
40327
+ purpose with or without fee is hereby granted, provided that the above
40328
+ copyright notice and this permission notice appear in all copies.
40329
+
40330
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
40331
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
40332
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
40333
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
40334
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
40335
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
40336
+ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
40337
+
40338
+ ---
40339
+
40421
40340
  The following software may be included in this product: setprototypeof (1.2.0)
40422
40341
  This software contains the following license and notice below:
40423
40342
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws/nx-plugin",
3
- "version": "1.0.0-rc.39",
3
+ "version": "1.0.0-rc.40",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/awslabs/nx-plugin-for-aws.git",
@@ -36,7 +36,7 @@
36
36
  "node": ">=20.19.0"
37
37
  },
38
38
  "peerDependencies": {
39
- "nx": "23.0.2"
39
+ "nx": "23.1.0"
40
40
  },
41
41
  "dependencies": {
42
42
  "@apidevtools/swagger-parser": "12.1.0",
@@ -45,10 +45,10 @@
45
45
  "@getgrit/gritql": "0.0.3",
46
46
  "@iarna/toml": "2.2.5",
47
47
  "@modelcontextprotocol/sdk": "1.29.0",
48
- "@nx/devkit": "23.0.2",
49
- "@nx/js": "23.0.2",
50
- "@nx/react": "23.0.2",
51
- "@nx/vite": "23.0.2",
48
+ "@nx/devkit": "23.1.0",
49
+ "@nx/js": "23.1.0",
50
+ "@nx/react": "23.1.0",
51
+ "@nx/vite": "23.1.0",
52
52
  "@types/estree": "1.0.9",
53
53
  "@types/js-yaml": "4.0.9",
54
54
  "@types/mdast": "4.0.4",
@@ -12,14 +12,14 @@ exports[`infra generator > should add required dependencies to package.json > de
12
12
 
13
13
  exports[`infra generator > should add required dependencies to package.json > dev-dependencies 1`] = `
14
14
  {
15
- "@nx/js": "23.0.2",
16
- "@nx/vitest": "23.0.2",
15
+ "@nx/js": "23.1.0",
16
+ "@nx/vitest": "23.1.0",
17
17
  "@swc/helpers": "~0.5.18",
18
18
  "@types/node": "26.1.1",
19
19
  "@vitest/coverage-v8": "4.1.10",
20
20
  "jsdom": "^27.1.0",
21
21
  "tsx": "4.23.0",
22
- "typescript": "~5.9.2",
22
+ "typescript": "~6.0.3",
23
23
  "vite": "8.1.4",
24
24
  "vitest": "4.1.10",
25
25
  }
@@ -35,14 +35,14 @@ exports[`infra generator > should add required dependencies to package.json > pa
35
35
  "source-map-support": "0.5.21",
36
36
  },
37
37
  "devDependencies": {
38
- "@nx/js": "23.0.2",
39
- "@nx/vitest": "23.0.2",
38
+ "@nx/js": "23.1.0",
39
+ "@nx/vitest": "23.1.0",
40
40
  "@swc/helpers": "~0.5.18",
41
41
  "@types/node": "26.1.1",
42
42
  "@vitest/coverage-v8": "4.1.10",
43
43
  "jsdom": "^27.1.0",
44
44
  "tsx": "4.23.0",
45
- "typescript": "~5.9.2",
45
+ "typescript": "~6.0.3",
46
46
  "vite": "8.1.4",
47
47
  "vitest": "4.1.10",
48
48
  },
@@ -8,7 +8,7 @@ import { TS_MCP_SERVER_GENERATOR_INFO } from "../ts/mcp-server/generator.js";
8
8
  import { ensureAwsNxPluginConfig } from "../utils/config/utils.js";
9
9
  import { formatFilesInSubtree } from "../utils/format.js";
10
10
  import { addGeneratorMetricsIfApplicable } from "../utils/metrics.js";
11
- import { getGeneratorInfo } from "../utils/nx.js";
11
+ import { getGeneratorInfo, mergeTargetDefault } from "../utils/nx.js";
12
12
  import { addLicenseCheckToAllLintTargets, defaultLicenseConfig, ensureDependencyCheckBlock, ensureLicenseExceptions, ensurePythonLicenseCollector, updateLicenseCheckTargetInputs, writeLicenseConfig } from "./config.js";
13
13
  import { AG_UI_LANGGRAPH_EXCEPTIONS, MCP_INSPECTOR_EXCEPTIONS } from "./known-exceptions.js";
14
14
  import { SYNC_GENERATOR_NAME } from "./sync/generator.js";
@@ -37,18 +37,17 @@ export async function licenseGenerator(tree, options) {
37
37
  addLicenseCheckToAllLintTargets(tree);
38
38
  }
39
39
  const nxJson = readNxJson(tree);
40
- const lintTargetDefault = {
41
- ...nxJson.targetDefaults?.lint,
42
- syncGenerators: [
43
- ...(nxJson.targetDefaults?.lint?.syncGenerators ?? []).filter((g)=>g !== SYNC_GENERATOR_NAME),
44
- SYNC_GENERATOR_NAME
45
- ]
46
- };
47
40
  const updatedNxJson = {
48
41
  ...nxJson,
49
42
  targetDefaults: {
50
43
  ...nxJson.targetDefaults,
51
- lint: lintTargetDefault
44
+ lint: mergeTargetDefault(nxJson.targetDefaults?.lint, (base)=>({
45
+ ...base,
46
+ syncGenerators: [
47
+ ...(base.syncGenerators ?? []).filter((g)=>g !== SYNC_GENERATOR_NAME),
48
+ SYNC_GENERATOR_NAME
49
+ ]
50
+ }))
52
51
  }
53
52
  };
54
53
  updateNxJson(tree, updatedNxJson);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../packages/nx-plugin/src/license/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { getProjects, readNxJson, type Tree, updateNxJson } from '@nx/devkit';\nimport { PY_AGENT_GENERATOR_INFO } from '../py/agent/generator';\nimport { PY_MCP_SERVER_GENERATOR_INFO } from '../py/mcp-server/generator';\nimport { TS_MCP_SERVER_GENERATOR_INFO } from '../ts/mcp-server/generator';\nimport { ensureAwsNxPluginConfig } from '../utils/config/utils';\nimport { formatFilesInSubtree } from '../utils/format';\nimport { addGeneratorMetricsIfApplicable } from '../utils/metrics';\nimport { getGeneratorInfo, type NxGeneratorInfo } from '../utils/nx';\nimport {\n addLicenseCheckToAllLintTargets,\n defaultLicenseConfig,\n ensureDependencyCheckBlock,\n ensureLicenseExceptions,\n ensurePythonLicenseCollector,\n updateLicenseCheckTargetInputs,\n writeLicenseConfig,\n} from './config';\nimport {\n AG_UI_LANGGRAPH_EXCEPTIONS,\n MCP_INSPECTOR_EXCEPTIONS,\n} from './known-exceptions';\nimport type { LicenseGeneratorSchema } from './schema';\nimport { SYNC_GENERATOR_NAME } from './sync/generator';\n\nexport const LICENSE_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\nexport async function licenseGenerator(\n tree: Tree,\n options: LicenseGeneratorSchema,\n) {\n const { license, copyrightHolder } = options;\n const dependencyCheckEnabled = options.dependencyCheck !== false;\n\n await ensureAwsNxPluginConfig(tree);\n await writeLicenseConfig(\n tree,\n defaultLicenseConfig(license, copyrightHolder),\n );\n\n if (dependencyCheckEnabled) {\n const hasPython = hasPythonProjects(tree);\n await ensureDependencyCheckBlock(tree, {\n includeCollectors: hasPython ? 'npm+python' : 'npm',\n });\n // When the dependencyCheck block already existed (e.g. on a re-run after\n // python projects were added), the block above is a no-op — so explicitly\n // ensure the python collector is present. This is idempotent.\n if (hasPython) {\n await ensurePythonLicenseCollector(tree);\n }\n await addExceptionsForExistingProjects(tree);\n await writeLicenseCheckTarget(tree);\n // Make every existing project's lint target depend on the root\n // license-check target, so the check runs as part of lint/build regardless\n // of whether projects were created before or after the license generator.\n addLicenseCheckToAllLintTargets(tree);\n }\n\n const nxJson = readNxJson(tree);\n const lintTargetDefault = {\n ...nxJson.targetDefaults?.lint,\n syncGenerators: [\n ...(nxJson.targetDefaults?.lint?.syncGenerators ?? []).filter(\n (g) => g !== SYNC_GENERATOR_NAME,\n ),\n SYNC_GENERATOR_NAME,\n ],\n };\n\n const updatedNxJson = {\n ...nxJson,\n targetDefaults: {\n ...nxJson.targetDefaults,\n lint: lintTargetDefault,\n },\n };\n\n updateNxJson(tree, updatedNxJson);\n\n await addGeneratorMetricsIfApplicable(tree, [LICENSE_GENERATOR_INFO]);\n\n await formatFilesInSubtree(tree);\n}\n\n/**\n * Write/update root project.json with the license-check target.\n */\nconst writeLicenseCheckTarget = async (tree: Tree): Promise<void> => {\n const rootProjectJsonPath = 'project.json';\n let rootProject: any = {};\n if (tree.exists(rootProjectJsonPath)) {\n rootProject = JSON.parse(tree.read(rootProjectJsonPath, 'utf-8')!);\n }\n rootProject.targets = rootProject.targets ?? {};\n rootProject.targets['license-check'] = {\n executor: '@aws/nx-plugin:license-check',\n cache: true,\n inputs: [],\n options: {},\n };\n tree.write(rootProjectJsonPath, JSON.stringify(rootProject, null, 2));\n\n // Populate `inputs` from the lockfiles actually present (+ uv.lock if a\n // Python collector is configured) and the config file.\n await updateLicenseCheckTargetInputs(tree);\n\n // Adding a root project.json registers the workspace root as an Nx project.\n // Suppress target inference from the root package.json scripts (build, lint,\n // test, etc. are `nx run-many` wrappers) so they don't become targets — an\n // inferred `build` target would recurse when running `nx run-many --target build`.\n if (tree.exists('package.json')) {\n const packageJson = JSON.parse(tree.read('package.json', 'utf-8')!);\n if (\n !packageJson.nx?.includedScripts ||\n packageJson.nx.includedScripts.length !== 0\n ) {\n packageJson.nx = { ...packageJson.nx, includedScripts: [] };\n tree.write('package.json', JSON.stringify(packageJson, null, 2));\n }\n }\n};\n\nconst addExceptionsForExistingProjects = async (tree: Tree): Promise<void> => {\n const projects = getProjects(tree);\n let needsMcp = false;\n // A LangChain AG-UI agent pulls jsonpatch/jsonpointer (BSD-3-Clause but with\n // only free-text metadata) via langchain-core. The py#agent generator adds\n // these exceptions itself, but if the license generator runs afterwards (or\n // the agent predates the dependency-check block) they may be missing, so\n // re-assert them here when such an agent exists.\n let needsLangchain = false;\n\n const mcpIds = [\n TS_MCP_SERVER_GENERATOR_INFO.id,\n PY_MCP_SERVER_GENERATOR_INFO.id,\n ];\n\n for (const [, config] of projects) {\n const components =\n (config as any).metadata?.components ??\n (config as any).metadata?.generators ??\n [];\n for (const comp of components) {\n const gen = comp.generator ?? comp;\n if (typeof gen === 'string' && mcpIds.includes(gen)) {\n needsMcp = true;\n }\n if (\n gen === PY_AGENT_GENERATOR_INFO.id &&\n comp.framework === 'langchain'\n ) {\n needsLangchain = true;\n }\n }\n }\n\n const exceptions = [\n ...(needsMcp ? MCP_INSPECTOR_EXCEPTIONS : []),\n ...(needsLangchain ? AG_UI_LANGGRAPH_EXCEPTIONS : []),\n ];\n\n if (exceptions.length > 0) {\n await ensureLicenseExceptions(tree, exceptions);\n }\n};\n\nconst hasPythonProjects = (tree: Tree): boolean => {\n const projects = getProjects(tree);\n for (const [, config] of projects) {\n if (tree.exists(`${config.root}/pyproject.toml`)) return true;\n }\n return tree.exists('pyproject.toml');\n};\n\nexport default licenseGenerator;\n"],"names":["getProjects","readNxJson","updateNxJson","PY_AGENT_GENERATOR_INFO","PY_MCP_SERVER_GENERATOR_INFO","TS_MCP_SERVER_GENERATOR_INFO","ensureAwsNxPluginConfig","formatFilesInSubtree","addGeneratorMetricsIfApplicable","getGeneratorInfo","addLicenseCheckToAllLintTargets","defaultLicenseConfig","ensureDependencyCheckBlock","ensureLicenseExceptions","ensurePythonLicenseCollector","updateLicenseCheckTargetInputs","writeLicenseConfig","AG_UI_LANGGRAPH_EXCEPTIONS","MCP_INSPECTOR_EXCEPTIONS","SYNC_GENERATOR_NAME","LICENSE_GENERATOR_INFO","filename","licenseGenerator","tree","options","license","copyrightHolder","dependencyCheckEnabled","dependencyCheck","hasPython","hasPythonProjects","includeCollectors","addExceptionsForExistingProjects","writeLicenseCheckTarget","nxJson","lintTargetDefault","targetDefaults","lint","syncGenerators","filter","g","updatedNxJson","rootProjectJsonPath","rootProject","exists","JSON","parse","read","targets","executor","cache","inputs","write","stringify","packageJson","nx","includedScripts","length","projects","needsMcp","needsLangchain","mcpIds","id","config","components","metadata","generators","comp","gen","generator","includes","framework","exceptions","root"],"mappings":"AAAA;;;CAGC,GACD,SAASA,WAAW,EAAEC,UAAU,EAAaC,YAAY,QAAQ,aAAa;AAC9E,SAASC,uBAAuB,QAAQ,2BAAwB;AAChE,SAASC,4BAA4B,QAAQ,gCAA6B;AAC1E,SAASC,4BAA4B,QAAQ,gCAA6B;AAC1E,SAASC,uBAAuB,QAAQ,2BAAwB;AAChE,SAASC,oBAAoB,QAAQ,qBAAkB;AACvD,SAASC,+BAA+B,QAAQ,sBAAmB;AACnE,SAASC,gBAAgB,QAA8B,iBAAc;AACrE,SACEC,+BAA+B,EAC/BC,oBAAoB,EACpBC,0BAA0B,EAC1BC,uBAAuB,EACvBC,4BAA4B,EAC5BC,8BAA8B,EAC9BC,kBAAkB,QACb,cAAW;AAClB,SACEC,0BAA0B,EAC1BC,wBAAwB,QACnB,wBAAqB;AAE5B,SAASC,mBAAmB,QAAQ,sBAAmB;AAEvD,OAAO,MAAMC,yBAA0CX,iBACrD,Y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gBACnDT,WAAW;YACb;YACA,IACES,QAAQjE,wBAAwB2D,EAAE,IAClCK,KAAKI,SAAS,KAAK,aACnB;gBACAX,iBAAiB;YACnB;QACF;IACF;IAEA,MAAMY,aAAa;WACbb,WAAWzC,2BAA2B,EAAE;WACxC0C,iBAAiB3C,6BAA6B,EAAE;KACrD;IAED,IAAIuD,WAAWf,MAAM,GAAG,GAAG;QACzB,MAAM5C,wBAAwBU,MAAMiD;IACtC;AACF;AAEA,MAAM1C,oBAAoB,CAACP;IACzB,MAAMmC,WAAW1D,YAAYuB;IAC7B,KAAK,MAAM,GAAGwC,OAAO,IAAIL,SAAU;QACjC,IAAInC,KAAKqB,MAAM,CAAC,GAAGmB,OAAOU,IAAI,CAAC,eAAe,CAAC,GAAG,OAAO;IAC3D;IACA,OAAOlD,KAAKqB,MAAM,CAAC;AACrB;AAEA,eAAetB,iBAAiB"}
1
+ {"version":3,"sources":["../../../../../packages/nx-plugin/src/license/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { getProjects, readNxJson, type Tree, updateNxJson } from '@nx/devkit';\nimport { PY_AGENT_GENERATOR_INFO } from '../py/agent/generator';\nimport { PY_MCP_SERVER_GENERATOR_INFO } from '../py/mcp-server/generator';\nimport { TS_MCP_SERVER_GENERATOR_INFO } from '../ts/mcp-server/generator';\nimport { ensureAwsNxPluginConfig } from '../utils/config/utils';\nimport { formatFilesInSubtree } from '../utils/format';\nimport { addGeneratorMetricsIfApplicable } from '../utils/metrics';\nimport {\n getGeneratorInfo,\n mergeTargetDefault,\n type NxGeneratorInfo,\n} from '../utils/nx';\nimport {\n addLicenseCheckToAllLintTargets,\n defaultLicenseConfig,\n ensureDependencyCheckBlock,\n ensureLicenseExceptions,\n ensurePythonLicenseCollector,\n updateLicenseCheckTargetInputs,\n writeLicenseConfig,\n} from './config';\nimport {\n AG_UI_LANGGRAPH_EXCEPTIONS,\n MCP_INSPECTOR_EXCEPTIONS,\n} from './known-exceptions';\nimport type { LicenseGeneratorSchema } from './schema';\nimport { SYNC_GENERATOR_NAME } from './sync/generator';\n\nexport const LICENSE_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\nexport async function licenseGenerator(\n tree: Tree,\n options: LicenseGeneratorSchema,\n) {\n const { license, copyrightHolder } = options;\n const dependencyCheckEnabled = options.dependencyCheck !== false;\n\n await ensureAwsNxPluginConfig(tree);\n await writeLicenseConfig(\n tree,\n defaultLicenseConfig(license, copyrightHolder),\n );\n\n if (dependencyCheckEnabled) {\n const hasPython = hasPythonProjects(tree);\n await ensureDependencyCheckBlock(tree, {\n includeCollectors: hasPython ? 'npm+python' : 'npm',\n });\n // When the dependencyCheck block already existed (e.g. on a re-run after\n // python projects were added), the block above is a no-op — so explicitly\n // ensure the python collector is present. This is idempotent.\n if (hasPython) {\n await ensurePythonLicenseCollector(tree);\n }\n await addExceptionsForExistingProjects(tree);\n await writeLicenseCheckTarget(tree);\n // Make every existing project's lint target depend on the root\n // license-check target, so the check runs as part of lint/build regardless\n // of whether projects were created before or after the license generator.\n addLicenseCheckToAllLintTargets(tree);\n }\n\n const nxJson = readNxJson(tree);\n const updatedNxJson = {\n ...nxJson,\n targetDefaults: {\n ...nxJson.targetDefaults,\n lint: mergeTargetDefault(nxJson.targetDefaults?.lint, (base) => ({\n ...base,\n syncGenerators: [\n ...(base.syncGenerators ?? []).filter(\n (g) => g !== SYNC_GENERATOR_NAME,\n ),\n SYNC_GENERATOR_NAME,\n ],\n })),\n },\n };\n\n updateNxJson(tree, updatedNxJson);\n\n await addGeneratorMetricsIfApplicable(tree, [LICENSE_GENERATOR_INFO]);\n\n await formatFilesInSubtree(tree);\n}\n\n/**\n * Write/update root project.json with the license-check target.\n */\nconst writeLicenseCheckTarget = async (tree: Tree): Promise<void> => {\n const rootProjectJsonPath = 'project.json';\n let rootProject: any = {};\n if (tree.exists(rootProjectJsonPath)) {\n rootProject = JSON.parse(tree.read(rootProjectJsonPath, 'utf-8')!);\n }\n rootProject.targets = rootProject.targets ?? {};\n rootProject.targets['license-check'] = {\n executor: '@aws/nx-plugin:license-check',\n cache: true,\n inputs: [],\n options: {},\n };\n tree.write(rootProjectJsonPath, JSON.stringify(rootProject, null, 2));\n\n // Populate `inputs` from the lockfiles actually present (+ uv.lock if a\n // Python collector is configured) and the config file.\n await updateLicenseCheckTargetInputs(tree);\n\n // Adding a root project.json registers the workspace root as an Nx project.\n // Suppress target inference from the root package.json scripts (build, lint,\n // test, etc. are `nx run-many` wrappers) so they don't become targets — an\n // inferred `build` target would recurse when running `nx run-many --target build`.\n if (tree.exists('package.json')) {\n const packageJson = JSON.parse(tree.read('package.json', 'utf-8')!);\n if (\n !packageJson.nx?.includedScripts ||\n packageJson.nx.includedScripts.length !== 0\n ) {\n packageJson.nx = { ...packageJson.nx, includedScripts: [] };\n tree.write('package.json', JSON.stringify(packageJson, null, 2));\n }\n }\n};\n\nconst addExceptionsForExistingProjects = async (tree: Tree): Promise<void> => {\n const projects = getProjects(tree);\n let needsMcp = false;\n // A LangChain AG-UI agent pulls jsonpatch/jsonpointer (BSD-3-Clause but with\n // only free-text metadata) via langchain-core. The py#agent generator adds\n // these exceptions itself, but if the license generator runs afterwards (or\n // the agent predates the dependency-check block) they may be missing, so\n // re-assert them here when such an agent exists.\n let needsLangchain = false;\n\n const mcpIds = [\n TS_MCP_SERVER_GENERATOR_INFO.id,\n PY_MCP_SERVER_GENERATOR_INFO.id,\n ];\n\n for (const [, config] of projects) {\n const components =\n (config as any).metadata?.components ??\n (config as any).metadata?.generators ??\n [];\n for (const comp of components) {\n const gen = comp.generator ?? comp;\n if (typeof gen === 'string' && mcpIds.includes(gen)) {\n needsMcp = true;\n }\n if (\n gen === PY_AGENT_GENERATOR_INFO.id &&\n comp.framework === 'langchain'\n ) {\n needsLangchain = true;\n }\n }\n }\n\n const exceptions = [\n ...(needsMcp ? MCP_INSPECTOR_EXCEPTIONS : []),\n ...(needsLangchain ? AG_UI_LANGGRAPH_EXCEPTIONS : []),\n ];\n\n if (exceptions.length > 0) {\n await ensureLicenseExceptions(tree, exceptions);\n }\n};\n\nconst hasPythonProjects = (tree: Tree): boolean => {\n const projects = getProjects(tree);\n for (const [, config] of projects) {\n if (tree.exists(`${config.root}/pyproject.toml`)) return true;\n }\n return tree.exists('pyproject.toml');\n};\n\nexport default licenseGenerator;\n"],"names":["getProjects","readNxJson","updateNxJson","PY_AGENT_GENERATOR_INFO","PY_MCP_SERVER_GENERATOR_INFO","TS_MCP_SERVER_GENERATOR_INFO","ensureAwsNxPluginConfig","formatFilesInSubtree","addGeneratorMetricsIfApplicable","getGeneratorInfo","mergeTargetDefault","addLicenseCheckToAllLintTargets","defaultLicenseConfig","ensureDependencyCheckBlock","ensureLicenseExceptions","ensurePythonLicenseCollector","updateLicenseCheckTargetInputs","writeLicenseConfig","AG_UI_LANGGRAPH_EXCEPTIONS","MCP_INSPECTOR_EXCEPTIONS","SYNC_GENERATOR_NAME","LICENSE_GENERATOR_INFO","filename","licenseGenerator","tree","options","license","copyrightHolder","dependencyCheckEnabled","dependencyCheck","hasPython","hasPythonProjects","includeCollectors","addExceptionsForExistingProjects","writeLicenseCheckTarget","nxJson","updatedNxJson","targetDefaults","lint","base","syncGenerators","filter","g","rootProjectJsonPath","rootProject","exists","JSON","parse","read","targets","executor","cache","inputs","write","stringify","packageJson","nx","includedScripts","length","projects","needsMcp","needsLangchain","mcpIds","id","config","components","metadata","generators","comp","gen","generator","includes","framework","exceptions","root"],"mappings":"AAAA;;;CAGC,GACD,SAASA,WAAW,EAAEC,UAAU,EAAaC,YAAY,QAAQ,aAAa;AAC9E,SAASC,uBAAuB,QAAQ,2BAAwB;AAChE,SAASC,4BAA4B,QAAQ,gCAA6B;AAC1E,SAASC,4BAA4B,QAAQ,gCAA6B;AAC1E,SAASC,uBAAuB,QAAQ,2BAAwB;AAChE,SAASC,oBAAoB,QAAQ,qBAAkB;AACvD,S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AMC,SAAS;QACbzD,6BAA6B0D,EAAE;QAC/B3D,6BAA6B2D,EAAE;KAChC;IAED,KAAK,MAAM,GAAGC,OAAO,IAAIL,SAAU;QACjC,MAAMM,aACJ,AAACD,OAAeE,QAAQ,EAAED,cAC1B,AAACD,OAAeE,QAAQ,EAAEC,cAC1B,EAAE;QACJ,KAAK,MAAMC,QAAQH,WAAY;YAC7B,MAAMI,MAAMD,KAAKE,SAAS,IAAIF;YAC9B,IAAI,OAAOC,QAAQ,YAAYP,OAAOS,QAAQ,CAACF,MAAM;gBACnDT,WAAW;YACb;YACA,IACES,QAAQlE,wBAAwB4D,EAAE,IAClCK,KAAKI,SAAS,KAAK,aACnB;gBACAX,iBAAiB;YACnB;QACF;IACF;IAEA,MAAMY,aAAa;WACbb,WAAWzC,2BAA2B,EAAE;WACxC0C,iBAAiB3C,6BAA6B,EAAE;KACrD;IAED,IAAIuD,WAAWf,MAAM,GAAG,GAAG;QACzB,MAAM5C,wBAAwBU,MAAMiD;IACtC;AACF;AAEA,MAAM1C,oBAAoB,CAACP;IACzB,MAAMmC,WAAW3D,YAAYwB;IAC7B,KAAK,MAAM,GAAGwC,OAAO,IAAIL,SAAU;QACjC,IAAInC,KAAKqB,MAAM,CAAC,GAAGmB,OAAOU,IAAI,CAAC,eAAe,CAAC,GAAG,OAAO;IAC3D;IACA,OAAOlD,KAAKqB,MAAM,CAAC;AACrB;AAEA,eAAetB,iBAAiB"}
@@ -339,11 +339,11 @@ exports[`preset generator > should run successfully > package.json 1`] = `
339
339
  "dependencies": {},
340
340
  "devDependencies": {
341
341
  "@biomejs/biome": "2.5.3",
342
- "@nx/js": "23.0.2",
343
- "@nx/workspace": "23.0.2",
342
+ "@nx/js": "23.1.0",
343
+ "@nx/workspace": "23.1.0",
344
344
  "@swc/helpers": "~0.5.18",
345
- "nx": "23.0.2",
346
- "typescript": "6.0.3"
345
+ "nx": "23.1.0",
346
+ "typescript": "~6.0.3"
347
347
  },
348
348
  "type": "module",
349
349
  "scripts": {
@@ -9,7 +9,7 @@ import { addGeneratorMetricsIfApplicable } from "../../utils/metrics.js";
9
9
  import { isEsmWorkspace } from "../../utils/module-format.js";
10
10
  import { toKebabCase } from "../../utils/names.js";
11
11
  import { getNpmScopePrefix } from "../../utils/npm-scope.js";
12
- import { addGeneratorMetadata, getGeneratorInfo, projectExists } from "../../utils/nx.js";
12
+ import { addGeneratorMetadata, getGeneratorInfo, mergeTargetDefault, projectExists } from "../../utils/nx.js";
13
13
  import { sortObjectKeys } from "../../utils/object.js";
14
14
  import { getPackageManagerDisplayCommands } from "../../utils/pkg-manager.js";
15
15
  import { configureTsProject } from "./ts-project-utils.js";
@@ -97,31 +97,24 @@ export const TS_LIB_GENERATOR_INFO = getGeneratorInfo(import.meta.filename);
97
97
  }
98
98
  ]
99
99
  };
100
- nxJson.targetDefaults = {
101
- ...nxJson.targetDefaults,
102
- compile: {
103
- cache: true,
104
- ...nxJson.targetDefaults?.compile,
105
- inputs: [
106
- ...(nxJson.targetDefaults?.compile?.inputs ?? []).filter((i)=>i !== 'default'),
107
- 'default'
108
- ]
109
- },
110
- build: {
111
- cache: true,
112
- ...nxJson.targetDefaults?.build,
100
+ const withDefaultInput = (base)=>({
101
+ ...base,
113
102
  inputs: [
114
- ...(nxJson.targetDefaults?.build?.inputs ?? []).filter((i)=>i !== 'default'),
103
+ ...(base.inputs ?? []).filter((i)=>i !== 'default'),
115
104
  'default'
116
105
  ]
117
- },
118
- test: {
119
- ...nxJson.targetDefaults?.test,
120
- inputs: [
121
- ...(nxJson.targetDefaults?.test?.inputs ?? []).filter((i)=>i !== 'default'),
122
- 'default'
123
- ]
124
- }
106
+ });
107
+ nxJson.targetDefaults = {
108
+ ...nxJson.targetDefaults,
109
+ compile: mergeTargetDefault(nxJson.targetDefaults?.compile, (base)=>({
110
+ cache: true,
111
+ ...withDefaultInput(base)
112
+ })),
113
+ build: mergeTargetDefault(nxJson.targetDefaults?.build, (base)=>({
114
+ cache: true,
115
+ ...withDefaultInput(base)
116
+ })),
117
+ test: mergeTargetDefault(nxJson.targetDefaults?.test, withDefaultInput)
125
118
  };
126
119
  // Ensure we only declare a single typescript plugin with the correct settings
127
120
  nxJson.plugins = [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../packages/nx-plugin/src/ts/lib/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n type NxJsonConfiguration,\n OverwriteStrategy,\n readProjectConfiguration,\n type Tree,\n updateJson,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport { libraryGenerator } from '@nx/js';\nimport { formatFilesInSubtree } from '../../utils/format';\nimport { installDependencies } from '../../utils/install';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics';\nimport { isEsmWorkspace } from '../../utils/module-format';\nimport { toKebabCase } from '../../utils/names';\nimport { getNpmScopePrefix } from '../../utils/npm-scope';\nimport {\n addGeneratorMetadata,\n getGeneratorInfo,\n type NxGeneratorInfo,\n projectExists,\n} from '../../utils/nx';\nimport { sortObjectKeys } from '../../utils/object';\nimport { getPackageManagerDisplayCommands } from '../../utils/pkg-manager';\nimport type { TsProjectGeneratorSchema } from './schema';\nimport { configureTsProject } from './ts-project-utils';\n\nexport const TS_LIB_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\nexport interface TsLibDetails {\n /**\n * Full package name including scope (eg @foo/bar)\n */\n readonly fullyQualifiedName: string;\n /**\n * Directory of the library relative to the root\n */\n readonly dir: string;\n}\n\n/**\n * Returns details about the TS library to be created\n */\nexport const getTsLibDetails = (\n tree: Tree,\n schema: TsProjectGeneratorSchema,\n): TsLibDetails => {\n const scope = getNpmScopePrefix(tree);\n const normalizedName = toKebabCase(schema.name);\n const fullyQualifiedName = `${scope}${normalizedName}`;\n // NB: interactive nx generator cli can pass empty string\n const dir = joinPathFragments(\n schema.directory || '.',\n schema.subDirectory || normalizedName,\n );\n return { dir, fullyQualifiedName };\n};\n\n/**\n * Generates a typescript project\n */\nexport const tsProjectGenerator = async (\n tree: Tree,\n schema: TsProjectGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const { fullyQualifiedName, dir } = getTsLibDetails(tree, schema);\n // The module format is workspace-wide, established by the preset when the\n // workspace is created, so vending generators always infer it from the tree.\n const esm = isEsmWorkspace(tree);\n\n // Only scaffold the project on first run; on re-run skip creation so user\n // edits are preserved, but continue to (re)apply the configuration below.\n if (!projectExists(tree, fullyQualifiedName)) {\n await libraryGenerator(tree, {\n ...schema,\n name: fullyQualifiedName,\n directory: dir,\n skipPackageJson: true,\n bundler: 'tsc', // TODO: consider supporting others\n linter: 'none',\n unitTestRunner: 'vitest',\n // Register the @nx/vitest plugin so the test target is inferred rather\n // than emitting the deprecated @nx/vitest:test executor target.\n addPlugin: true,\n });\n\n // Replace with simpler sample source code\n tree.delete(joinPathFragments(dir, 'src'));\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files'),\n joinPathFragments(dir),\n {\n fullyQualifiedName,\n esm,\n pkgMgrCmd: getPackageManagerDisplayCommands().exec,\n },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n }\n await configureTsProject(tree, {\n dir,\n fullyQualifiedName,\n esm,\n });\n\n const projectConfiguration = readProjectConfiguration(\n tree,\n fullyQualifiedName,\n );\n const targets = projectConfiguration.targets;\n\n targets['compile'] = {\n executor: 'nx:run-commands',\n outputs: ['{workspaceRoot}/dist/{projectRoot}/tsc'],\n options: {\n command: 'tsc --build tsconfig.lib.json',\n cwd: '{projectRoot}',\n },\n };\n targets['build'] = {\n dependsOn: ['lint', 'compile', 'test'],\n };\n projectConfiguration.targets = sortObjectKeys(targets);\n\n updateProjectConfiguration(tree, fullyQualifiedName, projectConfiguration);\n\n addGeneratorMetadata(tree, fullyQualifiedName, TS_LIB_GENERATOR_INFO);\n\n updateJson(tree, 'nx.json', (nxJson: NxJsonConfiguration) => {\n nxJson.namedInputs = {\n ...nxJson.namedInputs,\n default: [\n ...(nxJson.namedInputs?.default ?? []).filter(\n (input) =>\n typeof input !== 'object' ||\n !('dependentTasksOutputFiles' in input) ||\n !(input.dependentTasksOutputFiles === '**/*' && input.transitive),\n ),\n {\n dependentTasksOutputFiles: '**/*',\n transitive: true,\n },\n ],\n };\n\n nxJson.targetDefaults = {\n ...nxJson.targetDefaults,\n compile: {\n cache: true,\n ...nxJson.targetDefaults?.compile,\n inputs: [\n ...(nxJson.targetDefaults?.compile?.inputs ?? []).filter(\n (i) => i !== 'default',\n ),\n 'default',\n ],\n },\n build: {\n cache: true,\n ...nxJson.targetDefaults?.build,\n inputs: [\n ...(nxJson.targetDefaults?.build?.inputs ?? []).filter(\n (i) => i !== 'default',\n ),\n 'default',\n ],\n },\n test: {\n ...nxJson.targetDefaults?.test,\n inputs: [\n ...(nxJson.targetDefaults?.test?.inputs ?? []).filter(\n (i) => i !== 'default',\n ),\n 'default',\n ],\n },\n };\n\n // Ensure we only declare a single typescript plugin with the correct settings\n nxJson.plugins = [\n {\n plugin: '@nx/js/typescript',\n options: {\n typecheck: {\n targetName: 'typecheck',\n },\n build: {\n targetName: 'compile',\n configName: 'tsconfig.lib.json',\n buildDepsName: 'build-deps',\n watchDepsName: 'watch-deps',\n },\n },\n },\n ...(nxJson.plugins ?? []).filter(\n (p) => typeof p === 'string' || p.plugin !== '@nx/js/typescript',\n ),\n ];\n\n return nxJson;\n });\n\n await addGeneratorMetricsIfApplicable(tree, [TS_LIB_GENERATOR_INFO]);\n\n await formatFilesInSubtree(tree);\n\n // `installDependencies` ensures vitest resolves for the `typescript` language (the\n // generated vitest.config.mts imports it and Nx loads that config when\n // computing the project graph), so a deferred install still runs when needed.\n return () =>\n installDependencies(tree, schema.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\nexport default tsProjectGenerator;\n"],"names":["generateFiles","joinPathFragments","OverwriteStrategy","readProjectConfiguration","updateJson","updateProjectConfiguration","libraryGenerator","formatFilesInSubtree","installDependencies","addGeneratorMetricsIfApplicable","isEsmWorkspace","toKebabCase","getNpmScopePrefix","addGeneratorMetadata","getGeneratorInfo","projectExists","sortObjectKeys","getPackageManagerDisplayCommands","configureTsProject","TS_LIB_GENERATOR_INFO","filename","getTsLibDetails","tree","schema","scope","normalizedName","name","fullyQualifiedName","dir","directory","subDirectory","tsProjectGenerator","esm","skipPackageJson","bundler","linter","unitTestRunner","addPlugin","delete","dirname","pkgMgrCmd","exec","overwriteStrategy","KeepExisting","projectConfiguration","targets","executor","outputs","options","command","cwd","dependsOn","nxJson","namedInputs","default","filter","input","dependentTasksOutputFiles","transitive","targetDefaults","compile","cache","inputs","i","build","test","plugins","plugin","typecheck","targetName","configName","buildDepsName","watchDepsName","p","preferInstallDependencies","languages"],"mappings":"AAAA;;;CAGC,GACD,SAEEA,aAAa,EACbC,iBAAiB,EAEjBC,iBAAiB,EACjBC,wBAAwB,EAExBC,UAAU,EACVC,0BAA0B,QACrB,aAAa;AACpB,SAASC,gBAAgB,QAAQ,SAAS;AAC1C,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,mBAAmB,QAAQ,yBAAsB;AAC1D,SAASC,+BAA+B,QAAQ,yBAAsB;AACtE,SAASC,cAAc,QAAQ,+BAA4B;AAC3D,SAASC,WAAW,QAAQ,uBAAoB;AAChD,SAASC,iBAAiB,QAAQ,2BAAwB;AAC1D,SACEC,oBAAoB,EACpBC,gBAAgB,EAEhBC,aAAa,QACR,oBAAiB;AACxB,SAASC,cAAc,QAAQ,wBAAqB;AACpD,SAASC,gCAAgC,QAAQ,6BAA0B;AAE3E,SAASC,kBAAkB,QAAQ,wBAAqB;AAExD,OAAO,MAAMC,wBAAyCL,iBACpD,YAAYM,QAAQ,EACpB;AAaF;;CAEC,GACD,OAAO,MAAMC,kBAAkB,CAC7BC,MACAC;IAEA,MAAMC,QAAQZ,kBAAkBU;IAChC,MAAMG,iBAAiBd,YAAY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ACLK,YAAY;wBACZC,YAAY;wBACZC,eAAe;wBACfC,eAAe;oBACjB;gBACF;YACF;eACG,AAACpB,CAAAA,OAAOc,OAAO,IAAI,EAAE,AAAD,EAAGX,MAAM,CAC9B,CAACkB,IAAM,OAAOA,MAAM,YAAYA,EAAEN,MAAM,KAAK;SAEhD;QAED,OAAOf;IACT;IAEA,MAAM3C,gCAAgCa,MAAM;QAACH;KAAsB;IAEnE,MAAMZ,qBAAqBe;IAE3B,mFAAmF;IACnF,uEAAuE;IACvE,8EAA8E;IAC9E,OAAO,IACLd,oBAAoBc,MAAMC,OAAOmD,yBAAyB,EAAE;YAC1DC,WAAW;gBAAC;aAAa;QAC3B;AACJ,EAAE;AACF,eAAe5C,mBAAmB"}
1
+ {"version":3,"sources":["../../../../../../packages/nx-plugin/src/ts/lib/generator.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n type GeneratorCallback,\n generateFiles,\n joinPathFragments,\n type NxJsonConfiguration,\n OverwriteStrategy,\n readProjectConfiguration,\n type TargetConfiguration,\n type Tree,\n updateJson,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport { libraryGenerator } from '@nx/js';\nimport { formatFilesInSubtree } from '../../utils/format';\nimport { installDependencies } from '../../utils/install';\nimport { addGeneratorMetricsIfApplicable } from '../../utils/metrics';\nimport { isEsmWorkspace } from '../../utils/module-format';\nimport { toKebabCase } from '../../utils/names';\nimport { getNpmScopePrefix } from '../../utils/npm-scope';\nimport {\n addGeneratorMetadata,\n getGeneratorInfo,\n mergeTargetDefault,\n type NxGeneratorInfo,\n projectExists,\n} from '../../utils/nx';\nimport { sortObjectKeys } from '../../utils/object';\nimport { getPackageManagerDisplayCommands } from '../../utils/pkg-manager';\nimport type { TsProjectGeneratorSchema } from './schema';\nimport { configureTsProject } from './ts-project-utils';\n\nexport const TS_LIB_GENERATOR_INFO: NxGeneratorInfo = getGeneratorInfo(\n import.meta.filename,\n);\n\nexport interface TsLibDetails {\n /**\n * Full package name including scope (eg @foo/bar)\n */\n readonly fullyQualifiedName: string;\n /**\n * Directory of the library relative to the root\n */\n readonly dir: string;\n}\n\n/**\n * Returns details about the TS library to be created\n */\nexport const getTsLibDetails = (\n tree: Tree,\n schema: TsProjectGeneratorSchema,\n): TsLibDetails => {\n const scope = getNpmScopePrefix(tree);\n const normalizedName = toKebabCase(schema.name);\n const fullyQualifiedName = `${scope}${normalizedName}`;\n // NB: interactive nx generator cli can pass empty string\n const dir = joinPathFragments(\n schema.directory || '.',\n schema.subDirectory || normalizedName,\n );\n return { dir, fullyQualifiedName };\n};\n\n/**\n * Generates a typescript project\n */\nexport const tsProjectGenerator = async (\n tree: Tree,\n schema: TsProjectGeneratorSchema,\n): Promise<GeneratorCallback> => {\n const { fullyQualifiedName, dir } = getTsLibDetails(tree, schema);\n // The module format is workspace-wide, established by the preset when the\n // workspace is created, so vending generators always infer it from the tree.\n const esm = isEsmWorkspace(tree);\n\n // Only scaffold the project on first run; on re-run skip creation so user\n // edits are preserved, but continue to (re)apply the configuration below.\n if (!projectExists(tree, fullyQualifiedName)) {\n await libraryGenerator(tree, {\n ...schema,\n name: fullyQualifiedName,\n directory: dir,\n skipPackageJson: true,\n bundler: 'tsc', // TODO: consider supporting others\n linter: 'none',\n unitTestRunner: 'vitest',\n // Register the @nx/vitest plugin so the test target is inferred rather\n // than emitting the deprecated @nx/vitest:test executor target.\n addPlugin: true,\n });\n\n // Replace with simpler sample source code\n tree.delete(joinPathFragments(dir, 'src'));\n generateFiles(\n tree,\n joinPathFragments(import.meta.dirname, 'files'),\n joinPathFragments(dir),\n {\n fullyQualifiedName,\n esm,\n pkgMgrCmd: getPackageManagerDisplayCommands().exec,\n },\n {\n overwriteStrategy: OverwriteStrategy.KeepExisting,\n },\n );\n }\n await configureTsProject(tree, {\n dir,\n fullyQualifiedName,\n esm,\n });\n\n const projectConfiguration = readProjectConfiguration(\n tree,\n fullyQualifiedName,\n );\n const targets = projectConfiguration.targets;\n\n targets['compile'] = {\n executor: 'nx:run-commands',\n outputs: ['{workspaceRoot}/dist/{projectRoot}/tsc'],\n options: {\n command: 'tsc --build tsconfig.lib.json',\n cwd: '{projectRoot}',\n },\n };\n targets['build'] = {\n dependsOn: ['lint', 'compile', 'test'],\n };\n projectConfiguration.targets = sortObjectKeys(targets);\n\n updateProjectConfiguration(tree, fullyQualifiedName, projectConfiguration);\n\n addGeneratorMetadata(tree, fullyQualifiedName, TS_LIB_GENERATOR_INFO);\n\n updateJson(tree, 'nx.json', (nxJson: NxJsonConfiguration) => {\n nxJson.namedInputs = {\n ...nxJson.namedInputs,\n default: [\n ...(nxJson.namedInputs?.default ?? []).filter(\n (input) =>\n typeof input !== 'object' ||\n !('dependentTasksOutputFiles' in input) ||\n !(input.dependentTasksOutputFiles === '**/*' && input.transitive),\n ),\n {\n dependentTasksOutputFiles: '**/*',\n transitive: true,\n },\n ],\n };\n\n const withDefaultInput = (base: Partial<TargetConfiguration>) => ({\n ...base,\n inputs: [\n ...(base.inputs ?? []).filter((i) => i !== 'default'),\n 'default',\n ],\n });\n\n nxJson.targetDefaults = {\n ...nxJson.targetDefaults,\n compile: mergeTargetDefault(nxJson.targetDefaults?.compile, (base) => ({\n cache: true,\n ...withDefaultInput(base),\n })),\n build: mergeTargetDefault(nxJson.targetDefaults?.build, (base) => ({\n cache: true,\n ...withDefaultInput(base),\n })),\n test: mergeTargetDefault(nxJson.targetDefaults?.test, withDefaultInput),\n };\n\n // Ensure we only declare a single typescript plugin with the correct settings\n nxJson.plugins = [\n {\n plugin: '@nx/js/typescript',\n options: {\n typecheck: {\n targetName: 'typecheck',\n },\n build: {\n targetName: 'compile',\n configName: 'tsconfig.lib.json',\n buildDepsName: 'build-deps',\n watchDepsName: 'watch-deps',\n },\n },\n },\n ...(nxJson.plugins ?? []).filter(\n (p) => typeof p === 'string' || p.plugin !== '@nx/js/typescript',\n ),\n ];\n\n return nxJson;\n });\n\n await addGeneratorMetricsIfApplicable(tree, [TS_LIB_GENERATOR_INFO]);\n\n await formatFilesInSubtree(tree);\n\n // `installDependencies` ensures vitest resolves for the `typescript` language (the\n // generated vitest.config.mts imports it and Nx loads that config when\n // computing the project graph), so a deferred install still runs when needed.\n return () =>\n installDependencies(tree, schema.preferInstallDependencies, {\n languages: ['typescript'],\n });\n};\nexport default tsProjectGenerator;\n"],"names":["generateFiles","joinPathFragments","OverwriteStrategy","readProjectConfiguration","updateJson","updateProjectConfiguration","libraryGenerator","formatFilesInSubtree","installDependencies","addGeneratorMetricsIfApplicable","isEsmWorkspace","toKebabCase","getNpmScopePrefix","addGeneratorMetadata","getGeneratorInfo","mergeTargetDefault","projectExists","sortObjectKeys","getPackageManagerDisplayCommands","configureTsProject","TS_LIB_GENERATOR_INFO","filename","getTsLibDetails","tree","schema","scope","normalizedName","name","fullyQualifiedName","dir","directory","subDirectory","tsProjectGenerator","esm","skipPackageJson","bundler","linter","unitTestRunner","addPlugin","delete","dirname","pkgMgrCmd","exec","overwriteStrategy","KeepExisting","projectConfiguration","targets","executor","outputs","options","command","cwd","dependsOn","nxJson","namedInputs","default","filter","input","dependentTasksOutputFiles","transitive","withDefaultInput","base","inputs","i","targetDefaults","compile","cache","build","test","plugins","plugin","typecheck","targetName","configName","buildDepsName","watchDepsName","p","preferInstallDependencies","languages"],"mappings":"AAAA;;;CAGC,GACD,SAEEA,aAAa,EACbC,iBAAiB,EAEjBC,iBAAiB,EACjBC,wBAAwB,EAGxBC,UAAU,EACVC,0BAA0B,QACrB,aAAa;AACpB,SAASC,gBAAgB,QAAQ,SAAS;AAC1C,SAASC,oBAAoB,QAAQ,wBAAqB;AAC1D,SAASC,mBAAmB,QAAQ,yBAAsB;AAC1D,SAASC,+BAA+B,QAAQ,yBAAsB;AACtE,SAASC,cAAc,QAAQ,+BAA4B;AAC3D,SAASC,WAAW,QAAQ,uBAAoB;AAChD,SAASC,iBAAiB,QAAQ,2BAAwB;AAC1D,SACEC,oBAAoB,EAC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AAO;oBACP,GAAGN,iBAAiBC,KAAK;gBAC3B,CAAA;YACAO,MAAMrD,mBAAmBsC,OAAOW,cAAc,EAAEI,MAAMR;QACxD;QAEA,8EAA8E;QAC9EP,OAAOgB,OAAO,GAAG;YACf;gBACEC,QAAQ;gBACRrB,SAAS;oBACPsB,WAAW;wBACTC,YAAY;oBACd;oBACAL,OAAO;wBACLK,YAAY;wBACZC,YAAY;wBACZC,eAAe;wBACfC,eAAe;oBACjB;gBACF;YACF;eACG,AAACtB,CAAAA,OAAOgB,OAAO,IAAI,EAAE,AAAD,EAAGb,MAAM,CAC9B,CAACoB,IAAM,OAAOA,MAAM,YAAYA,EAAEN,MAAM,KAAK;SAEhD;QAED,OAAOjB;IACT;IAEA,MAAM5C,gCAAgCc,MAAM;QAACH;KAAsB;IAEnE,MAAMb,qBAAqBgB;IAE3B,mFAAmF;IACnF,uEAAuE;IACvE,8EAA8E;IAC9E,OAAO,IACLf,oBAAoBe,MAAMC,OAAOqD,yBAAyB,EAAE;YAC1DC,WAAW;gBAAC;aAAa;QAC3B;AACJ,EAAE;AACF,eAAe9C,mBAAmB"}
@@ -1123,11 +1123,11 @@ exports[`react-website generator > Tanstack router integration > should generate
1123
1123
  "tailwindcss": "4.3.2"
1124
1124
  },
1125
1125
  "devDependencies": {
1126
- "@nx/js": "23.0.2",
1127
- "@nx/react": "23.0.2",
1128
- "@nx/vite": "23.0.2",
1129
- "@nx/vitest": "23.0.2",
1130
- "@nx/web": "23.0.2",
1126
+ "@nx/js": "23.1.0",
1127
+ "@nx/react": "23.1.0",
1128
+ "@nx/vite": "23.1.0",
1129
+ "@nx/vitest": "23.1.0",
1130
+ "@nx/web": "23.1.0",
1131
1131
  "@swc/helpers": "~0.5.18",
1132
1132
  "@tailwindcss/vite": "4.3.2",
1133
1133
  "@testing-library/dom": "10.4.0",
@@ -1140,7 +1140,7 @@ exports[`react-website generator > Tanstack router integration > should generate
1140
1140
  "@vitest/ui": "4.1.10",
1141
1141
  "jiti": "2.4.2",
1142
1142
  "jsdom": "^27.1.0",
1143
- "typescript": "~5.9.2",
1143
+ "typescript": "~6.0.3",
1144
1144
  "vite": "8.1.4",
1145
1145
  "vitest": "4.1.10"
1146
1146
  },
@@ -2695,11 +2695,11 @@ exports[`react-website generator > Tanstack router integration > should generate
2695
2695
  "tailwindcss": "4.3.2"
2696
2696
  },
2697
2697
  "devDependencies": {
2698
- "@nx/js": "23.0.2",
2699
- "@nx/react": "23.0.2",
2700
- "@nx/vite": "23.0.2",
2701
- "@nx/vitest": "23.0.2",
2702
- "@nx/web": "23.0.2",
2698
+ "@nx/js": "23.1.0",
2699
+ "@nx/react": "23.1.0",
2700
+ "@nx/vite": "23.1.0",
2701
+ "@nx/vitest": "23.1.0",
2702
+ "@nx/web": "23.1.0",
2703
2703
  "@swc/helpers": "~0.5.18",
2704
2704
  "@tailwindcss/vite": "4.3.2",
2705
2705
  "@tanstack/router-generator": "1.167.18",
@@ -2716,7 +2716,7 @@ exports[`react-website generator > Tanstack router integration > should generate
2716
2716
  "@vitest/ui": "4.1.10",
2717
2717
  "jiti": "2.4.2",
2718
2718
  "jsdom": "^27.1.0",
2719
- "typescript": "~5.9.2",
2719
+ "typescript": "~6.0.3",
2720
2720
  "vite": "8.1.4",
2721
2721
  "vitest": "4.1.10"
2722
2722
  },
@@ -3,7 +3,7 @@
3
3
  * (e.g. `nx init`) pin to this version so the workspace's nx matches the
4
4
  * plugin's `@nx/*` packages — a mismatch deadlocks `nx sync`.
5
5
  */
6
- export declare const NX_VERSION: "23.0.2";
6
+ export declare const NX_VERSION: "23.1.0";
7
7
  /**
8
8
  * Display-friendly command prefixes for each package manager.
9
9
  *
package/src/utils/init.js CHANGED
@@ -15,6 +15,7 @@ import { inferContainers } from "./containers.js";
15
15
  import { DEFAULT_BIOME_CONFIG } from "./format.js";
16
16
  import { configureMcpServers } from "./mcp.js";
17
17
  import { getNpmScope } from "./npm-scope.js";
18
+ import { mergeTargetDefault } from "./nx.js";
18
19
  import { getPackageManagerDisplayCommands } from "./pkg-manager.js";
19
20
  import { withVersions } from "./versions.js";
20
21
  const WORKSPACES = [
@@ -168,17 +169,17 @@ export const PNPM_BUILT_DEPENDENCIES = [
168
169
  analytics: nxJson.analytics ?? false,
169
170
  targetDefaults: {
170
171
  ...nxJson.targetDefaults,
171
- compile: {
172
- ...nxJson.targetDefaults?.compile,
173
- syncGenerators: [
174
- ...(nxJson.targetDefaults?.compile?.syncGenerators ?? []).filter((g)=>![
175
- TS_SYNC_GENERATOR_NAME,
176
- NX_TYPESCRIPT_SYNC_GENERATOR
177
- ].includes(g)),
178
- NX_TYPESCRIPT_SYNC_GENERATOR,
179
- TS_SYNC_GENERATOR_NAME
180
- ]
181
- }
172
+ compile: mergeTargetDefault(nxJson.targetDefaults?.compile, (base)=>({
173
+ ...base,
174
+ syncGenerators: [
175
+ ...(base.syncGenerators ?? []).filter((g)=>![
176
+ TS_SYNC_GENERATOR_NAME,
177
+ NX_TYPESCRIPT_SYNC_GENERATOR
178
+ ].includes(g)),
179
+ NX_TYPESCRIPT_SYNC_GENERATOR,
180
+ TS_SYNC_GENERATOR_NAME
181
+ ]
182
+ }))
182
183
  }
183
184
  });
184
185
  const CONVENIENCE_SCRIPTS = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../packages/nx-plugin/src/utils/init.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n addDependenciesToPackageJson,\n detectPackageManager,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n readNxJson,\n type Tree,\n updateJson,\n updateNxJson,\n} from '@nx/devkit';\nimport { initGenerator } from '@nx/js';\nimport { readFileSync } from 'fs';\nimport yaml from 'js-yaml';\nimport { readModulePackageJson } from 'nx/src/utils/package-json';\nimport GeneratorsJson from '../../generators.json' with { type: 'json' };\nimport { SYNC_GENERATOR_NAME as TS_SYNC_GENERATOR_NAME } from '../ts/sync/generator';\nimport { BASE_TSCONFIG_COMPILER_OPTIONS } from './base-tsconfig';\nimport {\n ensureAwsNxPluginConfig,\n updateAwsNxPluginConfig,\n} from './config/utils';\nimport { type Containers, inferContainers } from './containers';\nimport { DEFAULT_BIOME_CONFIG } from './format';\nimport type { Iac } from './iac';\nimport { configureMcpServers } from './mcp';\nimport { getNpmScope } from './npm-scope';\nimport { getPackageManagerDisplayCommands } from './pkg-manager';\nimport { withVersions } from './versions';\n\nconst WORKSPACES = ['packages/*'];\nconst NX_TYPESCRIPT_SYNC_GENERATOR = '@nx/js:typescript-sync';\n\n// Built dependencies whose install scripts the generated workspace trusts.\n// `onlyBuiltDependencies` is the pnpm 10 key (silently ignored by pnpm 11);\n// pnpm 11 reads `allowBuilds` instead. Any dep NOT in this allowlist will\n// have its install scripts skipped with a warning — matching pnpm 10's\n// default behaviour. The user can opt-in later via `pnpm approve-builds`.\nexport const PNPM_BUILT_DEPENDENCIES = ['@swc/core', 'esbuild', 'nx', 'sharp'];\n\n/**\n * Options controlling how the workspace is initialised. These mirror the\n * preset schema so a workspace created via the preset and one initialised via\n * the `init` generator end up in the same shape.\n */\nexport interface ApplyWorkspaceInitOptions {\n /** The IaC provider to record in the plugin config. */\n readonly iac: Iac;\n /**\n * The container engine to record. `undefined`/`'infer'` picks docker when\n * installed, else finch.\n */\n readonly containers?: Containers | 'infer';\n /** Whether to configure MCP servers for coding agents. Defaults to true. */\n readonly mcp?: boolean;\n /**\n * How to treat the generated workspace README. The preset owns the README of\n * a greenfield workspace (`Overwrite`); the `init` generator must not clobber\n * an existing workspace's README (`KeepExisting`, the default).\n */\n readonly readmeOverwriteStrategy?: OverwriteStrategy;\n /**\n * Whether to overwrite root package.json scripts that already exist. The\n * preset owns a greenfield workspace's scripts (`true`); the `init`\n * generator must not clobber an existing workspace's scripts (`false`,\n * the default) — it only adds the convenience scripts that are absent.\n */\n readonly overwriteScripts?: boolean;\n}\n\n/**\n * Add or repair the pnpm `allowBuilds` / `onlyBuiltDependencies` allowlist for\n * the workspace's `packages` globs, without clobbering any packages the user\n * has already declared.\n *\n * A workspace not created by the preset commonly has either no\n * `pnpm-workspace.yaml`, one missing the `packages` globs, or one carrying the\n * broken `set this to true or false` placeholder pnpm writes when it skips a\n * build script. This makes the file self-consistent so the first generator's\n * install doesn't fail with `ERR_PNPM_IGNORED_BUILDS`.\n */\nconst setUpPnpmWorkspace = (tree: Tree) => {\n const existing = tree.exists('pnpm-workspace.yaml')\n ? ((yaml.load(tree.read('pnpm-workspace.yaml', 'utf-8') ?? '') as Record<\n string,\n unknown\n >) ?? {})\n : {};\n\n // Preserve any packages globs the user already has, ensuring ours are present.\n const packages = Array.from(\n new Set([...((existing.packages as string[]) ?? []), ...WORKSPACES]),\n );\n\n const allowBuilds = {\n ...(typeof existing.allowBuilds === 'object' && existing.allowBuilds\n ? (existing.allowBuilds as Record<string, unknown>)\n : {}),\n // Overwrite any non-boolean (e.g. the \"set this to true or false\"\n // placeholder) with an explicit true for the deps we trust.\n ...Object.fromEntries(PNPM_BUILT_DEPENDENCIES.map((dep) => [dep, true])),\n };\n\n tree.write(\n 'pnpm-workspace.yaml',\n yaml.dump(\n {\n ...existing,\n packages,\n allowBuilds,\n onlyBuiltDependencies: PNPM_BUILT_DEPENDENCIES,\n },\n { quotingType: \"'\" },\n ),\n );\n};\n\n/**\n * Configure the workspace's package manager for a monorepo layout.\n *\n * pnpm workspaces are declared in `pnpm-workspace.yaml`; every other package\n * manager reads the `workspaces` field of the root `package.json`.\n */\nconst setUpWorkspaces = (tree: Tree) => {\n if (detectPackageManager() === 'pnpm') {\n setUpPnpmWorkspace(tree);\n } else {\n updateJson(tree, 'package.json', (json) => ({\n ...json,\n workspaces: Array.from(\n new Set([...(json.workspaces ?? []), ...WORKSPACES]),\n ),\n }));\n }\n};\n\n/**\n * Ensure the workspace has a `tsconfig.base.json`.\n *\n * `@nx/js` `initGenerator` (with `addTsPlugin`) normally creates this, but it\n * short-circuits when the workspace already has a root `tsconfig.json` — in\n * which case no base file is written and the next project generator fails with\n * `Cannot find tsconfig.base.json`. So we create a compatible one when it's\n * absent. An existing base is left untouched: the user may have tuned it, and\n * rewriting shared compiler options can break other projects (see the\n * \"add to an existing workspace\" guide).\n */\nconst ensureBaseTsConfig = (tree: Tree) => {\n if (tree.exists('tsconfig.base.json')) {\n return;\n }\n tree.write(\n 'tsconfig.base.json',\n JSON.stringify(\n {\n compilerOptions: {\n ...BASE_TSCONFIG_COMPILER_OPTIONS,\n customConditions: [getNpmScope(tree)],\n },\n },\n null,\n 2,\n ),\n );\n};\n\n/**\n * Ensure the workspace has a root `tsconfig.json`.\n *\n * Nx's `@nx/js:typescript-sync` generator hard-fails with\n * `Missing root \"tsconfig.json\"` when it's absent. The plugin's TypeScript\n * projects reference each other via this file, so we guarantee a minimal one\n * exists (sync populates its `references`).\n */\nconst ensureRootTsConfig = (tree: Tree) => {\n if (tree.exists('tsconfig.json')) {\n return;\n }\n tree.write(\n 'tsconfig.json',\n JSON.stringify(\n {\n extends: './tsconfig.base.json',\n files: [],\n references: [],\n },\n null,\n 2,\n ),\n );\n};\n\n/**\n * Transform an Nx workspace into one ready to run `@aws/nx-plugin` generators.\n *\n * This is the deterministic core shared by the workspace preset and the `init`\n * generator. It is safe to re-run: every step is idempotent (config merges,\n * keyed nx.json / package.json entries, create-if-missing files), so running\n * it against an already-initialised workspace is a no-op.\n *\n * It preserves the workspace's module format: the root package.json `type`\n * field is owned by the preset (written from its `--module` option) and left\n * untouched here. It does NOT rewrite an existing `tsconfig.base.json`'s\n * compiler options, migrate a workspace's package manager, or restructure\n * existing projects — those are decisions for the user (see the \"add to an\n * existing workspace\" guide).\n */\nexport const applyWorkspaceInit = async (\n tree: Tree,\n {\n iac,\n containers,\n mcp,\n readmeOverwriteStrategy = OverwriteStrategy.KeepExisting,\n overwriteScripts = false,\n }: ApplyWorkspaceInitOptions,\n) => {\n const resolvedContainers =\n !containers || containers === 'infer' ? inferContainers() : containers;\n\n // Write IaC provider and container engine to plugin config\n await ensureAwsNxPluginConfig(tree);\n await updateAwsNxPluginConfig(tree, {\n iac: { provider: iac },\n containers: { engine: resolvedContainers },\n });\n\n // Set up the TypeScript plugin, base tsconfig, formatter etc. `@nx/js`\n // creates `tsconfig.base.json` when absent, but skips it when a root\n // `tsconfig.json` already exists — so we ensure both explicitly below.\n await initGenerator(tree, {\n formatter: 'none',\n addTsPlugin: true,\n });\n\n ensureBaseTsConfig(tree);\n ensureRootTsConfig(tree);\n\n setUpWorkspaces(tree);\n\n const nxJson = readNxJson(tree);\n updateNxJson(tree, {\n ...nxJson,\n // Preserve an explicit analytics choice in an existing workspace.\n analytics: (nxJson as { analytics?: boolean }).analytics ?? false,\n targetDefaults: {\n ...nxJson.targetDefaults,\n compile: {\n ...nxJson.targetDefaults?.compile,\n syncGenerators: [\n ...(nxJson.targetDefaults?.compile?.syncGenerators ?? []).filter(\n (g) =>\n ![TS_SYNC_GENERATOR_NAME, NX_TYPESCRIPT_SYNC_GENERATOR].includes(\n g,\n ),\n ),\n NX_TYPESCRIPT_SYNC_GENERATOR,\n TS_SYNC_GENERATOR_NAME,\n ],\n },\n },\n });\n\n const CONVENIENCE_SCRIPTS = {\n dev: 'nx run-many --target dev',\n build: 'nx run-many --target build',\n lint: 'nx run-many --target lint --configuration=fix',\n test: 'nx run-many --target test --all',\n 'build:skip-lint': 'nx run-many --target build --configuration=skip-lint',\n 'build:all': 'nx run-many --target build --all',\n 'affected:all': 'nx affected --target build',\n };\n updateJson(tree, 'package.json', (packageJson) => ({\n ...packageJson,\n // The root `type` field is owned by the preset (written explicitly from\n // its `--module` option). `init` preserves an existing workspace's field\n // as-is: an ESM workspace already carries `type: \"module\"` (that is how\n // the format is inferred), and introducing a `type` into a CommonJS\n // workspace that lacks one changes behaviour for frameworks that parse it\n // (e.g. Next.js starts treating the app's ESM source as CJS).\n scripts: overwriteScripts\n ? { ...packageJson.scripts, ...CONVENIENCE_SCRIPTS }\n : { ...CONVENIENCE_SCRIPTS, ...packageJson.scripts },\n }));\n\n // Pin the workspace's `nx` to the version the plugin's @nx/* packages are\n // built against. A mismatched workspace nx (even a patch apart) hoists a\n // second nested nx under @nx/js, and the two instances deadlock `nx sync`.\n // `@nx/js` must be a root dependency for the `@nx/js:typescript-sync`\n // generator registered in nx.json to resolve (npm doesn't hoist the\n // plugin's own copy reliably).\n const nxVersion = readModulePackageJson('@nx/js').packageJson.version;\n addDependenciesToPackageJson(\n tree,\n {},\n {\n nx: nxVersion,\n '@nx/js': nxVersion,\n '@nx/workspace': nxVersion,\n ...withVersions(['typescript', '@biomejs/biome']),\n },\n );\n\n // Write biome.json for formatting and linting\n if (!tree.exists('biome.json')) {\n tree.write('biome.json', JSON.stringify(DEFAULT_BIOME_CONFIG, null, 2));\n }\n\n generateFiles(\n tree, // the virtual file system\n joinPathFragments(import.meta.dirname, '..', 'preset', 'files'),\n '.',\n {\n projectName: getNpmScope(tree),\n generators: Object.entries(GeneratorsJson.generators)\n .filter(([_, v]) => !v['hidden'])\n .map(([k, v]) => ({ name: k, description: v.description })),\n ...(() => {\n const cmds = getPackageManagerDisplayCommands();\n return {\n pkgMgrCmd: cmds.exec,\n buildCmd: `${cmds.run} build`,\n lintCmd: `${cmds.run} lint`,\n };\n })(),\n },\n {\n overwriteStrategy: readmeOverwriteStrategy,\n },\n );\n\n if (mcp !== false) {\n configureMcpServers(tree);\n }\n};\n"],"names":["addDependenciesToPackageJson","detectPackageManager","generateFiles","joinPathFragments","OverwriteStrategy","readNxJson","updateJson","updateNxJson","initGenerator","yaml","readModulePackageJson","GeneratorsJson","type","SYNC_GENERATOR_NAME","TS_SYNC_GENERATOR_NAME","BASE_TSCONFIG_COMPILER_OPTIONS","ensureAwsNxPluginConfig","updateAwsNxPluginConfig","inferContainers","DEFAULT_BIOME_CONFIG","configureMcpServers","getNpmScope","getPackageManagerDisplayCommands","withVersions","WORKSPACES","NX_TYPESCRIPT_SYNC_GENERATOR","PNPM_BUILT_DEPENDENCIES","setUpPnpmWorkspace","tree","existing","exists","load","read","packages","Array","from","Set","allowBuilds","Object","fromEntries","map","dep","write","dump","onlyBuiltDependencies","quotingType","setUpWorkspaces","json","workspaces","ensureBaseTsConfig","JSON","stringify","compilerOptions","customConditions","ensureRootTsConfig","extends","files","references","applyWorkspaceInit","iac","containers","mcp","readmeOverwriteStrategy","KeepExisting","overwriteScripts","resolvedContainers","provider","engine","formatter","addTsPlugin","nxJson","analytics","targetDefaults","compile","syncGenerators","filter","g","includes","CONVENIENCE_SCRIPTS","dev","build","lint","test","packageJson","scripts","nxVersion","version","nx","dirname","projectName","generators","entries","_","v","k","name","description","cmds","pkgMgrCmd","exec","buildCmd","run","lintCmd","overwriteStrategy"],"mappings":"AAAA;;;CAGC,GACD,SACEA,4BAA4B,EAC5BC,oBAAoB,EACpBC,aAAa,EACbC,iBAAiB,EACjBC,iBAAiB,EACjBC,UAAU,EAEVC,UAAU,EACVC,YAAY,QACP,aAAa;AACpB,SAASC,aAAa,QAAQ,SAAS;AAEvC,OAAOC,UAAU,UAAU;AAC3B,SAASC,qBAAqB,QAAQ,4BAA4B;AAClE,OAAOC,oBAAoB,6BAA6B;IAAEC,MAAM;AAAO,EAAE;AACzE,SAASC,uBAAuBC,sBAAsB,QAAQ,0BAAuB;AACrF,SAASC,8BAA8B,QAAQ,qBAAkB;AACjE,SACEC,uBAAuB,EACvBC,uBAAuB,QAClB,oBAAiB;AACxB,SAA0BC,eAAe,QAAQ,kBAAe;AAChE,SAASC,oBAAoB,QAAQ,cAAW;AAEhD,SAASC,mBAAmB,QAAQ,WAAQ;AAC5C,SAASC,WAAW,QAAQ,iBAAc;AAC1C,SAASC,gCAAgC,QAAQ,mBAAgB;AACjE,SAASC,YAAY,QAAQ,gBAAa;AAE1C,MAAMC,aAAa;IAAC;CAAa;AACjC,MAAMC,+BAA+B;AAErC,2EAA2E;AAC3E,4EAA4E;AAC5E,0EAA0E;AAC1E,uEAAuE;AACvE,0EAA0E;AAC1E,OAAO,MAAMC,0BAA0B;IAAC;IAAa;IAAW;IA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E,WAAWD,KAAKE,IAAI;gBACpBC,UAAU,GAAGH,KAAKI,GAAG,CAAC,MAAM,CAAC;gBAC7BC,SAAS,GAAGL,KAAKI,GAAG,CAAC,KAAK,CAAC;YAC7B;QACF,CAAA,GAAI;IACN,GACA;QACEE,mBAAmBzC;IACrB;IAGF,IAAID,QAAQ,OAAO;QACjBzC,oBAAoBQ;IACtB;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../../../packages/nx-plugin/src/utils/init.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n addDependenciesToPackageJson,\n detectPackageManager,\n generateFiles,\n joinPathFragments,\n OverwriteStrategy,\n readNxJson,\n type Tree,\n updateJson,\n updateNxJson,\n} from '@nx/devkit';\nimport { initGenerator } from '@nx/js';\nimport { readFileSync } from 'fs';\nimport yaml from 'js-yaml';\nimport { readModulePackageJson } from 'nx/src/utils/package-json';\nimport GeneratorsJson from '../../generators.json' with { type: 'json' };\nimport { SYNC_GENERATOR_NAME as TS_SYNC_GENERATOR_NAME } from '../ts/sync/generator';\nimport { BASE_TSCONFIG_COMPILER_OPTIONS } from './base-tsconfig';\nimport {\n ensureAwsNxPluginConfig,\n updateAwsNxPluginConfig,\n} from './config/utils';\nimport { type Containers, inferContainers } from './containers';\nimport { DEFAULT_BIOME_CONFIG } from './format';\nimport type { Iac } from './iac';\nimport { configureMcpServers } from './mcp';\nimport { getNpmScope } from './npm-scope';\nimport { mergeTargetDefault } from './nx';\nimport { getPackageManagerDisplayCommands } from './pkg-manager';\nimport { withVersions } from './versions';\n\nconst WORKSPACES = ['packages/*'];\nconst NX_TYPESCRIPT_SYNC_GENERATOR = '@nx/js:typescript-sync';\n\n// Built dependencies whose install scripts the generated workspace trusts.\n// `onlyBuiltDependencies` is the pnpm 10 key (silently ignored by pnpm 11);\n// pnpm 11 reads `allowBuilds` instead. Any dep NOT in this allowlist will\n// have its install scripts skipped with a warning — matching pnpm 10's\n// default behaviour. The user can opt-in later via `pnpm approve-builds`.\nexport const PNPM_BUILT_DEPENDENCIES = ['@swc/core', 'esbuild', 'nx', 'sharp'];\n\n/**\n * Options controlling how the workspace is initialised. These mirror the\n * preset schema so a workspace created via the preset and one initialised via\n * the `init` generator end up in the same shape.\n */\nexport interface ApplyWorkspaceInitOptions {\n /** The IaC provider to record in the plugin config. */\n readonly iac: Iac;\n /**\n * The container engine to record. `undefined`/`'infer'` picks docker when\n * installed, else finch.\n */\n readonly containers?: Containers | 'infer';\n /** Whether to configure MCP servers for coding agents. Defaults to true. */\n readonly mcp?: boolean;\n /**\n * How to treat the generated workspace README. The preset owns the README of\n * a greenfield workspace (`Overwrite`); the `init` generator must not clobber\n * an existing workspace's README (`KeepExisting`, the default).\n */\n readonly readmeOverwriteStrategy?: OverwriteStrategy;\n /**\n * Whether to overwrite root package.json scripts that already exist. The\n * preset owns a greenfield workspace's scripts (`true`); the `init`\n * generator must not clobber an existing workspace's scripts (`false`,\n * the default) — it only adds the convenience scripts that are absent.\n */\n readonly overwriteScripts?: boolean;\n}\n\n/**\n * Add or repair the pnpm `allowBuilds` / `onlyBuiltDependencies` allowlist for\n * the workspace's `packages` globs, without clobbering any packages the user\n * has already declared.\n *\n * A workspace not created by the preset commonly has either no\n * `pnpm-workspace.yaml`, one missing the `packages` globs, or one carrying the\n * broken `set this to true or false` placeholder pnpm writes when it skips a\n * build script. This makes the file self-consistent so the first generator's\n * install doesn't fail with `ERR_PNPM_IGNORED_BUILDS`.\n */\nconst setUpPnpmWorkspace = (tree: Tree) => {\n const existing = tree.exists('pnpm-workspace.yaml')\n ? ((yaml.load(tree.read('pnpm-workspace.yaml', 'utf-8') ?? '') as Record<\n string,\n unknown\n >) ?? {})\n : {};\n\n // Preserve any packages globs the user already has, ensuring ours are present.\n const packages = Array.from(\n new Set([...((existing.packages as string[]) ?? []), ...WORKSPACES]),\n );\n\n const allowBuilds = {\n ...(typeof existing.allowBuilds === 'object' && existing.allowBuilds\n ? (existing.allowBuilds as Record<string, unknown>)\n : {}),\n // Overwrite any non-boolean (e.g. the \"set this to true or false\"\n // placeholder) with an explicit true for the deps we trust.\n ...Object.fromEntries(PNPM_BUILT_DEPENDENCIES.map((dep) => [dep, true])),\n };\n\n tree.write(\n 'pnpm-workspace.yaml',\n yaml.dump(\n {\n ...existing,\n packages,\n allowBuilds,\n onlyBuiltDependencies: PNPM_BUILT_DEPENDENCIES,\n },\n { quotingType: \"'\" },\n ),\n );\n};\n\n/**\n * Configure the workspace's package manager for a monorepo layout.\n *\n * pnpm workspaces are declared in `pnpm-workspace.yaml`; every other package\n * manager reads the `workspaces` field of the root `package.json`.\n */\nconst setUpWorkspaces = (tree: Tree) => {\n if (detectPackageManager() === 'pnpm') {\n setUpPnpmWorkspace(tree);\n } else {\n updateJson(tree, 'package.json', (json) => ({\n ...json,\n workspaces: Array.from(\n new Set([...(json.workspaces ?? []), ...WORKSPACES]),\n ),\n }));\n }\n};\n\n/**\n * Ensure the workspace has a `tsconfig.base.json`.\n *\n * `@nx/js` `initGenerator` (with `addTsPlugin`) normally creates this, but it\n * short-circuits when the workspace already has a root `tsconfig.json` — in\n * which case no base file is written and the next project generator fails with\n * `Cannot find tsconfig.base.json`. So we create a compatible one when it's\n * absent. An existing base is left untouched: the user may have tuned it, and\n * rewriting shared compiler options can break other projects (see the\n * \"add to an existing workspace\" guide).\n */\nconst ensureBaseTsConfig = (tree: Tree) => {\n if (tree.exists('tsconfig.base.json')) {\n return;\n }\n tree.write(\n 'tsconfig.base.json',\n JSON.stringify(\n {\n compilerOptions: {\n ...BASE_TSCONFIG_COMPILER_OPTIONS,\n customConditions: [getNpmScope(tree)],\n },\n },\n null,\n 2,\n ),\n );\n};\n\n/**\n * Ensure the workspace has a root `tsconfig.json`.\n *\n * Nx's `@nx/js:typescript-sync` generator hard-fails with\n * `Missing root \"tsconfig.json\"` when it's absent. The plugin's TypeScript\n * projects reference each other via this file, so we guarantee a minimal one\n * exists (sync populates its `references`).\n */\nconst ensureRootTsConfig = (tree: Tree) => {\n if (tree.exists('tsconfig.json')) {\n return;\n }\n tree.write(\n 'tsconfig.json',\n JSON.stringify(\n {\n extends: './tsconfig.base.json',\n files: [],\n references: [],\n },\n null,\n 2,\n ),\n );\n};\n\n/**\n * Transform an Nx workspace into one ready to run `@aws/nx-plugin` generators.\n *\n * This is the deterministic core shared by the workspace preset and the `init`\n * generator. It is safe to re-run: every step is idempotent (config merges,\n * keyed nx.json / package.json entries, create-if-missing files), so running\n * it against an already-initialised workspace is a no-op.\n *\n * It preserves the workspace's module format: the root package.json `type`\n * field is owned by the preset (written from its `--module` option) and left\n * untouched here. It does NOT rewrite an existing `tsconfig.base.json`'s\n * compiler options, migrate a workspace's package manager, or restructure\n * existing projects — those are decisions for the user (see the \"add to an\n * existing workspace\" guide).\n */\nexport const applyWorkspaceInit = async (\n tree: Tree,\n {\n iac,\n containers,\n mcp,\n readmeOverwriteStrategy = OverwriteStrategy.KeepExisting,\n overwriteScripts = false,\n }: ApplyWorkspaceInitOptions,\n) => {\n const resolvedContainers =\n !containers || containers === 'infer' ? inferContainers() : containers;\n\n // Write IaC provider and container engine to plugin config\n await ensureAwsNxPluginConfig(tree);\n await updateAwsNxPluginConfig(tree, {\n iac: { provider: iac },\n containers: { engine: resolvedContainers },\n });\n\n // Set up the TypeScript plugin, base tsconfig, formatter etc. `@nx/js`\n // creates `tsconfig.base.json` when absent, but skips it when a root\n // `tsconfig.json` already exists — so we ensure both explicitly below.\n await initGenerator(tree, {\n formatter: 'none',\n addTsPlugin: true,\n });\n\n ensureBaseTsConfig(tree);\n ensureRootTsConfig(tree);\n\n setUpWorkspaces(tree);\n\n const nxJson = readNxJson(tree);\n updateNxJson(tree, {\n ...nxJson,\n // Preserve an explicit analytics choice in an existing workspace.\n analytics: (nxJson as { analytics?: boolean }).analytics ?? false,\n targetDefaults: {\n ...nxJson.targetDefaults,\n compile: mergeTargetDefault(nxJson.targetDefaults?.compile, (base) => ({\n ...base,\n syncGenerators: [\n ...(base.syncGenerators ?? []).filter(\n (g) =>\n ![TS_SYNC_GENERATOR_NAME, NX_TYPESCRIPT_SYNC_GENERATOR].includes(\n g,\n ),\n ),\n NX_TYPESCRIPT_SYNC_GENERATOR,\n TS_SYNC_GENERATOR_NAME,\n ],\n })),\n },\n });\n\n const CONVENIENCE_SCRIPTS = {\n dev: 'nx run-many --target dev',\n build: 'nx run-many --target build',\n lint: 'nx run-many --target lint --configuration=fix',\n test: 'nx run-many --target test --all',\n 'build:skip-lint': 'nx run-many --target build --configuration=skip-lint',\n 'build:all': 'nx run-many --target build --all',\n 'affected:all': 'nx affected --target build',\n };\n updateJson(tree, 'package.json', (packageJson) => ({\n ...packageJson,\n // The root `type` field is owned by the preset (written explicitly from\n // its `--module` option). `init` preserves an existing workspace's field\n // as-is: an ESM workspace already carries `type: \"module\"` (that is how\n // the format is inferred), and introducing a `type` into a CommonJS\n // workspace that lacks one changes behaviour for frameworks that parse it\n // (e.g. Next.js starts treating the app's ESM source as CJS).\n scripts: overwriteScripts\n ? { ...packageJson.scripts, ...CONVENIENCE_SCRIPTS }\n : { ...CONVENIENCE_SCRIPTS, ...packageJson.scripts },\n }));\n\n // Pin the workspace's `nx` to the version the plugin's @nx/* packages are\n // built against. A mismatched workspace nx (even a patch apart) hoists a\n // second nested nx under @nx/js, and the two instances deadlock `nx sync`.\n // `@nx/js` must be a root dependency for the `@nx/js:typescript-sync`\n // generator registered in nx.json to resolve (npm doesn't hoist the\n // plugin's own copy reliably).\n const nxVersion = readModulePackageJson('@nx/js').packageJson.version;\n addDependenciesToPackageJson(\n tree,\n {},\n {\n nx: nxVersion,\n '@nx/js': nxVersion,\n '@nx/workspace': nxVersion,\n ...withVersions(['typescript', '@biomejs/biome']),\n },\n );\n\n // Write biome.json for formatting and linting\n if (!tree.exists('biome.json')) {\n tree.write('biome.json', JSON.stringify(DEFAULT_BIOME_CONFIG, null, 2));\n }\n\n generateFiles(\n tree, // the virtual file system\n joinPathFragments(import.meta.dirname, '..', 'preset', 'files'),\n '.',\n {\n projectName: getNpmScope(tree),\n generators: Object.entries(GeneratorsJson.generators)\n .filter(([_, v]) => !v['hidden'])\n .map(([k, v]) => ({ name: k, description: v.description })),\n ...(() => {\n const cmds = getPackageManagerDisplayCommands();\n return {\n pkgMgrCmd: cmds.exec,\n buildCmd: `${cmds.run} build`,\n lintCmd: `${cmds.run} lint`,\n };\n })(),\n },\n {\n overwriteStrategy: readmeOverwriteStrategy,\n },\n );\n\n if (mcp !== false) {\n configureMcpServers(tree);\n }\n};\n"],"names":["addDependenciesToPackageJson","detectPackageManager","generateFiles","joinPathFragments","OverwriteStrategy","readNxJson","updateJson","updateNxJson","initGenerator","yaml","readModulePackageJson","GeneratorsJson","type","SYNC_GENERATOR_NAME","TS_SYNC_GENERATOR_NAME","BASE_TSCONFIG_COMPILER_OPTIONS","ensureAwsNxPluginConfig","updateAwsNxPluginConfig","inferContainers","DEFAULT_BIOME_CONFIG","configureMcpServers","getNpmScope","mergeTargetDefault","getPackageManagerDisplayCommands","withVersions","WORKSPACES","NX_TYPESCRIPT_SYNC_GENERATOR","PNPM_BUILT_DEPENDENCIES","setUpPnpmWorkspace","tree","existing","exists","load","read","packages","Array","from","Set","allowBuilds","Object","fromEntries","map","dep","write","dump","onlyBuiltDependencies","quotingType","setUpWorkspaces","json","workspaces","ensureBaseTsConfig","JSON","stringify","compilerOptions","customConditions","ensureRootTsConfig","extends","files","references","applyWorkspaceInit","iac","containers","mcp","readmeOverwriteStrategy","KeepExisting","overwriteScripts","resolvedContainers","provider","engine","formatter","addTsPlugin","nxJson","analytics","targetDefaults","compile","base","syncGenerators","filter","g","includes","CONVENIENCE_SCRIPTS","dev","build","lint","test","packageJson","scripts","nxVersion","version","nx","dirname","projectName","generators","entries","_","v","k","name","description","cmds","pkgMgrCmd","exec","buildCmd","run","lintCmd","overwriteStrategy"],"mappings":"AAAA;;;CAGC,GACD,SACEA,4BAA4B,EAC5BC,oBAAoB,EACpBC,aAA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;IAEA,0EAA0E;IAC1E,yEAAyE;IACzE,2EAA2E;IAC3E,sEAAsE;IACtE,oEAAoE;IACpE,+BAA+B;IAC/B,MAAMC,YAAY7E,sBAAsB,UAAU2E,WAAW,CAACG,OAAO;IACrExF,6BACE6B,MACA,CAAC,GACD;QACE4D,IAAIF;QACJ,UAAUA;QACV,iBAAiBA;QACjB,GAAG/D,aAAa;YAAC;YAAc;SAAiB,CAAC;IACnD;IAGF,8CAA8C;IAC9C,IAAI,CAACK,KAAKE,MAAM,CAAC,eAAe;QAC9BF,KAAKc,KAAK,CAAC,cAAcQ,KAAKC,SAAS,CAACjC,sBAAsB,MAAM;IACtE;IAEAjB,cACE2B,MACA1B,kBAAkB,YAAYuF,OAAO,EAAE,MAAM,UAAU,UACvD,KACA;QACEC,aAAatE,YAAYQ;QACzB+D,YAAYrD,OAAOsD,OAAO,CAAClF,eAAeiF,UAAU,EACjDf,MAAM,CAAC,CAAC,CAACiB,GAAGC,EAAE,GAAK,CAACA,CAAC,CAAC,SAAS,EAC/BtD,GAAG,CAAC,CAAC,CAACuD,GAAGD,EAAE,GAAM,CAAA;gBAAEE,MAAMD;gBAAGE,aAAaH,EAAEG,WAAW;YAAC,CAAA;QAC1D,GAAG,AAAC,CAAA;YACF,MAAMC,OAAO5E;YACb,OAAO;gBACL6E,WAAWD,KAAKE,IAAI;gBACpBC,UAAU,GAAGH,KAAKI,GAAG,CAAC,MAAM,CAAC;gBAC7BC,SAAS,GAAGL,KAAKI,GAAG,CAAC,KAAK,CAAC;YAC7B;QACF,CAAA,GAAI;IACN,GACA;QACEE,mBAAmB1C;IACrB;IAGF,IAAID,QAAQ,OAAO;QACjB1C,oBAAoBS;IACtB;AACF,EAAE"}
package/src/utils/nx.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
- import { type ProjectConfiguration, type Tree } from '@nx/devkit';
5
+ import { type ProjectConfiguration, type TargetConfiguration, type TargetDefaultValue, type Tree } from '@nx/devkit';
6
6
  export type { GeneratorInfo, NxGeneratorInfo } from './generators';
7
7
  export { buildGeneratorInfoList } from './generators';
8
8
  import { type GeneratorInfo } from './generators';
@@ -50,6 +50,20 @@ export declare const addComponentGeneratorMetadata: (tree: Tree, projectName: st
50
50
  }, componentPath: string, componentName?: string, additionalMetadata?: {
51
51
  [key: string]: any;
52
52
  }) => void;
53
+ /**
54
+ * Merge a generator's own config into an `nx.json` `targetDefaults` value,
55
+ * preserving whatever the workspace already had. `apply` receives the config to
56
+ * layer onto and returns the merged config (e.g. `(base) => ({ cache: true,
57
+ * ...base })`); it must be idempotent so re-running the generator is a no-op.
58
+ *
59
+ * Nx 23.1 widened each value to either a config object or an ordered array of
60
+ * filtered entries. The plugin only contributes unfiltered (catch-all) config,
61
+ * so the input's shape is preserved: an object (or unset) stays an object;
62
+ * an array keeps the user's filtered entries and `apply` merges into its first
63
+ * unfiltered entry, prepending one as the base if none exists (Nx layers later
64
+ * matches on top, so our catch-all must stay first to not override a filter).
65
+ */
66
+ export declare const mergeTargetDefault: (value: TargetDefaultValue | undefined, apply: (base: Partial<TargetConfiguration>) => Partial<TargetConfiguration>) => TargetDefaultValue;
53
67
  /**
54
68
  * A single entry in an Nx `dependsOn` array.
55
69
  * Matches the shape accepted by Nx without requiring a devkit type import.
package/src/utils/nx.js CHANGED
@@ -112,6 +112,31 @@ export const getPackageVersion = ()=>{
112
112
  });
113
113
  }
114
114
  };
115
+ /**
116
+ * Merge a generator's own config into an `nx.json` `targetDefaults` value,
117
+ * preserving whatever the workspace already had. `apply` receives the config to
118
+ * layer onto and returns the merged config (e.g. `(base) => ({ cache: true,
119
+ * ...base })`); it must be idempotent so re-running the generator is a no-op.
120
+ *
121
+ * Nx 23.1 widened each value to either a config object or an ordered array of
122
+ * filtered entries. The plugin only contributes unfiltered (catch-all) config,
123
+ * so the input's shape is preserved: an object (or unset) stays an object;
124
+ * an array keeps the user's filtered entries and `apply` merges into its first
125
+ * unfiltered entry, prepending one as the base if none exists (Nx layers later
126
+ * matches on top, so our catch-all must stay first to not override a filter).
127
+ */ export const mergeTargetDefault = (value, apply)=>{
128
+ if (!Array.isArray(value)) {
129
+ return apply(value ?? {});
130
+ }
131
+ const catchAllIndex = value.findIndex((entry)=>entry.filter === undefined);
132
+ if (catchAllIndex === -1) {
133
+ return [
134
+ apply({}),
135
+ ...value
136
+ ];
137
+ }
138
+ return value.map((entry, index)=>index === catchAllIndex ? apply(entry) : entry);
139
+ };
115
140
  const targetDependencyEquals = (a, b)=>{
116
141
  if (typeof a === 'string' || typeof b === 'string') {
117
142
  return a === b;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../packages/nx-plugin/src/utils/nx.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n getProjects,\n type ProjectConfiguration,\n readProjectConfiguration,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport * as path from 'path';\nimport PackageJson from '../../package.json' with { type: 'json' };\nimport { toSnakeCase } from './names';\nimport { getNpmScope, getNpmScopePrefix } from './npm-scope';\n\nexport type { GeneratorInfo, NxGeneratorInfo } from './generators';\nexport { buildGeneratorInfoList } from './generators';\n\nimport { buildGeneratorInfoList, type GeneratorInfo } from './generators';\n\nconst GENERATORS = buildGeneratorInfoList(\n path.resolve(import.meta.dirname, '..', '..'),\n);\n\n/**\n * List Nx Plugin for AWS generators\n * @param includeHidden include hidden generators (default false)\n */\nexport const listGenerators = (includeHidden = false) =>\n GENERATORS.filter((g) => includeHidden || !g.hidden);\n\n/**\n * Return generator information. Call this from a generator method with import.meta.filename\n */\nexport const getGeneratorInfo = (generatorFileName: string): GeneratorInfo => {\n const { dir, name } = path.parse(path.resolve(generatorFileName));\n const resolvedFactoryPath = path.join(dir, name);\n return GENERATORS.find(\n (generatorInfo) =>\n generatorInfo.resolvedFactoryPath === resolvedFactoryPath,\n );\n};\n\nexport const getPackageVersion = () => {\n return PackageJson.version;\n};\n\n/**\n * Read a project configuration where the project name may not be fully qualified (ie may omit the scope prefix)\n */\nexport const readProjectConfigurationUnqualified = (\n tree: Tree,\n projectName: string,\n) => {\n try {\n return readProjectConfiguration(tree, projectName);\n } catch (e) {\n // Attempt to find the project without the scope\n const project = [...getProjects(tree).values()].find(\n (p) =>\n p.name &&\n (p.name === `${getNpmScopePrefix(tree)}${projectName}` || // TypeScript fully-qualified name\n p.name === `${toSnakeCase(getNpmScope(tree))}.${projectName}`), // Python fully-qualified name\n );\n if (project) {\n return project;\n }\n throw e;\n }\n};\n\n/**\n * Returns whether a project with the given name already exists in the workspace.\n * The project name may be unqualified (ie may omit the scope prefix).\n */\nexport const projectExists = (tree: Tree, projectName: string): boolean => {\n try {\n readProjectConfigurationUnqualified(tree, projectName);\n return true;\n } catch {\n return false;\n }\n};\n\n/**\n * Add metadata about the generator that generated the project to the project.json\n */\nexport const addGeneratorMetadata = (\n tree: Tree,\n projectName: string,\n info: { id: string },\n additionalMetadata?: { [key: string]: any },\n) => {\n const config = readProjectConfigurationUnqualified(tree, projectName);\n const metadata = {\n ...config?.metadata,\n generator: info.id,\n ...additionalMetadata,\n };\n // Skip the write when nothing changed so re-running doesn't reserialize\n // project.json. metadata is plain JSON built in a fixed key order, so a\n // stringify comparison is exact here.\n if (JSON.stringify(config?.metadata) === JSON.stringify(metadata)) {\n return;\n }\n // Place metadata immediately before targets so the serialized key order is\n // identical whether or not metadata already existed (matching the order Nx\n // normalizes a read config to), keeping the change a pure metadata insert.\n const { targets, ...rest } = config;\n updateProjectConfiguration(tree, config.name, {\n ...rest,\n metadata: metadata as any,\n ...(targets ? { targets } : {}),\n });\n};\n\n/**\n * Represents a component entry in project metadata\n */\nexport interface ComponentMetadata {\n readonly generator: string;\n readonly name?: string;\n readonly path?: string;\n [key: string]: any;\n}\n\n/**\n * Add metadata about the generator that generated the component to the project.json\n */\nexport const addComponentGeneratorMetadata = (\n tree: Tree,\n projectName: string,\n info: { id: string },\n componentPath: string,\n componentName?: string,\n additionalMetadata?: { [key: string]: any },\n) => {\n const config = readProjectConfigurationUnqualified(tree, projectName);\n\n const existingComponents = (config?.metadata as any)?.components ?? [];\n const alreadyAdded = existingComponents.filter(\n (c: any) => c.generator === info.id && c.name === componentName,\n );\n\n if (alreadyAdded.length === 0) {\n const componentMetadata: ComponentMetadata = {\n generator: info.id,\n path: componentPath,\n ...(componentName ? { name: componentName } : {}),\n ...additionalMetadata,\n };\n // Place metadata before targets for a stable serialized key order.\n const { targets, ...rest } = config;\n updateProjectConfiguration(tree, config.name, {\n ...rest,\n metadata: {\n ...config?.metadata,\n components: [...existingComponents, componentMetadata],\n } as any,\n ...(targets ? { targets } : {}),\n });\n }\n};\n\n/**\n * A single entry in an Nx `dependsOn` array.\n * Matches the shape accepted by Nx without requiring a devkit type import.\n */\nexport type TargetDependency =\n | string\n | {\n projects?: string | string[];\n target: string;\n params?: 'ignore' | 'forward';\n };\n\nconst targetDependencyEquals = (a: TargetDependency, b: TargetDependency) => {\n if (typeof a === 'string' || typeof b === 'string') {\n return a === b;\n }\n if (a.target !== b.target || a.params !== b.params) {\n return false;\n }\n const aProjects = Array.isArray(a.projects)\n ? a.projects\n : a.projects !== undefined\n ? [a.projects]\n : [];\n const bProjects = Array.isArray(b.projects)\n ? b.projects\n : b.projects !== undefined\n ? [b.projects]\n : [];\n if (aProjects.length !== bProjects.length) {\n return false;\n }\n return aProjects.every((p, i) => p === bProjects[i]);\n};\n\n// The order target properties are authored in. Nx preserves a target's\n// authored key order when it reads then rewrites an existing project.json,\n// except `options` and `configurations`, which it always moves to the end (in\n// that order). Keeping `options`/`configurations` last here therefore makes a\n// generator's first-run output byte-identical to subsequent runs (idempotency);\n// the remaining keys are ordered to read intuitively.\nconst NX_TARGET_KEY_ORDER = [\n 'executor',\n 'dependsOn',\n 'continuous',\n 'cache',\n 'inputs',\n 'outputs',\n 'metadata',\n 'defaultConfiguration',\n 'options',\n 'configurations',\n];\n\n/**\n * Reorder a target's keys to match Nx's own serialization order. Nx reorders\n * target properties when it rewrites an existing project.json, so applying the\n * same order when first authoring a target keeps generators idempotent.\n */\nexport const normalizeTargetKeyOrder = <T extends object>(target: T): T =>\n Object.fromEntries(\n Object.entries(target as Record<string, unknown>).sort(([a], [b]) => {\n const ai = NX_TARGET_KEY_ORDER.indexOf(a);\n const bi = NX_TARGET_KEY_ORDER.indexOf(b);\n return (\n (ai === -1 ? NX_TARGET_KEY_ORDER.length : ai) -\n (bi === -1 ? NX_TARGET_KEY_ORDER.length : bi)\n );\n }),\n ) as T;\n\n/**\n * Mutate the project to add the dependency to the target if not already present\n * Adds the target if not present.\n *\n * Accepts either a string target name (e.g. `'build'`) or a dependency config\n * object (e.g. `{ projects: ['foo'], target: 'dev' }`). Deduplicates\n * using deep equality so re-running a generator does not grow `dependsOn`.\n */\nexport const addDependencyToTargetIfNotPresent = (\n project: ProjectConfiguration,\n target: string,\n dependency: TargetDependency,\n) => {\n project.targets ??= {};\n project.targets[target] ??= {};\n project.targets[target].dependsOn ??= [];\n const dependsOn = project.targets[target].dependsOn;\n // Leave existing dependencies in place so re-running does not reorder them;\n // only append when the dependency is genuinely absent.\n if (!dependsOn.some((d) => targetDependencyEquals(d, dependency))) {\n dependsOn.push(dependency);\n }\n // Keep key order aligned with Nx's so first run matches subsequent runs.\n project.targets[target] = normalizeTargetKeyOrder(project.targets[target]);\n};\n\n/**\n * Register a component's `<name>-dev` target under the project-level `dev`\n * target, so `nx run <project>:dev` starts every component in the project.\n *\n * Component generators author their own continuous `<name>-dev` runner and call\n * this to aggregate it. Every component added to the project accumulates its\n * `<name>-dev` under `dev`. Nx keys tasks by `project:target`, so any\n * dependencies shared between components run exactly once.\n */\nexport const addComponentDevTarget = (\n targets: Record<string, ProjectConfiguration['targets'][string]>,\n componentDevTargetName: string,\n) => {\n targets['dev'] ??= { continuous: true, dependsOn: [] };\n const projectDev = targets['dev'];\n projectDev.continuous = true;\n projectDev.dependsOn ??= [];\n // Append in component-creation order; dedupe keeps re-runs idempotent.\n if (!projectDev.dependsOn.includes(componentDevTargetName)) {\n projectDev.dependsOn.push(componentDevTargetName);\n }\n targets['dev'] = normalizeTargetKeyOrder(projectDev);\n};\n"],"names":["getProjects","readProjectConfiguration","updateProjectConfiguration","path","PackageJson","type","toSnakeCase","getNpmScope","getNpmScopePrefix","buildGeneratorInfoList","GENERATORS","resolve","dirname","listGenerators","includeHidden","filter","g","hidden","getGeneratorInfo","generatorFileName","dir","name","parse","resolvedFactoryPath","join","find","generatorInfo","getPackageVersion","version","readProjectConfigurationUnqualified","tree","projectName","e","project","values","p","projectExists","addGeneratorMetadata","info","additionalMetadata","config","metadata","generator","id","JSON","stringify","targets","rest","addComponentGeneratorMetadata","componentPath","componentName","existingComponents","components","alreadyAdded","c","length","componentMetadata","targetDependencyEquals","a","b","target","params","aProjects","Array","isArray","projects","undefined","bProjects","every","i","NX_TARGET_KEY_ORDER","normalizeTargetKeyOrder","Object","fromEntries","entries","sort","ai","indexOf","bi","addDependencyToTargetIfNotPresent","dependency","dependsOn","some","d","push","addComponentDevTarget","componentDevTargetName","continuous","projectDev","includes"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EAEXC,wBAAwB,EAExBC,0BAA0B,QACrB,aAAa;AACpB,YAAYC,UAAU,OAAO;AAC7B,OAAOC,iBAAiB,0BAA0B;IAAEC,MAAM;AAAO,EAAE;AACnE,SAASC,WAAW,QAAQ,aAAU;AACtC,SAASC,WAAW,EAAEC,iBAAiB,QAAQ,iBAAc;AAG7D,SAASC,sBAAsB,QAAQ,kBAAe;AAEtD,SAASA,sBAAsB,QAA4B,kBAAe;AAE1E,MAAMC,aAAaD,uBACjBN,KAAKQ,OAAO,CAAC,YAAYC,OAAO,EAAE,MAAM;AAG1C;;;CAGC,GACD,OAAO,MAAMC,iBAAiB,CAACC,gBAAgB,KAAK,GAClDJ,WAAWK,MAAM,CAAC,CAACC,I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AC;IACrBb,QAAQa,OAAO,CAACc,OAAO,KAAK,CAAC;IAC7B3B,QAAQa,OAAO,CAACc,OAAO,CAACqB,SAAS,KAAK,EAAE;IACxC,MAAMA,YAAYhD,QAAQa,OAAO,CAACc,OAAO,CAACqB,SAAS;IACnD,4EAA4E;IAC5E,uDAAuD;IACvD,IAAI,CAACA,UAAUC,IAAI,CAAC,CAACC,IAAM1B,uBAAuB0B,GAAGH,cAAc;QACjEC,UAAUG,IAAI,CAACJ;IACjB;IACA,yEAAyE;IACzE/C,QAAQa,OAAO,CAACc,OAAO,GAAGW,wBAAwBtC,QAAQa,OAAO,CAACc,OAAO;AAC3E,EAAE;AAEF;;;;;;;;CAQC,GACD,OAAO,MAAMyB,wBAAwB,CACnCvC,SACAwC;IAEAxC,OAAO,CAAC,MAAM,KAAK;QAAEyC,YAAY;QAAMN,WAAW,EAAE;IAAC;IACrD,MAAMO,aAAa1C,OAAO,CAAC,MAAM;IACjC0C,WAAWD,UAAU,GAAG;IACxBC,WAAWP,SAAS,KAAK,EAAE;IAC3B,uEAAuE;IACvE,IAAI,CAACO,WAAWP,SAAS,CAACQ,QAAQ,CAACH,yBAAyB;QAC1DE,WAAWP,SAAS,CAACG,IAAI,CAACE;IAC5B;IACAxC,OAAO,CAAC,MAAM,GAAGyB,wBAAwBiB;AAC3C,EAAE"}
1
+ {"version":3,"sources":["../../../../../packages/nx-plugin/src/utils/nx.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n getProjects,\n type ProjectConfiguration,\n readProjectConfiguration,\n type TargetConfiguration,\n type TargetDefaultValue,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport * as path from 'path';\nimport PackageJson from '../../package.json' with { type: 'json' };\nimport { toSnakeCase } from './names';\nimport { getNpmScope, getNpmScopePrefix } from './npm-scope';\n\nexport type { GeneratorInfo, NxGeneratorInfo } from './generators';\nexport { buildGeneratorInfoList } from './generators';\n\nimport { buildGeneratorInfoList, type GeneratorInfo } from './generators';\n\nconst GENERATORS = buildGeneratorInfoList(\n path.resolve(import.meta.dirname, '..', '..'),\n);\n\n/**\n * List Nx Plugin for AWS generators\n * @param includeHidden include hidden generators (default false)\n */\nexport const listGenerators = (includeHidden = false) =>\n GENERATORS.filter((g) => includeHidden || !g.hidden);\n\n/**\n * Return generator information. Call this from a generator method with import.meta.filename\n */\nexport const getGeneratorInfo = (generatorFileName: string): GeneratorInfo => {\n const { dir, name } = path.parse(path.resolve(generatorFileName));\n const resolvedFactoryPath = path.join(dir, name);\n return GENERATORS.find(\n (generatorInfo) =>\n generatorInfo.resolvedFactoryPath === resolvedFactoryPath,\n );\n};\n\nexport const getPackageVersion = () => {\n return PackageJson.version;\n};\n\n/**\n * Read a project configuration where the project name may not be fully qualified (ie may omit the scope prefix)\n */\nexport const readProjectConfigurationUnqualified = (\n tree: Tree,\n projectName: string,\n) => {\n try {\n return readProjectConfiguration(tree, projectName);\n } catch (e) {\n // Attempt to find the project without the scope\n const project = [...getProjects(tree).values()].find(\n (p) =>\n p.name &&\n (p.name === `${getNpmScopePrefix(tree)}${projectName}` || // TypeScript fully-qualified name\n p.name === `${toSnakeCase(getNpmScope(tree))}.${projectName}`), // Python fully-qualified name\n );\n if (project) {\n return project;\n }\n throw e;\n }\n};\n\n/**\n * Returns whether a project with the given name already exists in the workspace.\n * The project name may be unqualified (ie may omit the scope prefix).\n */\nexport const projectExists = (tree: Tree, projectName: string): boolean => {\n try {\n readProjectConfigurationUnqualified(tree, projectName);\n return true;\n } catch {\n return false;\n }\n};\n\n/**\n * Add metadata about the generator that generated the project to the project.json\n */\nexport const addGeneratorMetadata = (\n tree: Tree,\n projectName: string,\n info: { id: string },\n additionalMetadata?: { [key: string]: any },\n) => {\n const config = readProjectConfigurationUnqualified(tree, projectName);\n const metadata = {\n ...config?.metadata,\n generator: info.id,\n ...additionalMetadata,\n };\n // Skip the write when nothing changed so re-running doesn't reserialize\n // project.json. metadata is plain JSON built in a fixed key order, so a\n // stringify comparison is exact here.\n if (JSON.stringify(config?.metadata) === JSON.stringify(metadata)) {\n return;\n }\n // Place metadata immediately before targets so the serialized key order is\n // identical whether or not metadata already existed (matching the order Nx\n // normalizes a read config to), keeping the change a pure metadata insert.\n const { targets, ...rest } = config;\n updateProjectConfiguration(tree, config.name, {\n ...rest,\n metadata: metadata as any,\n ...(targets ? { targets } : {}),\n });\n};\n\n/**\n * Represents a component entry in project metadata\n */\nexport interface ComponentMetadata {\n readonly generator: string;\n readonly name?: string;\n readonly path?: string;\n [key: string]: any;\n}\n\n/**\n * Add metadata about the generator that generated the component to the project.json\n */\nexport const addComponentGeneratorMetadata = (\n tree: Tree,\n projectName: string,\n info: { id: string },\n componentPath: string,\n componentName?: string,\n additionalMetadata?: { [key: string]: any },\n) => {\n const config = readProjectConfigurationUnqualified(tree, projectName);\n\n const existingComponents = (config?.metadata as any)?.components ?? [];\n const alreadyAdded = existingComponents.filter(\n (c: any) => c.generator === info.id && c.name === componentName,\n );\n\n if (alreadyAdded.length === 0) {\n const componentMetadata: ComponentMetadata = {\n generator: info.id,\n path: componentPath,\n ...(componentName ? { name: componentName } : {}),\n ...additionalMetadata,\n };\n // Place metadata before targets for a stable serialized key order.\n const { targets, ...rest } = config;\n updateProjectConfiguration(tree, config.name, {\n ...rest,\n metadata: {\n ...config?.metadata,\n components: [...existingComponents, componentMetadata],\n } as any,\n ...(targets ? { targets } : {}),\n });\n }\n};\n\n/**\n * Merge a generator's own config into an `nx.json` `targetDefaults` value,\n * preserving whatever the workspace already had. `apply` receives the config to\n * layer onto and returns the merged config (e.g. `(base) => ({ cache: true,\n * ...base })`); it must be idempotent so re-running the generator is a no-op.\n *\n * Nx 23.1 widened each value to either a config object or an ordered array of\n * filtered entries. The plugin only contributes unfiltered (catch-all) config,\n * so the input's shape is preserved: an object (or unset) stays an object;\n * an array keeps the user's filtered entries and `apply` merges into its first\n * unfiltered entry, prepending one as the base if none exists (Nx layers later\n * matches on top, so our catch-all must stay first to not override a filter).\n */\nexport const mergeTargetDefault = (\n value: TargetDefaultValue | undefined,\n apply: (base: Partial<TargetConfiguration>) => Partial<TargetConfiguration>,\n): TargetDefaultValue => {\n if (!Array.isArray(value)) {\n return apply(value ?? {});\n }\n const catchAllIndex = value.findIndex((entry) => entry.filter === undefined);\n if (catchAllIndex === -1) {\n return [apply({}), ...value];\n }\n return value.map((entry, index) =>\n index === catchAllIndex ? apply(entry) : entry,\n );\n};\n\n/**\n * A single entry in an Nx `dependsOn` array.\n * Matches the shape accepted by Nx without requiring a devkit type import.\n */\nexport type TargetDependency =\n | string\n | {\n projects?: string | string[];\n target: string;\n params?: 'ignore' | 'forward';\n };\n\nconst targetDependencyEquals = (a: TargetDependency, b: TargetDependency) => {\n if (typeof a === 'string' || typeof b === 'string') {\n return a === b;\n }\n if (a.target !== b.target || a.params !== b.params) {\n return false;\n }\n const aProjects = Array.isArray(a.projects)\n ? a.projects\n : a.projects !== undefined\n ? [a.projects]\n : [];\n const bProjects = Array.isArray(b.projects)\n ? b.projects\n : b.projects !== undefined\n ? [b.projects]\n : [];\n if (aProjects.length !== bProjects.length) {\n return false;\n }\n return aProjects.every((p, i) => p === bProjects[i]);\n};\n\n// The order target properties are authored in. Nx preserves a target's\n// authored key order when it reads then rewrites an existing project.json,\n// except `options` and `configurations`, which it always moves to the end (in\n// that order). Keeping `options`/`configurations` last here therefore makes a\n// generator's first-run output byte-identical to subsequent runs (idempotency);\n// the remaining keys are ordered to read intuitively.\nconst NX_TARGET_KEY_ORDER = [\n 'executor',\n 'dependsOn',\n 'continuous',\n 'cache',\n 'inputs',\n 'outputs',\n 'metadata',\n 'defaultConfiguration',\n 'options',\n 'configurations',\n];\n\n/**\n * Reorder a target's keys to match Nx's own serialization order. Nx reorders\n * target properties when it rewrites an existing project.json, so applying the\n * same order when first authoring a target keeps generators idempotent.\n */\nexport const normalizeTargetKeyOrder = <T extends object>(target: T): T =>\n Object.fromEntries(\n Object.entries(target as Record<string, unknown>).sort(([a], [b]) => {\n const ai = NX_TARGET_KEY_ORDER.indexOf(a);\n const bi = NX_TARGET_KEY_ORDER.indexOf(b);\n return (\n (ai === -1 ? NX_TARGET_KEY_ORDER.length : ai) -\n (bi === -1 ? NX_TARGET_KEY_ORDER.length : bi)\n );\n }),\n ) as T;\n\n/**\n * Mutate the project to add the dependency to the target if not already present\n * Adds the target if not present.\n *\n * Accepts either a string target name (e.g. `'build'`) or a dependency config\n * object (e.g. `{ projects: ['foo'], target: 'dev' }`). Deduplicates\n * using deep equality so re-running a generator does not grow `dependsOn`.\n */\nexport const addDependencyToTargetIfNotPresent = (\n project: ProjectConfiguration,\n target: string,\n dependency: TargetDependency,\n) => {\n project.targets ??= {};\n project.targets[target] ??= {};\n project.targets[target].dependsOn ??= [];\n const dependsOn = project.targets[target].dependsOn;\n // Leave existing dependencies in place so re-running does not reorder them;\n // only append when the dependency is genuinely absent.\n if (!dependsOn.some((d) => targetDependencyEquals(d, dependency))) {\n dependsOn.push(dependency);\n }\n // Keep key order aligned with Nx's so first run matches subsequent runs.\n project.targets[target] = normalizeTargetKeyOrder(project.targets[target]);\n};\n\n/**\n * Register a component's `<name>-dev` target under the project-level `dev`\n * target, so `nx run <project>:dev` starts every component in the project.\n *\n * Component generators author their own continuous `<name>-dev` runner and call\n * this to aggregate it. Every component added to the project accumulates its\n * `<name>-dev` under `dev`. Nx keys tasks by `project:target`, so any\n * dependencies shared between components run exactly once.\n */\nexport const addComponentDevTarget = (\n targets: Record<string, ProjectConfiguration['targets'][string]>,\n componentDevTargetName: string,\n) => {\n targets['dev'] ??= { continuous: true, dependsOn: [] };\n const projectDev = targets['dev'];\n projectDev.continuous = true;\n projectDev.dependsOn ??= [];\n // Append in component-creation order; dedupe keeps re-runs idempotent.\n if (!projectDev.dependsOn.includes(componentDevTargetName)) {\n projectDev.dependsOn.push(componentDevTargetName);\n }\n targets['dev'] = normalizeTargetKeyOrder(projectDev);\n};\n"],"names":["getProjects","readProjectConfiguration","updateProjectConfiguration","path","PackageJson","type","toSnakeCase","getNpmScope","getNpmScopePrefix","buildGeneratorInfoList","GENERATORS","resolve","dirname","listGenerators","includeHidden","filter","g","hidden","getGeneratorInfo","generatorFileName","dir","name","parse","resolvedFactoryPath","join","find","generatorInfo","getPackageVersion","version","readProjectConfigurationUnqualified","tree","projectName","e","project","values","p","projectExists","addGeneratorMetadata","info","additionalMetadata","config","metadata","generator","id","JSON","stringify","targets","rest","addComponentGeneratorMetadata","componentPath","componentName","existingComponents","components","alreadyAdded","c","length","componentMetadata","mergeTargetDefault","value","apply","Array","isArray","catchAllIndex","findIndex","entry","undefined","map","index","targetDependencyEquals","a","b","target","params","aProjects","projects","bProjects","every","i","NX_TARGET_KEY_ORDER","normalizeTargetKeyOrder","Object","fromEntries","entries","sort","ai","indexOf","bi","addDependencyToTargetIfNotPresent","dependency","dependsOn","some","d","push","addComponentDevTarget","componentDevTargetName","continuous","projectDev","includes"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EAEXC,wBAAwB,EAIxBC,0BAA0B,QACrB,aAAa;AACpB,YAAYC,UAAU,OAAO;AAC7B,OAAOC,iBAAiB,0BAA0B;IAAEC,MAAM;AAAO,EAAE;AACnE,SAASC,WAAW,QAAQ,aAAU;AACtC,SAASC,WAAW,EAAEC,iBAAiB,QAAQ,iBAAc;AAG7D,SAASC,sBAAsB,QAAQ,kBAAe;AAEtD,SAASA,sBAAsB,QAA4B,kBAAe;AAE1E,MAAMC,aAAaD,uBACjBN,KAAKQ,OAAO,CAAC,YAAYC,OAAO,EAAE,MAAM;AAG1C;;;CAGC,GACD,OAAO,MAAMC,iBAAiB,CAACC,gBAAgB,KAAK,GAClDJ,WAAWK,MAAM,CAAC,CAACC,IAAMF,iBAAiB,CAACE,EAAEC,MAAM,EAAE;AAEvD;;CAEC,GACD,OAAO,MAAMC,mBAAmB,CAACC;IAC/B,MAAM,EAAEC,GAAG,EAAEC,IAAI,EAAE,GAAGlB,KAA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O,OAAO,CAACf;QACvC,OACE,AAACc,CAAAA,OAAO,CAAC,IAAIN,oBAAoBvB,MAAM,GAAG6B,EAAC,IAC1CE,CAAAA,OAAO,CAAC,IAAIR,oBAAoBvB,MAAM,GAAG+B,EAAC;IAE/C,IACK;AAET;;;;;;;CAOC,GACD,OAAO,MAAMC,oCAAoC,CAC/CtD,SACAsC,QACAiB;IAEAvD,QAAQa,OAAO,KAAK,CAAC;IACrBb,QAAQa,OAAO,CAACyB,OAAO,KAAK,CAAC;IAC7BtC,QAAQa,OAAO,CAACyB,OAAO,CAACkB,SAAS,KAAK,EAAE;IACxC,MAAMA,YAAYxD,QAAQa,OAAO,CAACyB,OAAO,CAACkB,SAAS;IACnD,4EAA4E;IAC5E,uDAAuD;IACvD,IAAI,CAACA,UAAUC,IAAI,CAAC,CAACC,IAAMvB,uBAAuBuB,GAAGH,cAAc;QACjEC,UAAUG,IAAI,CAACJ;IACjB;IACA,yEAAyE;IACzEvD,QAAQa,OAAO,CAACyB,OAAO,GAAGQ,wBAAwB9C,QAAQa,OAAO,CAACyB,OAAO;AAC3E,EAAE;AAEF;;;;;;;;CAQC,GACD,OAAO,MAAMsB,wBAAwB,CACnC/C,SACAgD;IAEAhD,OAAO,CAAC,MAAM,KAAK;QAAEiD,YAAY;QAAMN,WAAW,EAAE;IAAC;IACrD,MAAMO,aAAalD,OAAO,CAAC,MAAM;IACjCkD,WAAWD,UAAU,GAAG;IACxBC,WAAWP,SAAS,KAAK,EAAE;IAC3B,uEAAuE;IACvE,IAAI,CAACO,WAAWP,SAAS,CAACQ,QAAQ,CAACH,yBAAyB;QAC1DE,WAAWP,SAAS,CAACG,IAAI,CAACE;IAC5B;IACAhD,OAAO,CAAC,MAAM,GAAGiC,wBAAwBiB;AAC3C,EAAE"}
@@ -27,9 +27,9 @@ export declare const TS_VERSIONS: {
27
27
  readonly '@middy/core': "7.7.0";
28
28
  readonly '@nxlv/python': "22.2.1";
29
29
  readonly '@nx-extend/terraform': "10.3.0";
30
- readonly '@nx/devkit': "23.0.2";
31
- readonly '@nx/react': "23.0.2";
32
- readonly 'create-nx-workspace': "23.0.2";
30
+ readonly '@nx/devkit': "23.1.0";
31
+ readonly '@nx/react': "23.1.0";
32
+ readonly 'create-nx-workspace': "23.1.0";
33
33
  readonly '@swc-node/register': "1.11.1";
34
34
  readonly '@swc/core': "1.15.43";
35
35
  readonly '@modelcontextprotocol/sdk': "1.29.0";
@@ -131,7 +131,7 @@ export type ITsDepVersion = keyof typeof TS_VERSIONS;
131
131
  * Add versions to the given dependencies
132
132
  */
133
133
  export declare const withVersions: (deps: ITsDepVersion[]) => {
134
- [k: string]: "0.3.14" | "0.12.0" | "3.1085.0" | "3.972.56" | "1.0.0-alpha.10" | "2.34.0" | "7.7.0" | "22.2.1" | "10.3.0" | "23.0.2" | "1.11.1" | "1.15.43" | "1.29.0" | "0.22.0" | "0.2.3" | "0.0.57" | "0.3.0" | "1.62.3" | "7.8.2" | "1.9.0" | "1.170.17" | "1.168.19" | "1.167.18" | "1.162.0" | "1.162.2" | "3.0.201" | "1.0.149" | "3.0.1325" | "1.0.62" | "5.101.2" | "11.18.0" | "26.1.1" | "8.10.162" | "2.8.19" | "8.20.0" | "8.18.1" | "5.0.6" | "4.6.8" | "4.5.8" | "4.9.5" | "4.16.1" | "4.1.10" | "6.0.1" | "0.41.3" | "7.0.7" | "1.0.20" | "2.1130.0" | "2.261.0" | "3.12.0" | "10.6.0" | "2.8.6" | "5.6.2" | "0.7.1" | "2.1.1" | "15.0.0" | "3.9.1" | "0.28.1" | "1.0.31" | "1.0.5" | "2.5.3" | "7.8.0" | "3.1.5" | "5.2.1" | "3.3.3" | "9.1.7" | "11.3.6" | "11.0.4" | "4.0.0" | "3.5.3" | "2.0.0" | "12.0.1" | "22.2.9" | "3.5.0" | "8.22.0" | "3.3.1" | "19.2.7" | "6.1.3" | "1.1.5" | "3.36.0" | "0.5.21" | "0.28.0" | "4.3.2" | "4.23.0" | "1.24.0" | "1.6.2" | "4.13.0" | "1.4.0" | "3.6.0" | "8.1.4" | "6.0.3" | "4.4.3" | "8.21.0";
134
+ [k: string]: "0.3.14" | "0.12.0" | "3.1085.0" | "3.972.56" | "1.0.0-alpha.10" | "2.34.0" | "7.7.0" | "22.2.1" | "10.3.0" | "23.1.0" | "1.11.1" | "1.15.43" | "1.29.0" | "0.22.0" | "0.2.3" | "0.0.57" | "0.3.0" | "1.62.3" | "7.8.2" | "1.9.0" | "1.170.17" | "1.168.19" | "1.167.18" | "1.162.0" | "1.162.2" | "3.0.201" | "1.0.149" | "3.0.1325" | "1.0.62" | "5.101.2" | "11.18.0" | "26.1.1" | "8.10.162" | "2.8.19" | "8.20.0" | "8.18.1" | "5.0.6" | "4.6.8" | "4.5.8" | "4.9.5" | "4.16.1" | "4.1.10" | "6.0.1" | "0.41.3" | "7.0.7" | "1.0.20" | "2.1130.0" | "2.261.0" | "3.12.0" | "10.6.0" | "2.8.6" | "5.6.2" | "0.7.1" | "2.1.1" | "15.0.0" | "3.9.1" | "0.28.1" | "1.0.31" | "1.0.5" | "2.5.3" | "7.8.0" | "3.1.5" | "5.2.1" | "3.3.3" | "9.1.7" | "11.3.6" | "11.0.4" | "4.0.0" | "3.5.3" | "2.0.0" | "12.0.1" | "22.2.9" | "3.5.0" | "8.22.0" | "3.3.1" | "19.2.7" | "6.1.3" | "1.1.5" | "3.36.0" | "0.5.21" | "0.28.0" | "4.3.2" | "4.23.0" | "1.24.0" | "1.6.2" | "4.13.0" | "1.4.0" | "3.6.0" | "8.1.4" | "6.0.3" | "4.4.3" | "8.21.0";
135
135
  };
136
136
  /**
137
137
  * Versions for Python dependencies added by generators
@@ -25,9 +25,9 @@
25
25
  '@middy/core': '7.7.0',
26
26
  '@nxlv/python': '22.2.1',
27
27
  '@nx-extend/terraform': '10.3.0',
28
- '@nx/devkit': '23.0.2',
29
- '@nx/react': '23.0.2',
30
- 'create-nx-workspace': '23.0.2',
28
+ '@nx/devkit': '23.1.0',
29
+ '@nx/react': '23.1.0',
30
+ 'create-nx-workspace': '23.1.0',
31
31
  '@swc-node/register': '1.11.1',
32
32
  '@swc/core': '1.15.43',
33
33
  '@modelcontextprotocol/sdk': '1.29.0',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../packages/nx-plugin/src/utils/versions.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Versons for TypeScript dependencies added by generators\n */\nexport const TS_VERSIONS = {\n '@a2a-js/sdk': '0.3.14',\n '@aws/aws-distro-opentelemetry-node-autoinstrumentation': '0.12.0',\n '@aws-sdk/client-dynamodb': '3.1085.0',\n '@aws-sdk/client-bedrock-runtime': '3.1085.0',\n '@aws-sdk/client-s3': '3.1085.0',\n '@aws-sdk/client-sts': '3.1085.0',\n '@aws-sdk/credential-providers': '3.1085.0',\n '@aws-sdk/credential-provider-cognito-identity': '3.972.56',\n '@aws-sdk/client-secrets-manager': '3.1085.0',\n '@aws-sdk/rds-signer': '3.1085.0',\n '@aws-smithy/server-apigateway': '1.0.0-alpha.10',\n '@aws-smithy/server-node': '1.0.0-alpha.10',\n '@aws-lambda-powertools/logger': '2.34.0',\n '@aws-lambda-powertools/metrics': '2.34.0',\n '@aws-lambda-powertools/parameters': '2.34.0',\n '@aws-lambda-powertools/tracer': '2.34.0',\n '@aws-lambda-powertools/parser': '2.34.0',\n '@aws-sdk/client-appconfigdata': '3.1085.0',\n '@middy/core': '7.7.0',\n '@nxlv/python': '22.2.1',\n '@nx-extend/terraform': '10.3.0',\n '@nx/devkit': '23.0.2',\n '@nx/react': '23.0.2',\n 'create-nx-workspace': '23.0.2',\n '@swc-node/register': '1.11.1',\n '@swc/core': '1.15.43',\n '@modelcontextprotocol/sdk': '1.29.0',\n '@modelcontextprotocol/inspector': '0.22.0',\n '@ag-ui/aws-strands': '0.2.3',\n '@ag-ui/client': '0.0.57',\n '@ag-ui/core': '0.0.57',\n '@ag-ui/encoder': '0.0.57',\n 'agent-chat-cli': '0.3.0',\n '@copilotkit/react-core': '1.62.3',\n rxjs: '7.8.2',\n '@strands-agents/sdk': '1.9.0',\n '@tanstack/react-router': '1.170.17',\n '@tanstack/router-plugin': '1.168.19',\n '@tanstack/router-generator': '1.167.18',\n '@tanstack/virtual-file-routes': '1.162.0',\n '@tanstack/router-utils': '1.162.2',\n '@cloudscape-design/board-components': '3.0.201',\n '@cloudscape-design/chat-components': '1.0.149',\n '@cloudscape-design/components': '3.0.1325',\n '@cloudscape-design/global-styles': '1.0.62',\n '@tanstack/react-query': '5.101.2',\n '@tanstack/react-query-devtools': '5.101.2',\n '@trpc/tanstack-react-query': '11.18.0',\n '@trpc/client': '11.18.0',\n '@trpc/server': '11.18.0',\n '@types/node': '26.1.1',\n '@types/aws-lambda': '8.10.162',\n '@types/cors': '2.8.19',\n '@types/pg': '8.20.0',\n '@types/ws': '8.18.1',\n '@types/express': '5.0.6',\n '@smithy/config-resolver': '4.6.8',\n '@smithy/node-config-provider': '4.5.8',\n '@smithy/node-http-handler': '4.9.5',\n '@smithy/types': '4.16.1',\n '@vitest/coverage-v8': '4.1.10',\n '@vitest/ui': '4.1.10',\n '@astrojs/react': '6.0.1',\n '@astrojs/starlight': '0.41.3',\n astro: '7.0.7',\n aws4fetch: '1.0.20',\n 'aws-cdk': '2.1130.0',\n 'aws-cdk-lib': '2.261.0',\n 'aws-xray-sdk-core': '3.12.0',\n constructs: '10.6.0',\n cors: '2.8.6',\n chalk: '5.6.2',\n 'class-variance-authority': '0.7.1',\n clsx: '2.1.1',\n commander: '15.0.0',\n electrodb: '3.9.1',\n esbuild: '0.28.1',\n 'event-source-polyfill': '1.0.31',\n '@types/event-source-polyfill': '1.0.5',\n '@biomejs/biome': '2.5.3',\n '@prisma/adapter-mariadb': '7.8.0',\n '@prisma/adapter-pg': '7.8.0',\n '@prisma/client': '7.8.0',\n ejs: '6.0.1',\n '@types/ejs': '3.1.5',\n express: '5.2.1',\n 'fast-glob': '3.3.3',\n husky: '9.1.7',\n 'fs-extra': '11.3.6',\n '@types/fs-extra': '11.0.4',\n 'make-dir-cli': '4.0.0',\n mariadb: '3.5.3',\n ncp: '2.0.0',\n npm: '12.0.1',\n 'npm-check-updates': '22.2.9',\n 'oidc-client-ts': '3.5.0',\n pg: '8.22.0',\n prisma: '7.8.0',\n 'react-oidc-context': '3.3.1',\n react: '19.2.7',\n 'react-dom': '19.2.7',\n rimraf: '6.1.3',\n rolldown: '1.1.5',\n 'simple-git': '3.36.0',\n 'source-map-support': '0.5.21',\n 'starlight-blog': '0.28.0',\n tailwindcss: '4.3.2',\n '@tailwindcss/vite': '4.3.2',\n tsx: '4.23.0',\n 'lucide-react': '1.24.0',\n 'radix-ui': '1.6.2',\n shadcn: '4.13.0',\n 'tw-animate-css': '1.4.0',\n 'tailwind-merge': '3.6.0',\n vite: '8.1.4',\n typescript: '6.0.3',\n vitest: '4.1.10',\n zod: '4.4.3',\n ws: '8.21.0',\n} as const;\nexport type ITsDepVersion = keyof typeof TS_VERSIONS;\n\n/**\n * Add versions to the given dependencies\n */\nexport const withVersions = (deps: ITsDepVersion[]) =>\n Object.fromEntries(deps.map((dep) => [dep, TS_VERSIONS[dep]]));\n\n/**\n * Versions for Python dependencies added by generators\n */\nexport const PY_VERSIONS = {\n 'a2a-sdk': '==0.3.26',\n 'ag-ui-langgraph': '==0.0.42',\n 'ag-ui-protocol': '==0.1.19',\n 'ag-ui-strands': '==0.2.2',\n 'aws-lambda-powertools': '==3.31.0',\n 'aws-lambda-powertools[tracer]': '==3.31.0',\n 'aws-lambda-powertools[parser]': '==3.31.0',\n 'aws-opentelemetry-distro': '==0.18.0',\n 'bedrock-agentcore': '==1.18.0',\n boto3: '==1.43.46',\n checkov: '==3.3.8',\n fastapi: '==0.139.0',\n 'fastapi[standard]': '==0.139.0',\n httpx: '==0.28.1',\n langchain: '==1.3.13',\n 'langchain-aws': '==1.6.2',\n 'langchain-mcp-adapters': '==0.3.0',\n langgraph: '==1.2.9',\n mcp: '==1.28.1',\n 'pip-check-updates': '==0.29.0',\n 'pip-licenses': '==5.5.5',\n 'strands-agents': '==1.47.0',\n 'strands-agents[a2a]': '==1.47.0',\n 'strands-agents-tools': '==0.8.3',\n ty: '==0.0.59',\n pynamodb: '==6.1.0',\n uvicorn: '==0.51.0',\n sqlmodel: '==0.0.38',\n alembic: '==1.18.4',\n aiomysql: '==0.3.2',\n asyncpg: '==0.31.0',\n} as const;\nexport type IPyDepVersion = keyof typeof PY_VERSIONS;\n\n/**\n * Add versions to the given dependencies\n */\nexport const withPyVersions = (deps: IPyDepVersion[]) =>\n deps.map((dep) => `${dep}${PY_VERSIONS[dep]}`);\n\n/**\n * Versions for vendored tools\n */\nexport const VENDORED_VERSIONS = {\n 'git-secrets': '1.3.0',\n} as const;\n\n/**\n * Base container images used by generated Dockerfiles. Pinned exactly so\n * generated images are reproducible, and chosen to be free of known\n * HIGH/CRITICAL vulnerabilities at time of generation.\n */\nexport const BASE_IMAGES = {\n node: 'public.ecr.aws/docker/library/node:lts-slim',\n python: 'public.ecr.aws/docker/library/python:3.14-slim',\n} as const;\n\n/**\n * Versions for container tooling used by generated image build/scan targets.\n * Pinned exactly so generated images are reproducible.\n */\nexport const CONTAINER_VERSIONS = {\n // ECR-hosted Trivy image used to scan built images during the build.\n trivy: '0.72.0',\n} as const;\n\n/**\n * Exact versions for Terraform providers used by generated `.tf` modules.\n * Pinned exactly (no range operator) so generated infrastructure is reproducible.\n */\nexport const TERRAFORM_VERSIONS = {\n aws: '6.54.0',\n random: '3.9.0',\n null: '3.3.0',\n archive: '2.8.0',\n external: '2.4.0',\n local: '2.9.0',\n} as const;\nexport type ITerraformProviderVersion = keyof typeof TERRAFORM_VERSIONS;\n\n/**\n * Substitution variables exposing Terraform provider version constraints to\n * generated `.tf` templates (e.g. `version = \"<%- awsProviderVersion %>\"`)\n */\nexport const terraformProviderVersions = () => ({\n awsProviderVersion: TERRAFORM_VERSIONS.aws,\n randomProviderVersion: TERRAFORM_VERSIONS.random,\n nullProviderVersion: TERRAFORM_VERSIONS.null,\n archiveProviderVersion: TERRAFORM_VERSIONS.archive,\n externalProviderVersion: TERRAFORM_VERSIONS.external,\n localProviderVersion: TERRAFORM_VERSIONS.local,\n});\n"],"names":["TS_VERSIONS","rxjs","astro","aws4fetch","constructs","cors","chalk","clsx","commander","electrodb","esbuild","ejs","express","husky","mariadb","ncp","npm","pg","prisma","react","rimraf","rolldown","tailwindcss","tsx","shadcn","vite","typescript","vitest","zod","ws","withVersions","deps","Object","fromEntries","map","dep","PY_VERSIONS","boto3","checkov","fastapi","httpx","langchain","langgraph","mcp","ty","pynamodb","uvicorn","sqlmodel","alembic","aiomysql","asyncpg","withPyVersions","VENDORED_VERSIONS","BASE_IMAGES","node","python","CONTAINER_VERSIONS","trivy","TERRAFORM_VERSIONS","aws","random","null","archive","external","local","terraformProviderVersions","awsProviderVersion","randomProviderVersion","nullProviderVersion","archiveProviderVersion","externalProviderVersion","localProviderVersion"],"mappings":"AAAA;;;CAGC,GAED;;CAEC,GACD,OAAO,MAAMA,cAAc;IACzB,eAAe;IACf,0DAA0D;IAC1D,4BAA4B;IAC5B,mCAAmC;IACnC,sBAAsB;IACtB,uBAAuB;IACvB,iCAAiC;IACjC,iDAAiD;IACjD,mCAAmC;IACnC,uBAAuB;IACvB,iCAAiC;IACjC,2BAA2B;IAC3B,iCAAiC;IACjC,kCAAkC;IAClC,qCAAqC;IACrC,iCAAiC;IACjC,iCAAiC;IACjC,iCAAiC;IACjC,eAAe;IACf,gBAAgB;IAChB,wBAAwB;IACxB,cAAc;IACd,aAAa;IACb,uBAAuB;IACvB,sBAAsB;IACtB,aAAa;IACb,6BAA6B;IAC7B,mCAAmC;IACnC,sBAAsB;IACtB,iBAAiB;IACjB,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,0BAA0B;IAC1BC,MAAM;IACN,uBAAuB;IACvB,0BAA0B;IAC1B,2BAA2B;IAC3B,8BAA8B;IAC9B,iCAAiC;IACjC,0B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ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Versons for TypeScript dependencies added by generators\n */\nexport const TS_VERSIONS = {\n '@a2a-js/sdk': '0.3.14',\n '@aws/aws-distro-opentelemetry-node-autoinstrumentation': '0.12.0',\n '@aws-sdk/client-dynamodb': '3.1085.0',\n '@aws-sdk/client-bedrock-runtime': '3.1085.0',\n '@aws-sdk/client-s3': '3.1085.0',\n '@aws-sdk/client-sts': '3.1085.0',\n '@aws-sdk/credential-providers': '3.1085.0',\n '@aws-sdk/credential-provider-cognito-identity': '3.972.56',\n '@aws-sdk/client-secrets-manager': '3.1085.0',\n '@aws-sdk/rds-signer': '3.1085.0',\n '@aws-smithy/server-apigateway': '1.0.0-alpha.10',\n '@aws-smithy/server-node': '1.0.0-alpha.10',\n '@aws-lambda-powertools/logger': '2.34.0',\n '@aws-lambda-powertools/metrics': '2.34.0',\n '@aws-lambda-powertools/parameters': '2.34.0',\n '@aws-lambda-powertools/tracer': '2.34.0',\n '@aws-lambda-powertools/parser': '2.34.0',\n '@aws-sdk/client-appconfigdata': '3.1085.0',\n '@middy/core': '7.7.0',\n '@nxlv/python': '22.2.1',\n '@nx-extend/terraform': '10.3.0',\n '@nx/devkit': '23.1.0',\n '@nx/react': '23.1.0',\n 'create-nx-workspace': '23.1.0',\n '@swc-node/register': '1.11.1',\n '@swc/core': '1.15.43',\n '@modelcontextprotocol/sdk': '1.29.0',\n '@modelcontextprotocol/inspector': '0.22.0',\n '@ag-ui/aws-strands': '0.2.3',\n '@ag-ui/client': '0.0.57',\n '@ag-ui/core': '0.0.57',\n '@ag-ui/encoder': '0.0.57',\n 'agent-chat-cli': '0.3.0',\n '@copilotkit/react-core': '1.62.3',\n rxjs: '7.8.2',\n '@strands-agents/sdk': '1.9.0',\n '@tanstack/react-router': '1.170.17',\n '@tanstack/router-plugin': '1.168.19',\n '@tanstack/router-generator': '1.167.18',\n '@tanstack/virtual-file-routes': '1.162.0',\n '@tanstack/router-utils': '1.162.2',\n '@cloudscape-design/board-components': '3.0.201',\n '@cloudscape-design/chat-components': '1.0.149',\n '@cloudscape-design/components': '3.0.1325',\n '@cloudscape-design/global-styles': '1.0.62',\n '@tanstack/react-query': '5.101.2',\n '@tanstack/react-query-devtools': '5.101.2',\n '@trpc/tanstack-react-query': '11.18.0',\n '@trpc/client': '11.18.0',\n '@trpc/server': '11.18.0',\n '@types/node': '26.1.1',\n '@types/aws-lambda': '8.10.162',\n '@types/cors': '2.8.19',\n '@types/pg': '8.20.0',\n '@types/ws': '8.18.1',\n '@types/express': '5.0.6',\n '@smithy/config-resolver': '4.6.8',\n '@smithy/node-config-provider': '4.5.8',\n '@smithy/node-http-handler': '4.9.5',\n '@smithy/types': '4.16.1',\n '@vitest/coverage-v8': '4.1.10',\n '@vitest/ui': '4.1.10',\n '@astrojs/react': '6.0.1',\n '@astrojs/starlight': '0.41.3',\n astro: '7.0.7',\n aws4fetch: '1.0.20',\n 'aws-cdk': '2.1130.0',\n 'aws-cdk-lib': '2.261.0',\n 'aws-xray-sdk-core': '3.12.0',\n constructs: '10.6.0',\n cors: '2.8.6',\n chalk: '5.6.2',\n 'class-variance-authority': '0.7.1',\n clsx: '2.1.1',\n commander: '15.0.0',\n electrodb: '3.9.1',\n esbuild: '0.28.1',\n 'event-source-polyfill': '1.0.31',\n '@types/event-source-polyfill': '1.0.5',\n '@biomejs/biome': '2.5.3',\n '@prisma/adapter-mariadb': '7.8.0',\n '@prisma/adapter-pg': '7.8.0',\n '@prisma/client': '7.8.0',\n ejs: '6.0.1',\n '@types/ejs': '3.1.5',\n express: '5.2.1',\n 'fast-glob': '3.3.3',\n husky: '9.1.7',\n 'fs-extra': '11.3.6',\n '@types/fs-extra': '11.0.4',\n 'make-dir-cli': '4.0.0',\n mariadb: '3.5.3',\n ncp: '2.0.0',\n npm: '12.0.1',\n 'npm-check-updates': '22.2.9',\n 'oidc-client-ts': '3.5.0',\n pg: '8.22.0',\n prisma: '7.8.0',\n 'react-oidc-context': '3.3.1',\n react: '19.2.7',\n 'react-dom': '19.2.7',\n rimraf: '6.1.3',\n rolldown: '1.1.5',\n 'simple-git': '3.36.0',\n 'source-map-support': '0.5.21',\n 'starlight-blog': '0.28.0',\n tailwindcss: '4.3.2',\n '@tailwindcss/vite': '4.3.2',\n tsx: '4.23.0',\n 'lucide-react': '1.24.0',\n 'radix-ui': '1.6.2',\n shadcn: '4.13.0',\n 'tw-animate-css': '1.4.0',\n 'tailwind-merge': '3.6.0',\n vite: '8.1.4',\n typescript: '6.0.3',\n vitest: '4.1.10',\n zod: '4.4.3',\n ws: '8.21.0',\n} as const;\nexport type ITsDepVersion = keyof typeof TS_VERSIONS;\n\n/**\n * Add versions to the given dependencies\n */\nexport const withVersions = (deps: ITsDepVersion[]) =>\n Object.fromEntries(deps.map((dep) => [dep, TS_VERSIONS[dep]]));\n\n/**\n * Versions for Python dependencies added by generators\n */\nexport const PY_VERSIONS = {\n 'a2a-sdk': '==0.3.26',\n 'ag-ui-langgraph': '==0.0.42',\n 'ag-ui-protocol': '==0.1.19',\n 'ag-ui-strands': '==0.2.2',\n 'aws-lambda-powertools': '==3.31.0',\n 'aws-lambda-powertools[tracer]': '==3.31.0',\n 'aws-lambda-powertools[parser]': '==3.31.0',\n 'aws-opentelemetry-distro': '==0.18.0',\n 'bedrock-agentcore': '==1.18.0',\n boto3: '==1.43.46',\n checkov: '==3.3.8',\n fastapi: '==0.139.0',\n 'fastapi[standard]': '==0.139.0',\n httpx: '==0.28.1',\n langchain: '==1.3.13',\n 'langchain-aws': '==1.6.2',\n 'langchain-mcp-adapters': '==0.3.0',\n langgraph: '==1.2.9',\n mcp: '==1.28.1',\n 'pip-check-updates': '==0.29.0',\n 'pip-licenses': '==5.5.5',\n 'strands-agents': '==1.47.0',\n 'strands-agents[a2a]': '==1.47.0',\n 'strands-agents-tools': '==0.8.3',\n ty: '==0.0.59',\n pynamodb: '==6.1.0',\n uvicorn: '==0.51.0',\n sqlmodel: '==0.0.38',\n alembic: '==1.18.4',\n aiomysql: '==0.3.2',\n asyncpg: '==0.31.0',\n} as const;\nexport type IPyDepVersion = keyof typeof PY_VERSIONS;\n\n/**\n * Add versions to the given dependencies\n */\nexport const withPyVersions = (deps: IPyDepVersion[]) =>\n deps.map((dep) => `${dep}${PY_VERSIONS[dep]}`);\n\n/**\n * Versions for vendored tools\n */\nexport const VENDORED_VERSIONS = {\n 'git-secrets': '1.3.0',\n} as const;\n\n/**\n * Base container images used by generated Dockerfiles. Pinned exactly so\n * generated images are reproducible, and chosen to be free of known\n * HIGH/CRITICAL vulnerabilities at time of generation.\n */\nexport const BASE_IMAGES = {\n node: 'public.ecr.aws/docker/library/node:lts-slim',\n python: 'public.ecr.aws/docker/library/python:3.14-slim',\n} as const;\n\n/**\n * Versions for container tooling used by generated image build/scan targets.\n * Pinned exactly so generated images are reproducible.\n */\nexport const CONTAINER_VERSIONS = {\n // ECR-hosted Trivy image used to scan built images during the build.\n trivy: '0.72.0',\n} as const;\n\n/**\n * Exact versions for Terraform providers used by generated `.tf` modules.\n * Pinned exactly (no range operator) so generated infrastructure is reproducible.\n */\nexport const TERRAFORM_VERSIONS = {\n aws: '6.54.0',\n random: '3.9.0',\n null: '3.3.0',\n archive: '2.8.0',\n external: '2.4.0',\n local: '2.9.0',\n} as const;\nexport type ITerraformProviderVersion = keyof typeof TERRAFORM_VERSIONS;\n\n/**\n * Substitution variables exposing Terraform provider version constraints to\n * generated `.tf` templates (e.g. `version = \"<%- awsProviderVersion %>\"`)\n */\nexport const terraformProviderVersions = () => ({\n awsProviderVersion: TERRAFORM_VERSIONS.aws,\n randomProviderVersion: TERRAFORM_VERSIONS.random,\n nullProviderVersion: TERRAFORM_VERSIONS.null,\n archiveProviderVersion: TERRAFORM_VERSIONS.archive,\n externalProviderVersion: TERRAFORM_VERSIONS.external,\n localProviderVersion: TERRAFORM_VERSIONS.local,\n});\n"],"names":["TS_VERSIONS","rxjs","astro","aws4fetch","constructs","cors","chalk","clsx","commander","electrodb","esbuild","ejs","express","husky","mariadb","ncp","npm","pg","prisma","react","rimraf","rolldown","tailwindcss","tsx","shadcn","vite","typescript","vitest","zod","ws","withVersions","deps","Object","fromEntries","map","dep","PY_VERSIONS","boto3","checkov","fastapi","httpx","langchain","langgraph","mcp","ty","pynamodb","uvicorn","sqlmodel","alembic","aiomysql","asyncpg","withPyVersions","VENDORED_VERSIONS","BASE_IMAGES","node","python","CONTAINER_VERSIONS","trivy","TERRAFORM_VERSIONS","aws","random","null","archive","external","local","terraformProviderVersions","awsProviderVersion","randomProviderVersion","nullProviderVersion","archiveProviderVersion","externalProviderVersion","localProviderVersion"],"mappings":"AAAA;;;CAGC,GAED;;CAEC,GACD,OAAO,MAAMA,cAAc;IACzB,eAAe;IACf,0DAA0D;IAC1D,4BAA4B;IAC5B,mCAAmC;IACnC,sBAAsB;IACtB,uBAAuB;IACvB,iCAAiC;IACjC,iDAAiD;IACjD,mCAAmC;IACnC,uBAAuB;IACvB,iCAAiC;IACjC,2BAA2B;IAC3B,iCAAiC;IACjC,kCAAkC;IAClC,qCAAqC;IACrC,iCAAiC;IACjC,iCAAiC;IACjC,iCAAiC;IACjC,eAAe;IACf,gBAAgB;IAChB,wBAAwB;IACxB,cAAc;IACd,aAAa;IACb,uBAAuB;IACvB,sBAAsB;IACtB,aAAa;IACb,6BAA6B;IAC7B,mCAAmC;IACnC,sBAAsB;IACtB,iBAAiB;IACjB,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,0BAA0B;IAC1BC,MAAM;IACN,uBAAuB;IACvB,0BAA0B;IAC1B,2BAA2B;IAC3B,8BAA8B;IAC9B,iCAAiC;IACjC,0BAA0B;IAC1B,uCAAuC;IACvC,sCAAsC;IACtC,iCAAiC;IACjC,oCAAoC;IACpC,yBAAyB;IACzB,kCAAkC;IAClC,8BAA8B;IAC9B,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;IACf,qBAAqB;IACrB,eAAe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