@yuuvis/client-cli 19.1.1 → 19.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +3 -1
  2. package/cli/commands/generate/app.js +22 -0
  3. package/cli/commands/generate/app.js.map +1 -1
  4. package/cli/options/options-generate-app.json +9 -1
  5. package/cli/utils.js +5 -2
  6. package/cli/utils.js.map +1 -1
  7. package/package.json +1 -1
  8. package/schematics/app-manifest.d.ts +33 -0
  9. package/schematics/app-manifest.js +6 -0
  10. package/schematics/app-manifest.js.map +1 -1
  11. package/schematics/commands/angular-json.d.ts +122 -0
  12. package/schematics/commands/angular-json.js +228 -0
  13. package/schematics/commands/angular-json.js.map +1 -0
  14. package/schematics/commands/app-config-ts.d.ts +11 -0
  15. package/schematics/commands/app-config-ts.js +44 -0
  16. package/schematics/commands/app-config-ts.js.map +1 -0
  17. package/schematics/commands/app-routes-ts.d.ts +12 -0
  18. package/schematics/commands/app-routes-ts.js +72 -0
  19. package/schematics/commands/app-routes-ts.js.map +1 -0
  20. package/schematics/commands/library-component.d.ts +25 -0
  21. package/schematics/commands/library-component.js +71 -0
  22. package/schematics/commands/library-component.js.map +1 -0
  23. package/schematics/commands/ng-package-json.d.ts +67 -0
  24. package/schematics/commands/ng-package-json.js +102 -0
  25. package/schematics/commands/ng-package-json.js.map +1 -0
  26. package/schematics/commands/package-json.d.ts +102 -0
  27. package/schematics/commands/package-json.js +158 -0
  28. package/schematics/commands/package-json.js.map +1 -0
  29. package/schematics/commands/public-api-ts.d.ts +68 -0
  30. package/schematics/commands/public-api-ts.js +102 -0
  31. package/schematics/commands/public-api-ts.js.map +1 -0
  32. package/schematics/commands/tsconfig-json.d.ts +71 -0
  33. package/schematics/commands/tsconfig-json.js +118 -0
  34. package/schematics/commands/tsconfig-json.js.map +1 -0
  35. package/schematics/commands/typescript-file.d.ts +64 -0
  36. package/schematics/commands/typescript-file.js +127 -0
  37. package/schematics/commands/typescript-file.js.map +1 -0
  38. package/schematics/factories/add-app/index.js +6 -5
  39. package/schematics/factories/add-app/index.js.map +1 -1
  40. package/schematics/factories/generate-app/index.js +113 -65
  41. package/schematics/factories/generate-app/index.js.map +1 -1
  42. package/schematics/factories/generate-app/schema.json +10 -0
  43. package/schematics/factories/new/index.js +100 -39
  44. package/schematics/factories/new/index.js.map +1 -1
  45. package/schematics/files/_root/README.md +8 -0
  46. package/schematics/files/_scripts/update-shell.js +18 -0
  47. package/schematics/files/_src/styles.scss +4 -3
  48. package/schematics/files/_src_app/app.routes.ts.template +1 -1
  49. package/schematics/patches/impl/0001.patch.js +4 -15
  50. package/schematics/patches/impl/0001.patch.js.map +1 -1
  51. package/schematics/project-util.d.ts +1 -1
  52. package/schematics/project-util.js +1 -0
  53. package/schematics/project-util.js.map +1 -1
  54. package/schematics/rules/app-config.d.ts +2 -0
  55. package/schematics/{tasks/copy-ui-files.js → rules/app-config.js} +13 -14
  56. package/schematics/rules/app-config.js.map +1 -0
  57. package/schematics/{tasks/update-app-routes.d.ts → rules/app-routes.d.ts} +1 -1
  58. package/schematics/{tasks/copy-extensions-files.js → rules/app-routes.js} +13 -14
  59. package/schematics/rules/app-routes.js.map +1 -0
  60. package/schematics/{tasks → rules}/clean-up-ng-app.js.map +1 -1
  61. package/schematics/{tasks/copy-extensions-files.d.ts → rules/copy-resources.d.ts} +2 -0
  62. package/schematics/{tasks/copy-files.js → rules/copy-resources.js} +31 -3
  63. package/schematics/rules/copy-resources.js.map +1 -0
  64. package/schematics/rules/create-update-manifest.d.ts +3 -0
  65. package/schematics/{tasks → rules}/create-update-manifest.js +2 -2
  66. package/schematics/rules/create-update-manifest.js.map +1 -0
  67. package/schematics/{tasks → rules}/generate-library.js.map +1 -1
  68. package/schematics/{tasks → rules}/ng-new.js.map +1 -1
  69. package/schematics/{tasks → rules}/npm-install.js.map +1 -1
  70. package/schematics/schematics-util.d.ts +1 -2
  71. package/schematics/schematics-util.js +0 -13
  72. package/schematics/schematics-util.js.map +1 -1
  73. package/schematics/types/ng-package-json.d.ts +93 -0
  74. package/schematics/types/ng-package-json.js +3 -0
  75. package/schematics/types/ng-package-json.js.map +1 -0
  76. package/schematics/{types.d.ts → types/package-json.d.ts} +3 -0
  77. package/schematics/{types.js → types/package-json.js} +1 -1
  78. package/schematics/types/package-json.js.map +1 -0
  79. package/schematics/types/tsconfig-json.d.ts +69 -0
  80. package/schematics/types/tsconfig-json.js +3 -0
  81. package/schematics/types/tsconfig-json.js.map +1 -0
  82. package/schematics/tasks/copy-extensions-files.js.map +0 -1
  83. package/schematics/tasks/copy-files.d.ts +0 -2
  84. package/schematics/tasks/copy-files.js.map +0 -1
  85. package/schematics/tasks/copy-ui-files.d.ts +0 -2
  86. package/schematics/tasks/copy-ui-files.js.map +0 -1
  87. package/schematics/tasks/create-update-manifest.d.ts +0 -4
  88. package/schematics/tasks/create-update-manifest.js.map +0 -1
  89. package/schematics/tasks/update-angular-json.d.ts +0 -4
  90. package/schematics/tasks/update-angular-json.js +0 -105
  91. package/schematics/tasks/update-angular-json.js.map +0 -1
  92. package/schematics/tasks/update-app-config.d.ts +0 -2
  93. package/schematics/tasks/update-app-config.js +0 -69
  94. package/schematics/tasks/update-app-config.js.map +0 -1
  95. package/schematics/tasks/update-app-ng-package-json.d.ts +0 -2
  96. package/schematics/tasks/update-app-ng-package-json.js +0 -71
  97. package/schematics/tasks/update-app-ng-package-json.js.map +0 -1
  98. package/schematics/tasks/update-app-routes.js +0 -87
  99. package/schematics/tasks/update-app-routes.js.map +0 -1
  100. package/schematics/tasks/update-library-component.d.ts +0 -2
  101. package/schematics/tasks/update-library-component.js +0 -108
  102. package/schematics/tasks/update-library-component.js.map +0 -1
  103. package/schematics/tasks/update-library-public-api.d.ts +0 -2
  104. package/schematics/tasks/update-library-public-api.js +0 -38
  105. package/schematics/tasks/update-library-public-api.js.map +0 -1
  106. package/schematics/tasks/update-library-tsconfig.d.ts +0 -2
  107. package/schematics/tasks/update-library-tsconfig.js +0 -51
  108. package/schematics/tasks/update-library-tsconfig.js.map +0 -1
  109. package/schematics/tasks/update-package-json.d.ts +0 -2
  110. package/schematics/tasks/update-package-json.js +0 -32
  111. package/schematics/tasks/update-package-json.js.map +0 -1
  112. package/schematics/types.js.map +0 -1
  113. /package/schematics/{tasks → rules}/clean-up-ng-app.d.ts +0 -0
  114. /package/schematics/{tasks → rules}/clean-up-ng-app.js +0 -0
  115. /package/schematics/{tasks → rules}/generate-library.d.ts +0 -0
  116. /package/schematics/{tasks → rules}/generate-library.js +0 -0
  117. /package/schematics/{tasks → rules}/ng-new.d.ts +0 -0
  118. /package/schematics/{tasks → rules}/ng-new.js +0 -0
  119. /package/schematics/{tasks → rules}/npm-install.d.ts +0 -0
  120. /package/schematics/{tasks → rules}/npm-install.js +0 -0
package/README.md CHANGED
@@ -62,7 +62,9 @@ yuv g a <name> [options]
62
62
  `<name>`: The name of the app.
63
63
 
64
64
  #### Options
65
+ - `--app-header`: Use the shell's app header layout.
65
66
  - `--app-id`: The ID of the app.
67
+ - `--hide-from-nav`: Do not show the app icon i the navigation bar.
66
68
  - `--prefix`: A prefix to apply to generated selectors.
67
69
  - `--route`: The route under which the app is registered in the client.
68
70
  - `--skip-extension`: Do not create extension for the app.
@@ -99,7 +101,7 @@ Lists all available patches.
99
101
  yuv patch list
100
102
 
101
103
  # short form
102
- yuv p l <patchID>
104
+ yuv p l
103
105
  ```
104
106
 
105
107
  ### patch apply
@@ -60,6 +60,28 @@ const handler = (argv) => __awaiter(void 0, void 0, void 0, function* () {
60
60
  ]);
61
61
  argv.prefix = response.prefix;
62
62
  }
63
+ if (argv.appHeader === undefined) {
64
+ const { appHeader } = yield inquirer_1.default.prompt([
65
+ {
66
+ type: "confirm",
67
+ name: "appHeader",
68
+ default: false,
69
+ message: "Should the app use shell's app header?",
70
+ },
71
+ ]);
72
+ argv.appHeader = argv['app-header'] = appHeader;
73
+ }
74
+ if (argv.hideFromNav === undefined) {
75
+ const { hideFromNav } = yield inquirer_1.default.prompt([
76
+ {
77
+ type: "confirm",
78
+ name: "hideFromNav",
79
+ default: false,
80
+ message: "Should the app be hidden from navigation bar?",
81
+ },
82
+ ]);
83
+ argv.hideFromNav = argv['hide-from-nav'] = hideFromNav;
84
+ }
63
85
  (0, child_process_1.execSync)(`${(0, utils_1.getSchematicsBin)()} @yuuvis/client-cli:generate-app ${(0, utils_1.serializeOptions)(argv)}`, {
64
86
  cwd: process.cwd(),
65
87
  stdio: "inherit",
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../../../src/cli/commands/generate/app.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,wDAAgC;AAChC,iDAAyC;AACzC,uCAAiE;AACjE,wGAA8D;AAC9D,qDAA6D;AAEhD,QAAA,OAAO,GAAW,YAAY,CAAC;AAC/B,QAAA,OAAO,GAAa,CAAC,GAAG,CAAC,CAAC;AAC1B,QAAA,IAAI,GAAW,mCAAmC,CAAC;AAEzD,MAAM,OAAO,GAA4B,CAAC,KAAU,EAAE,EAAE;IAC7D,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,mCAAO,CAAC,CAAC;AAC7D,CAAC,CAAC;AAFW,QAAA,OAAO,WAElB;AAEK,MAAM,OAAO,GAAG,CAAO,IAAS,EAAE,EAAE;IACzC,MAAM,iBAAiB,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEtD,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAChB,MAAM,QAAQ,GAAG,MAAM,kBAAQ,CAAC,MAAM,CAAC;YACrC;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,eAAe,iBAAiB,CAAC,SAAS,EAAE;gBACrD,OAAO,EAAE,qBAAqB;aAC/B;SACF,CAAC,CAAC;QACH,IAAI,CAAC,KAAK,GAAG,IAAI,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+ "describe": "Use shell's app header layout.",
20
+ "type": "boolean"
21
+ },
22
+ "hide-from-nav": {
23
+ "describe": "Hide the app from the navigation bar.",
24
+ "type": "boolean"
17
25
  }
18
- }
26
+ }
package/cli/utils.js CHANGED
@@ -16,8 +16,11 @@ function serializeOptions(options) {
16
16
  .filter(([key]) => key !== '_' && key !== '$0') // delete yargs internal keys
17
17
  .filter(([key]) => key === key.toLowerCase()) // keep only lowercase keys
18
18
  .map(([key, value]) => {
19
- if (typeof value === 'boolean')
20
- return `--${key}`; // keep boolean properties only if true
19
+ if (typeof value === 'boolean') {
20
+ if (value)
21
+ return `--${key}`; // boolean properties are just flags
22
+ return ''; // skip false boolean properties
23
+ }
21
24
  return `--${key}="${value}"`; // string properties strait forward
22
25
  })
23
26
  .join(' ');
package/cli/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/cli/utils.ts"],"names":[],"mappings":";;AAEA,4CAEC;AAOD,4CASC;AApBD,+BAA4B;AAE5B,SAAgB,gBAAgB;IAC9B,OAAO,IAAA,WAAI,EAAC,SAAS,EAAE,iCAAiC,CAAC,CAAC;AAC5D,CAAC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,OAAY;IAC3C,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;SAC7B,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,6BAA6B;SAC1E,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,WAAW,EAAE,CAAC,CAAE,2BAA2B;SACzE,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAClB,IAAI,OAAO,KAAK,KAAK,SAAS;YAAE,OAAO,KAAK,GAAG,EAAE,CAAC,CAAC,wCAAwC;QAC3F,OAAO,KAAK,GAAG,KAAK,KAAK,GAAG,CAAC,CAAC,mCAAmC;IACrE,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/cli/utils.ts"],"names":[],"mappings":";;AAEA,4CAEC;AAOD,4CAYC;AAvBD,+BAA4B;AAE5B,SAAgB,gBAAgB;IAC9B,OAAO,IAAA,WAAI,EAAC,SAAS,EAAE,iCAAiC,CAAC,CAAC;AAC5D,CAAC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,OAAY;IAC3C,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;SAC7B,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,6BAA6B;SAC1E,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,WAAW,EAAE,CAAC,CAAE,2BAA2B;SACzE,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAClB,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;YAC/B,IAAI,KAAK;gBAAE,OAAO,KAAK,GAAG,EAAE,CAAC,CAAC,oCAAoC;YAClE,OAAO,EAAE,CAAC,CAAC,gCAAgC;QAC7C,CAAC;QACD,OAAO,KAAK,GAAG,KAAK,KAAK,GAAG,CAAC,CAAC,mCAAmC;IACrE,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuuvis/client-cli",
3
- "version": "19.1.1",
3
+ "version": "19.3.0",
4
4
  "main": "index.js",
5
5
  "schematics": "./schematics/factories/collection.json",
6
6
  "bin": {
@@ -7,14 +7,37 @@ declare const ManifestSchema: z.ZodObject<{
7
7
  svgIcon: z.ZodOptional<z.ZodString>;
8
8
  iconName: z.ZodOptional<z.ZodString>;
9
9
  routes: z.ZodString;
10
+ options: z.ZodOptional<z.ZodObject<{
11
+ appClaim: z.ZodOptional<z.ZodString>;
12
+ appHeader: z.ZodOptional<z.ZodBoolean>;
13
+ hideFromNav: z.ZodOptional<z.ZodBoolean>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ appHeader?: boolean | undefined;
16
+ hideFromNav?: boolean | undefined;
17
+ appClaim?: string | undefined;
18
+ }, {
19
+ appHeader?: boolean | undefined;
20
+ hideFromNav?: boolean | undefined;
21
+ appClaim?: string | undefined;
22
+ }>>;
10
23
  }, "strip", z.ZodTypeAny, {
11
24
  path: string;
12
25
  routes: string;
26
+ options?: {
27
+ appHeader?: boolean | undefined;
28
+ hideFromNav?: boolean | undefined;
29
+ appClaim?: string | undefined;
30
+ } | undefined;
13
31
  svgIcon?: string | undefined;
14
32
  iconName?: string | undefined;
15
33
  }, {
16
34
  path: string;
17
35
  routes: string;
36
+ options?: {
37
+ appHeader?: boolean | undefined;
38
+ hideFromNav?: boolean | undefined;
39
+ appClaim?: string | undefined;
40
+ } | undefined;
18
41
  svgIcon?: string | undefined;
19
42
  iconName?: string | undefined;
20
43
  }>>;
@@ -25,6 +48,11 @@ declare const ManifestSchema: z.ZodObject<{
25
48
  ui?: {
26
49
  path: string;
27
50
  routes: string;
51
+ options?: {
52
+ appHeader?: boolean | undefined;
53
+ hideFromNav?: boolean | undefined;
54
+ appClaim?: string | undefined;
55
+ } | undefined;
28
56
  svgIcon?: string | undefined;
29
57
  iconName?: string | undefined;
30
58
  } | undefined;
@@ -35,6 +63,11 @@ declare const ManifestSchema: z.ZodObject<{
35
63
  ui?: {
36
64
  path: string;
37
65
  routes: string;
66
+ options?: {
67
+ appHeader?: boolean | undefined;
68
+ hideFromNav?: boolean | undefined;
69
+ appClaim?: string | undefined;
70
+ } | undefined;
38
71
  svgIcon?: string | undefined;
39
72
  iconName?: string | undefined;
40
73
  } | undefined;
@@ -7,11 +7,17 @@ exports.parseManifest = parseManifest;
7
7
  exports.writeManifest = writeManifest;
8
8
  const fs_1 = __importDefault(require("fs"));
9
9
  const zod_1 = require("zod");
10
+ const UiOptions = zod_1.z.object({
11
+ appClaim: zod_1.z.string().optional(),
12
+ appHeader: zod_1.z.boolean().optional(),
13
+ hideFromNav: zod_1.z.boolean().optional()
14
+ });
10
15
  const UiData = zod_1.z.object({
11
16
  path: zod_1.z.string(),
12
17
  svgIcon: zod_1.z.string().optional(),
13
18
  iconName: zod_1.z.string().optional(),
14
19
  routes: zod_1.z.string(),
20
+ options: UiOptions.optional()
15
21
  });
16
22
  const ManifestSchema = zod_1.z.object({
17
23
  id: zod_1.z.string(),
@@ -1 +1 @@
1
- {"version":3,"file":"app-manifest.js","sourceRoot":"","sources":["../../src/schematics/app-manifest.ts"],"names":[],"mappings":";;;;;AAmBA,sCAGC;AAED,sCAMC;AA9BD,4CAAoB;AACpB,6BAAwB;AAExB,MAAM,MAAM,GAAG,OAAC,CAAC,MAAM,CAAC;IACtB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC;AAIH,SAAgB,aAAa,CAAC,OAAe;IAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC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CAAC,MAAM,EAAE;IACjB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC;AAIH,SAAgB,aAAa,CAAC,OAAe;IAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AACxC,CAAC;AAED,SAAgB,aAAa,CAAC,QAAgB,EAAE,QAAqB;IACnE,IAAI,CAAC;QACH,YAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,kCAAkC,KAAK,EAAE,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC"}
@@ -0,0 +1,122 @@
1
+ import { Tree } from "@angular-devkit/schematics";
2
+ export type ComponentStyle = 'css' | 'scss' | 'sass' | 'less' | 'styl' | 'stylus';
3
+ /**
4
+ * Interface for commands that can be executed on an angular.json object.
5
+ */
6
+ export interface AngularJsonCommand {
7
+ /**
8
+ * Executes the command on the provided angular.json object.
9
+ * @param angularJson The angular.json object to modify.
10
+ */
11
+ execute(angularJson: any): void;
12
+ }
13
+ /**
14
+ * Composite command that executes multiple AngularJsonCommand instances.
15
+ */
16
+ export declare class CompositeAngularJsonCommand implements AngularJsonCommand {
17
+ private readonly commands;
18
+ constructor(commands: AngularJsonCommand[]);
19
+ /**
20
+ * Executes all commands in the composite command.
21
+ * @param angularJson The angular.json object to modify.
22
+ */
23
+ execute(angularJson: any): void;
24
+ }
25
+ /**
26
+ * Adds build options assets for a specific project in angular.json.
27
+ */
28
+ export declare class AddBuildOptionsAssetsToProjectCommand implements AngularJsonCommand {
29
+ private readonly projectName;
30
+ private readonly assets;
31
+ constructor(projectName: string, assets: (string | object)[]);
32
+ execute(angularJson: any): void;
33
+ }
34
+ /**
35
+ * Adds build options scripts for a specific project in angular.json.
36
+ */
37
+ export declare class AddBuildOptionsScriptsToProjectCommand implements AngularJsonCommand {
38
+ private readonly projectName;
39
+ private readonly scripts;
40
+ constructor(projectName: string, scripts: string[]);
41
+ execute(angularJson: any): void;
42
+ }
43
+ /**
44
+ * Adds allowedCommonJsDependencies for a specific project in angular.json.
45
+ */
46
+ export declare class AdddAllowedCommonJsDependenciesToProjectCommand implements AngularJsonCommand {
47
+ private readonly projectName;
48
+ private readonly dependencies;
49
+ constructor(projectName: string, dependencies: string[]);
50
+ execute(angularJson: any): void;
51
+ }
52
+ /**
53
+ * Updates the initial budget for a specific project in angular.json.
54
+ */
55
+ export declare class UpdateInitialBudgetForProjectCommand implements AngularJsonCommand {
56
+ private readonly projectName;
57
+ private readonly budget;
58
+ constructor(projectName: string, budget: {
59
+ maximumWarning?: string;
60
+ maximumError?: string;
61
+ });
62
+ execute(angularJson: any): void;
63
+ }
64
+ /**
65
+ * Updates the file replacements for the development configuration of a specific project in angular.json.
66
+ */
67
+ export declare class UpdateDevFileReplacementsForProjectCommand implements AngularJsonCommand {
68
+ private readonly projectName;
69
+ private readonly fileReplacements;
70
+ constructor(projectName: string, fileReplacements: {
71
+ replace: string;
72
+ with: string;
73
+ }[]);
74
+ execute(angularJson: any): void;
75
+ }
76
+ /**
77
+ * Sets the style for Angular component schematic in a specific project in angular.json.
78
+ */
79
+ export declare class SetStyleForProjectCommand implements AngularJsonCommand {
80
+ private readonly projectName;
81
+ private readonly style;
82
+ constructor(projectName: string, style: ComponentStyle);
83
+ execute(angularJson: any): void;
84
+ }
85
+ /**
86
+ * Class for editing the angular.json file.
87
+ */
88
+ export declare class AngularJsonEditor {
89
+ private readonly tree;
90
+ private readonly path;
91
+ private constructor();
92
+ /**
93
+ * Creates a new AngularJsonEditor instance.
94
+ * @param tree The Angular DevKit Tree to operate on.
95
+ * @param path The path to the angular.json file. Defaults to 'angular.json'.
96
+ * @returns A Promise that resolves to a new AngularJsonEditor instance.
97
+ */
98
+ static create(tree: Tree, path?: string): Promise<AngularJsonEditor>;
99
+ /**
100
+ * Executes the given command on the angular.json file.
101
+ * @param command The command to execute on the angular.json file.
102
+ */
103
+ run(command: AngularJsonCommand): void;
104
+ /**
105
+ * Gets the content of the angular.json file.
106
+ * @returns The content of the angular.json file as an object.
107
+ */
108
+ getContent(): any;
109
+ /**
110
+ * Loads the angular.json file from the specified path.
111
+ * If the file does not exist or cannot be read, it throws a SchematicsException.
112
+ * @returns The angular.json object loaded from the file.
113
+ * @throws {SchematicsException} If the angular.json file does not exist or cannot be read.
114
+ */
115
+ private load;
116
+ /**
117
+ * Saves the angular.json file to the specified path.
118
+ * @param angularJson The angular.json object to save.
119
+ * This method overwrites the existing angular.json file with the provided object.
120
+ */
121
+ private save;
122
+ }
@@ -0,0 +1,228 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AngularJsonEditor = exports.SetStyleForProjectCommand = exports.UpdateDevFileReplacementsForProjectCommand = exports.UpdateInitialBudgetForProjectCommand = exports.AdddAllowedCommonJsDependenciesToProjectCommand = exports.AddBuildOptionsScriptsToProjectCommand = exports.AddBuildOptionsAssetsToProjectCommand = exports.CompositeAngularJsonCommand = void 0;
13
+ const schematics_1 = require("@angular-devkit/schematics");
14
+ const project_util_1 = require("../project-util");
15
+ /**
16
+ * Composite command that executes multiple AngularJsonCommand instances.
17
+ */
18
+ class CompositeAngularJsonCommand {
19
+ constructor(commands) {
20
+ this.commands = commands;
21
+ }
22
+ /**
23
+ * Executes all commands in the composite command.
24
+ * @param angularJson The angular.json object to modify.
25
+ */
26
+ execute(angularJson) {
27
+ this.commands.forEach(command => command.execute(angularJson));
28
+ }
29
+ }
30
+ exports.CompositeAngularJsonCommand = CompositeAngularJsonCommand;
31
+ /**
32
+ * Adds build options assets for a specific project in angular.json.
33
+ */
34
+ class AddBuildOptionsAssetsToProjectCommand {
35
+ constructor(projectName, assets) {
36
+ this.projectName = projectName;
37
+ this.assets = assets;
38
+ }
39
+ execute(angularJson) {
40
+ var _a, _b;
41
+ const project = getProject(angularJson, this.projectName);
42
+ const buildOptions = (_b = (_a = project.architect) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.options;
43
+ if (!buildOptions.assets) {
44
+ buildOptions.assets = [];
45
+ }
46
+ buildOptions.assets.push(...this.assets);
47
+ }
48
+ }
49
+ exports.AddBuildOptionsAssetsToProjectCommand = AddBuildOptionsAssetsToProjectCommand;
50
+ /**
51
+ * Adds build options scripts for a specific project in angular.json.
52
+ */
53
+ class AddBuildOptionsScriptsToProjectCommand {
54
+ constructor(projectName, scripts) {
55
+ this.projectName = projectName;
56
+ this.scripts = scripts;
57
+ }
58
+ execute(angularJson) {
59
+ var _a, _b;
60
+ const project = getProject(angularJson, this.projectName);
61
+ const buildOptions = (_b = (_a = project.architect) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.options;
62
+ if (!buildOptions.scripts) {
63
+ buildOptions.scripts = [];
64
+ }
65
+ buildOptions.scripts.push(...this.scripts);
66
+ }
67
+ }
68
+ exports.AddBuildOptionsScriptsToProjectCommand = AddBuildOptionsScriptsToProjectCommand;
69
+ /**
70
+ * Adds allowedCommonJsDependencies for a specific project in angular.json.
71
+ */
72
+ class AdddAllowedCommonJsDependenciesToProjectCommand {
73
+ constructor(projectName, dependencies) {
74
+ this.projectName = projectName;
75
+ this.dependencies = dependencies;
76
+ }
77
+ execute(angularJson) {
78
+ var _a, _b;
79
+ const project = getProject(angularJson, this.projectName);
80
+ const buildOptions = (_b = (_a = project.architect) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.options;
81
+ if (!buildOptions.allowedCommonJsDependencies) {
82
+ buildOptions.allowedCommonJsDependencies = [];
83
+ }
84
+ buildOptions.allowedCommonJsDependencies.push(...this.dependencies);
85
+ }
86
+ }
87
+ exports.AdddAllowedCommonJsDependenciesToProjectCommand = AdddAllowedCommonJsDependenciesToProjectCommand;
88
+ /**
89
+ * Updates the initial budget for a specific project in angular.json.
90
+ */
91
+ class UpdateInitialBudgetForProjectCommand {
92
+ constructor(projectName, budget) {
93
+ this.projectName = projectName;
94
+ this.budget = budget;
95
+ }
96
+ execute(angularJson) {
97
+ var _a, _b;
98
+ const project = getProject(angularJson, this.projectName);
99
+ const budgets = (_b = (_a = project.architect) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.configurations.production.budgets;
100
+ const initialBudget = budgets.find((b) => b.type === 'initial');
101
+ if (initialBudget) {
102
+ ['maximumWarning', 'maximumError'].forEach(key => {
103
+ if (this.budget[key] !== undefined) {
104
+ initialBudget[key] = this.budget[key];
105
+ }
106
+ });
107
+ }
108
+ }
109
+ }
110
+ exports.UpdateInitialBudgetForProjectCommand = UpdateInitialBudgetForProjectCommand;
111
+ ;
112
+ /**
113
+ * Updates the file replacements for the development configuration of a specific project in angular.json.
114
+ */
115
+ class UpdateDevFileReplacementsForProjectCommand {
116
+ constructor(projectName, fileReplacements) {
117
+ this.projectName = projectName;
118
+ this.fileReplacements = fileReplacements;
119
+ }
120
+ execute(angularJson) {
121
+ var _a, _b, _c;
122
+ const project = getProject(angularJson, this.projectName);
123
+ const devConfig = (_c = (_b = (_a = project.architect) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.configurations) === null || _c === void 0 ? void 0 : _c.development;
124
+ if (!devConfig) {
125
+ throw new schematics_1.SchematicsException(`Development configuration not found for project "${this.projectName}" in angular.json.`);
126
+ }
127
+ if (!devConfig.fileReplacements) {
128
+ devConfig.fileReplacements = [];
129
+ }
130
+ devConfig.fileReplacements.push(...this.fileReplacements);
131
+ }
132
+ }
133
+ exports.UpdateDevFileReplacementsForProjectCommand = UpdateDevFileReplacementsForProjectCommand;
134
+ /**
135
+ * Sets the style for Angular component schematic in a specific project in angular.json.
136
+ */
137
+ class SetStyleForProjectCommand {
138
+ constructor(projectName, style) {
139
+ this.projectName = projectName;
140
+ this.style = style;
141
+ }
142
+ execute(angularJson) {
143
+ var _a;
144
+ const componentSchematicsKey = '@schematics/angular:component';
145
+ const project = getProject(angularJson, this.projectName);
146
+ const schematics = project.schematics || {};
147
+ schematics[componentSchematicsKey] = Object.assign(Object.assign({}, ((_a = schematics[componentSchematicsKey]) !== null && _a !== void 0 ? _a : {})), { style: this.style });
148
+ project.schematics = schematics;
149
+ }
150
+ }
151
+ exports.SetStyleForProjectCommand = SetStyleForProjectCommand;
152
+ /**
153
+ * Class for editing the angular.json file.
154
+ */
155
+ class AngularJsonEditor {
156
+ constructor(tree, path) {
157
+ this.tree = tree;
158
+ this.path = path;
159
+ }
160
+ /**
161
+ * Creates a new AngularJsonEditor instance.
162
+ * @param tree The Angular DevKit Tree to operate on.
163
+ * @param path The path to the angular.json file. Defaults to 'angular.json'.
164
+ * @returns A Promise that resolves to a new AngularJsonEditor instance.
165
+ */
166
+ static create(tree, path) {
167
+ return __awaiter(this, void 0, void 0, function* () {
168
+ const angularJsonPath = path !== null && path !== void 0 ? path : yield (0, project_util_1.getAngularJsonPath)(tree);
169
+ return new AngularJsonEditor(tree, angularJsonPath);
170
+ });
171
+ }
172
+ /**
173
+ * Executes the given command on the angular.json file.
174
+ * @param command The command to execute on the angular.json file.
175
+ */
176
+ run(command) {
177
+ const angularJson = this.load();
178
+ command.execute(angularJson);
179
+ this.save(angularJson);
180
+ }
181
+ /**
182
+ * Gets the content of the angular.json file.
183
+ * @returns The content of the angular.json file as an object.
184
+ */
185
+ getContent() {
186
+ return this.load();
187
+ }
188
+ /**
189
+ * Loads the angular.json file from the specified path.
190
+ * If the file does not exist or cannot be read, it throws a SchematicsException.
191
+ * @returns The angular.json object loaded from the file.
192
+ * @throws {SchematicsException} If the angular.json file does not exist or cannot be read.
193
+ */
194
+ load() {
195
+ if (!this.tree.exists(this.path)) {
196
+ throw new schematics_1.SchematicsException(`angular.json not found at ${this.path}`);
197
+ }
198
+ const content = this.tree.read(this.path);
199
+ if (!content) {
200
+ throw new schematics_1.SchematicsException(`Failed to read angular.json at ${this.path}`);
201
+ }
202
+ return JSON.parse(content.toString());
203
+ }
204
+ /**
205
+ * Saves the angular.json file to the specified path.
206
+ * @param angularJson The angular.json object to save.
207
+ * This method overwrites the existing angular.json file with the provided object.
208
+ */
209
+ save(angularJson) {
210
+ this.tree.overwrite(this.path, JSON.stringify(angularJson, null, 2));
211
+ }
212
+ }
213
+ exports.AngularJsonEditor = AngularJsonEditor;
214
+ /**
215
+ * Retrieves a project from the angular.json file by its name.
216
+ * @param angularJson The angular.json object to search in.
217
+ * @param projectName The name of the project to retrieve.
218
+ * @returns The project object if found.
219
+ * @throws {SchematicsException} If the project is not found.
220
+ */
221
+ function getProject(angularJson, projectName) {
222
+ const project = angularJson.projects[projectName];
223
+ if (!project) {
224
+ throw new schematics_1.SchematicsException(`Project "${projectName}" not found in angular.json.`);
225
+ }
226
+ return project;
227
+ }
228
+ //# sourceMappingURL=angular-json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"angular-json.js","sourceRoot":"","sources":["../../../src/schematics/commands/angular-json.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2DAAuE;AACvE,kDAAqD;AAerD;;GAEG;AACH,MAAa,2BAA2B;IACtC,YAA6B,QAA8B;QAA9B,aAAQ,GA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,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,gCAAmB,CAAC,kCAAkC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/E,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACK,IAAI,CAAC,WAAgB;QAC3B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACvE,CAAC;CACF;AA1DD,8CA0DC;AAED;;;;;;KAMK;AACH,SAAS,UAAU,CAAC,WAAgB,EAAE,WAAmB;IACvD,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAClD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,gCAAmB,CAAC,YAAY,WAAW,8BAA8B,CAAC,CAAC;IACvF,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import ts from "typescript";
2
+ import { TypeScriptFileCommand } from "./typescript-file";
3
+ import { UpdateRecorder } from "@angular-devkit/schematics";
4
+ export interface AppConfigTsCommand extends TypeScriptFileCommand {
5
+ }
6
+ export declare class AddShellExtensionsImportCommand implements AppConfigTsCommand {
7
+ private readonly appId;
8
+ private readonly extensionsFileName;
9
+ constructor(appId: string, extensionsFileName: string);
10
+ execute(sourceFile: ts.SourceFile, recorder: UpdateRecorder, filePath: string): void;
11
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AddShellExtensionsImportCommand = void 0;
7
+ const typescript_1 = __importDefault(require("typescript"));
8
+ const schematics_1 = require("@angular-devkit/schematics");
9
+ const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
10
+ const change_1 = require("@schematics/angular/utility/change");
11
+ class AddShellExtensionsImportCommand {
12
+ constructor(appId, extensionsFileName) {
13
+ this.appId = appId;
14
+ this.extensionsFileName = extensionsFileName;
15
+ }
16
+ execute(sourceFile, recorder, filePath) {
17
+ const callExpressions = (0, ast_utils_1.findNodes)(sourceFile, typescript_1.default.SyntaxKind.CallExpression);
18
+ const importShellCall = callExpressions.find((node) => node.expression.getText() === 'importShellExtensions');
19
+ if (!importShellCall) {
20
+ throw new schematics_1.SchematicsException(`Could not find importShellExtensions([...]) in ${filePath}.`);
21
+ }
22
+ const argumentArray = importShellCall.arguments[0];
23
+ if (!typescript_1.default.isArrayLiteralExpression(argumentArray)) {
24
+ throw new schematics_1.SchematicsException(`importShellExtensions([...]) does not contain a valid array in ${filePath}.`);
25
+ }
26
+ // check if the entry already exists
27
+ if (argumentArray.elements.some(el => typescript_1.default.isObjectLiteralExpression(el) &&
28
+ el.properties.some(p => typescript_1.default.isPropertyAssignment(p) &&
29
+ p.name.getText() === 'id' &&
30
+ p.initializer.getText().replace(/['"]/g, '') === this.appId) &&
31
+ el.properties.some(p => typescript_1.default.isPropertyAssignment(p) &&
32
+ p.name.getText() === 'extension' &&
33
+ p.initializer.getText() === this.extensionsFileName))) {
34
+ return; // Entry already exists, nothing to do.
35
+ }
36
+ const insertPosition = argumentArray.elements.end;
37
+ const prefix = argumentArray.elements.length > 0 ? ',\n' : '\n';
38
+ const newObject = `{ id: '${this.appId}.extension', extension: ${this.extensionsFileName} }`;
39
+ const insertChange = new change_1.InsertChange(filePath, insertPosition, `${prefix}${newObject}`);
40
+ (0, change_1.applyToUpdateRecorder)(recorder, [insertChange]);
41
+ }
42
+ }
43
+ exports.AddShellExtensionsImportCommand = AddShellExtensionsImportCommand;
44
+ //# sourceMappingURL=app-config-ts.js.map
@@ -0,0 +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,WAAW,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,KAAK,CAC5D;YACD,EAAE,CAAC,UAAU,CAAC,IAAI,CAChB,CAAC,CAAC,EAAE,CAAC,oBAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;gBAC/B,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,WAAW;gBAChC,CAAC,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,kBAAkB,CACpD,CACF,EAAE,CAAC;YACF,OAAO,CAAC,uCAAuC;QACjD,CAAC;QAED,MAAM,cAAc,GAAG,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC;QAClD,MAAM,MAAM,GAAG,aAAa,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;QAChE,MAAM,SAAS,GAAG,UAAU,IAAI,CAAC,KAAK,2BAA2B,IAAI,CAAC,kBAAkB,IAAI,CAAC;QAC7F,MAAM,YAAY,GAAG,IAAI,qBAAY,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,MAAM,GAAG,SAAS,EAAE,CAAC,CAAC;QACzF,IAAA,8BAAqB,EAAC,QAAQ,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAClD,CAAC;CACF;AAzCD,0EAyCC"}
@@ -0,0 +1,12 @@
1
+ import { SchematicContext, UpdateRecorder } from "@angular-devkit/schematics";
2
+ import { TypeScriptFileCommand } from "./typescript-file";
3
+ import { AppManifest } from "../app-manifest";
4
+ import ts from "typescript";
5
+ export interface AppRoutesTsCommand extends TypeScriptFileCommand {
6
+ }
7
+ export declare class AddAppConfigurationCommand implements AppRoutesTsCommand {
8
+ private readonly appName;
9
+ private readonly appManifest;
10
+ constructor(appName: string, appManifest: AppManifest);
11
+ execute(sourceFile: ts.SourceFile, recorder: UpdateRecorder, filePath: string, context: SchematicContext): void;
12
+ }