slicejs-cli 4.3.0 → 4.5.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 (52) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +260 -257
  3. package/client.js +958 -823
  4. package/commands/Print.js +163 -163
  5. package/commands/Validations.js +92 -92
  6. package/commands/build/build.js +97 -107
  7. package/commands/buildProduction/buildProduction.js +613 -613
  8. package/commands/bundle/bundle.js +251 -239
  9. package/commands/createComponent/VisualComponentTemplate.js +55 -55
  10. package/commands/createComponent/createComponent.js +128 -128
  11. package/commands/deleteComponent/deleteComponent.js +81 -81
  12. package/commands/docs/docs.js +365 -365
  13. package/commands/doctor/doctor.js +730 -563
  14. package/commands/getComponent/getComponent.js +841 -842
  15. package/commands/init/init.js +526 -475
  16. package/commands/lint/lint.js +75 -0
  17. package/commands/lint/types.js +85 -0
  18. package/commands/listComponents/listComponents.js +172 -172
  19. package/commands/seo/check.js +94 -0
  20. package/commands/seo/images.js +641 -0
  21. package/commands/seo/sitemap.js +109 -0
  22. package/commands/seo/support.js +192 -0
  23. package/commands/setup/lint.js +151 -0
  24. package/commands/skill/skill.js +236 -236
  25. package/commands/startServer/startServer.js +240 -240
  26. package/commands/startServer/watchServer.js +66 -66
  27. package/commands/translator/check.js +32 -0
  28. package/commands/translator/init.js +125 -0
  29. package/commands/translator/scan.js +444 -0
  30. package/commands/typecheck/typecheck.js +83 -0
  31. package/commands/types/types.js +1378 -1097
  32. package/commands/utils/JsMinifier.js +230 -230
  33. package/commands/utils/LocalCliDelegation.js +78 -53
  34. package/commands/utils/PackageManager.js +148 -148
  35. package/commands/utils/PathHelper.js +87 -75
  36. package/commands/utils/ProjectValidation.js +274 -0
  37. package/commands/utils/SourceDiagnostics.js +201 -201
  38. package/commands/utils/VersionChecker.js +169 -169
  39. package/commands/utils/analyzeSource.js +77 -77
  40. package/commands/utils/bundling/BundleGenerator.js +3748 -3776
  41. package/commands/utils/bundling/DependencyAnalyzer.js +12 -2
  42. package/commands/utils/bundling/ExternalModuleBundler.js +298 -298
  43. package/commands/utils/componentAudit.js +74 -0
  44. package/commands/utils/compressAssets.js +103 -103
  45. package/commands/utils/cssScope.js +83 -0
  46. package/commands/utils/loadConfig.js +31 -31
  47. package/commands/utils/semver.js +66 -0
  48. package/commands/utils/sliceConfigSchema.js +106 -0
  49. package/commands/utils/sliceScripts.js +48 -48
  50. package/commands/utils/updateManager.js +471 -471
  51. package/eslint-config.js +128 -0
  52. package/package.json +19 -13
@@ -1,48 +1,48 @@
1
- // commands/utils/sliceScripts.js
2
- //
3
- // Single source of truth for the slice:* package scripts configured by the CLI.
4
- // Used by the `slice postinstall` command in
5
- // client.js, and `slice init` — so the three can never drift apart (they did:
6
- // client.js was missing slice:types, and none of them had slice:build).
7
-
8
- import fs from 'fs';
9
-
10
- /**
11
- * Reads a project's package.json and verifies it contains all SLICE_SCRIPTS.
12
- * Returns { missing: string[] } where each entry is the script name not found.
13
- */
14
- export function verifySliceScriptsInPackageJson(pkgPath) {
15
- const missing = [];
16
- try {
17
- if (!fs.existsSync(pkgPath)) {
18
- return { missing: Object.keys(SLICE_SCRIPTS) };
19
- }
20
- const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
21
- const scripts = pkg.scripts || {};
22
- for (const script of Object.keys(SLICE_SCRIPTS)) {
23
- if (!scripts[script]) {
24
- missing.push(script);
25
- }
26
- }
27
- } catch {
28
- return { missing: Object.keys(SLICE_SCRIPTS) };
29
- }
30
- return { missing };
31
- }
32
-
33
- export const SLICE_SCRIPTS = {
34
- 'slice:init': 'node ./node_modules/slicejs-cli/client.js init',
35
- 'slice:dev': 'node ./node_modules/slicejs-cli/client.js dev',
36
- 'slice:build': 'node ./node_modules/slicejs-cli/client.js build',
37
- 'slice:start': 'node ./node_modules/slicejs-cli/client.js start',
38
- 'slice:create': 'node ./node_modules/slicejs-cli/client.js component create',
39
- 'slice:list': 'node ./node_modules/slicejs-cli/client.js component list',
40
- 'slice:delete': 'node ./node_modules/slicejs-cli/client.js component delete',
41
- 'slice:get': 'node ./node_modules/slicejs-cli/client.js get',
42
- 'slice:browse': 'node ./node_modules/slicejs-cli/client.js browse',
43
- 'slice:sync': 'node ./node_modules/slicejs-cli/client.js sync',
44
- 'slice:doctor': 'node ./node_modules/slicejs-cli/client.js doctor',
45
- 'slice:version': 'node ./node_modules/slicejs-cli/client.js version',
46
- 'slice:help': 'node ./node_modules/slicejs-cli/client.js --help',
47
- 'slice:types': 'node ./node_modules/slicejs-cli/client.js types generate',
48
- };
1
+ // commands/utils/sliceScripts.js
2
+ //
3
+ // Single source of truth for the slice:* package scripts configured by the CLI.
4
+ // Used by the `slice postinstall` command in
5
+ // client.js, and `slice init` — so the three can never drift apart (they did:
6
+ // client.js was missing slice:types, and none of them had slice:build).
7
+
8
+ import fs from 'fs';
9
+
10
+ /**
11
+ * Reads a project's package.json and verifies it contains all SLICE_SCRIPTS.
12
+ * Returns { missing: string[] } where each entry is the script name not found.
13
+ */
14
+ export function verifySliceScriptsInPackageJson(pkgPath) {
15
+ const missing = [];
16
+ try {
17
+ if (!fs.existsSync(pkgPath)) {
18
+ return { missing: Object.keys(SLICE_SCRIPTS) };
19
+ }
20
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
21
+ const scripts = pkg.scripts || {};
22
+ for (const script of Object.keys(SLICE_SCRIPTS)) {
23
+ if (!scripts[script]) {
24
+ missing.push(script);
25
+ }
26
+ }
27
+ } catch {
28
+ return { missing: Object.keys(SLICE_SCRIPTS) };
29
+ }
30
+ return { missing };
31
+ }
32
+
33
+ export const SLICE_SCRIPTS = {
34
+ 'slice:init': 'node ./node_modules/slicejs-cli/client.js init',
35
+ 'slice:dev': 'node ./node_modules/slicejs-cli/client.js dev',
36
+ 'slice:build': 'node ./node_modules/slicejs-cli/client.js build',
37
+ 'slice:start': 'node ./node_modules/slicejs-cli/client.js start',
38
+ 'slice:create': 'node ./node_modules/slicejs-cli/client.js component create',
39
+ 'slice:list': 'node ./node_modules/slicejs-cli/client.js component list',
40
+ 'slice:delete': 'node ./node_modules/slicejs-cli/client.js component delete',
41
+ 'slice:get': 'node ./node_modules/slicejs-cli/client.js get',
42
+ 'slice:browse': 'node ./node_modules/slicejs-cli/client.js browse',
43
+ 'slice:sync': 'node ./node_modules/slicejs-cli/client.js sync',
44
+ 'slice:doctor': 'node ./node_modules/slicejs-cli/client.js doctor',
45
+ 'slice:version': 'node ./node_modules/slicejs-cli/client.js version',
46
+ 'slice:help': 'node ./node_modules/slicejs-cli/client.js --help',
47
+ 'slice:types': 'node ./node_modules/slicejs-cli/client.js types generate',
48
+ };