slicejs-cli 3.0.4 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +375 -375
  2. package/client.js +579 -555
  3. package/commands/Print.js +167 -167
  4. package/commands/Validations.js +103 -103
  5. package/commands/build/build.js +40 -40
  6. package/commands/buildProduction/buildProduction.js +579 -579
  7. package/commands/bundle/bundle.js +235 -235
  8. package/commands/createComponent/VisualComponentTemplate.js +55 -55
  9. package/commands/createComponent/createComponent.js +126 -126
  10. package/commands/deleteComponent/deleteComponent.js +77 -77
  11. package/commands/doctor/doctor.js +369 -369
  12. package/commands/getComponent/getComponent.js +747 -747
  13. package/commands/init/init.js +261 -261
  14. package/commands/listComponents/listComponents.js +175 -175
  15. package/commands/startServer/startServer.js +264 -264
  16. package/commands/startServer/watchServer.js +79 -79
  17. package/commands/types/types.js +538 -0
  18. package/commands/utils/LocalCliDelegation.js +53 -53
  19. package/commands/utils/PathHelper.js +68 -68
  20. package/commands/utils/VersionChecker.js +167 -167
  21. package/commands/utils/bundling/BundleGenerator.js +2292 -2031
  22. package/commands/utils/bundling/DependencyAnalyzer.js +933 -933
  23. package/commands/utils/updateManager.js +453 -453
  24. package/docs/superpowers/specs/2026-05-10-pwa-generate-design.md +182 -0
  25. package/package.json +46 -46
  26. package/post.js +25 -25
  27. package/refactor.md +271 -271
  28. package/tests/bundle-generator.test.js +708 -388
  29. package/tests/bundle-v2-register-output.test.js +470 -251
  30. package/tests/client-launcher-contract.test.js +211 -211
  31. package/tests/client-update-flow-contract.test.js +272 -272
  32. package/tests/dependency-analyzer.test.js +24 -24
  33. package/tests/local-cli-delegation.test.js +79 -79
  34. package/tests/types-generator.test.js +356 -0
  35. package/tests/update-manager-notifications.test.js +88 -88
@@ -1,88 +1,88 @@
1
- import { test } from 'node:test';
2
- import assert from 'node:assert/strict';
3
- import Print from '../commands/Print.js';
4
- import { UpdateManager } from '../commands/utils/updateManager.js';
5
-
6
- test('notifyAvailableUpdates shows advisory output and never invokes interactive update flow', async () => {
7
- const manager = new UpdateManager();
8
- const calls = {
9
- display: 0,
10
- prompted: 0,
11
- info: [],
12
- error: []
13
- };
14
-
15
- manager.checkForUpdates = async () => ({
16
- hasUpdates: true,
17
- updates: [
18
- {
19
- name: 'slicejs-web-framework',
20
- displayName: 'Slice.js Framework',
21
- current: '2.4.3',
22
- latest: '2.5.0',
23
- type: 'framework'
24
- }
25
- ],
26
- allCurrent: false
27
- });
28
-
29
- manager.displayUpdates = () => {
30
- calls.display += 1;
31
- };
32
-
33
- manager.checkAndPromptUpdates = async () => {
34
- calls.prompted += 1;
35
- return true;
36
- };
37
-
38
- const originalInfo = Print.info;
39
- const originalError = Print.error;
40
-
41
- Print.info = (message) => calls.info.push(message);
42
- Print.error = (message) => calls.error.push(message);
43
-
44
- try {
45
- const result = await manager.notifyAvailableUpdates();
46
-
47
- assert.equal(result, true);
48
- assert.equal(calls.display, 1);
49
- assert.equal(calls.prompted, 0);
50
- assert.equal(calls.error.length, 0);
51
- assert.equal(calls.info.length, 1);
52
- assert.match(calls.info[0], /slice update/);
53
- } finally {
54
- Print.info = originalInfo;
55
- Print.error = originalError;
56
- }
57
- });
58
-
59
- test('notifyAvailableUpdates returns false and prints nothing when no updates are available', async () => {
60
- const manager = new UpdateManager();
61
- const calls = {
62
- display: 0,
63
- info: []
64
- };
65
-
66
- manager.checkForUpdates = async () => ({
67
- hasUpdates: false,
68
- updates: [],
69
- allCurrent: true
70
- });
71
-
72
- manager.displayUpdates = () => {
73
- calls.display += 1;
74
- };
75
-
76
- const originalInfo = Print.info;
77
- Print.info = (message) => calls.info.push(message);
78
-
79
- try {
80
- const result = await manager.notifyAvailableUpdates();
81
-
82
- assert.equal(result, false);
83
- assert.equal(calls.display, 0);
84
- assert.equal(calls.info.length, 0);
85
- } finally {
86
- Print.info = originalInfo;
87
- }
88
- });
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import Print from '../commands/Print.js';
4
+ import { UpdateManager } from '../commands/utils/updateManager.js';
5
+
6
+ test('notifyAvailableUpdates shows advisory output and never invokes interactive update flow', async () => {
7
+ const manager = new UpdateManager();
8
+ const calls = {
9
+ display: 0,
10
+ prompted: 0,
11
+ info: [],
12
+ error: []
13
+ };
14
+
15
+ manager.checkForUpdates = async () => ({
16
+ hasUpdates: true,
17
+ updates: [
18
+ {
19
+ name: 'slicejs-web-framework',
20
+ displayName: 'Slice.js Framework',
21
+ current: '2.4.3',
22
+ latest: '2.5.0',
23
+ type: 'framework'
24
+ }
25
+ ],
26
+ allCurrent: false
27
+ });
28
+
29
+ manager.displayUpdates = () => {
30
+ calls.display += 1;
31
+ };
32
+
33
+ manager.checkAndPromptUpdates = async () => {
34
+ calls.prompted += 1;
35
+ return true;
36
+ };
37
+
38
+ const originalInfo = Print.info;
39
+ const originalError = Print.error;
40
+
41
+ Print.info = (message) => calls.info.push(message);
42
+ Print.error = (message) => calls.error.push(message);
43
+
44
+ try {
45
+ const result = await manager.notifyAvailableUpdates();
46
+
47
+ assert.equal(result, true);
48
+ assert.equal(calls.display, 1);
49
+ assert.equal(calls.prompted, 0);
50
+ assert.equal(calls.error.length, 0);
51
+ assert.equal(calls.info.length, 1);
52
+ assert.match(calls.info[0], /slice update/);
53
+ } finally {
54
+ Print.info = originalInfo;
55
+ Print.error = originalError;
56
+ }
57
+ });
58
+
59
+ test('notifyAvailableUpdates returns false and prints nothing when no updates are available', async () => {
60
+ const manager = new UpdateManager();
61
+ const calls = {
62
+ display: 0,
63
+ info: []
64
+ };
65
+
66
+ manager.checkForUpdates = async () => ({
67
+ hasUpdates: false,
68
+ updates: [],
69
+ allCurrent: true
70
+ });
71
+
72
+ manager.displayUpdates = () => {
73
+ calls.display += 1;
74
+ };
75
+
76
+ const originalInfo = Print.info;
77
+ Print.info = (message) => calls.info.push(message);
78
+
79
+ try {
80
+ const result = await manager.notifyAvailableUpdates();
81
+
82
+ assert.equal(result, false);
83
+ assert.equal(calls.display, 0);
84
+ assert.equal(calls.info.length, 0);
85
+ } finally {
86
+ Print.info = originalInfo;
87
+ }
88
+ });