slicejs-cli 3.3.0 → 3.4.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 (33) hide show
  1. package/LICENSE +21 -21
  2. package/client.js +664 -626
  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 +265 -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 +16 -9
  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 -2292
  22. package/commands/utils/bundling/DependencyAnalyzer.js +933 -933
  23. package/commands/utils/updateManager.js +453 -453
  24. package/package.json +46 -46
  25. package/post.js +66 -65
  26. package/tests/bundle-generator.test.js +708 -708
  27. package/tests/bundle-v2-register-output.test.js +470 -470
  28. package/tests/client-launcher-contract.test.js +211 -211
  29. package/tests/client-update-flow-contract.test.js +272 -272
  30. package/tests/dependency-analyzer.test.js +24 -24
  31. package/tests/local-cli-delegation.test.js +79 -79
  32. package/tests/update-manager-notifications.test.js +88 -88
  33. package/.github/workflows/docs-render-cicd.yml +0 -65
package/package.json CHANGED
@@ -1,46 +1,46 @@
1
- {
2
- "name": "slicejs-cli",
3
- "version": "3.3.0",
4
- "description": "Command client for developing web applications with Slice.js framework",
5
- "main": "client.js",
6
- "bin": {
7
- "slice": "./client.js"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "https://github.com/vkneider/slicejs-cli.git"
12
- },
13
- "scripts": {
14
- "test": "node --test",
15
- "postinstall": "node post.js"
16
- },
17
- "keywords": [
18
- "framework",
19
- "web",
20
- "client",
21
- "cli",
22
- "slice",
23
- "slicejs",
24
- "component",
25
- "development server"
26
- ],
27
- "author": "vkneider",
28
- "type": "module",
29
- "preferGlobal": false,
30
- "license": "ISC",
31
- "dependencies": {
32
- "@babel/parser": "^7.28.5",
33
- "@babel/traverse": "^7.28.5",
34
- "chalk": "^5.6.2",
35
- "chokidar": "^3.6.0",
36
- "clean-css": "^5.3.3",
37
- "cli-table3": "^0.6.5",
38
- "commander": "^12.0.0",
39
- "fs-extra": "^11.2.0",
40
- "html-minifier-terser": "^7.2.0",
41
- "inquirer": "^12.4.2",
42
- "ora": "^8.2.0",
43
- "slicejs-web-framework": "latest",
44
- "terser": "^5.43.1"
45
- }
46
- }
1
+ {
2
+ "name": "slicejs-cli",
3
+ "version": "3.4.0",
4
+ "description": "Command client for developing web applications with Slice.js framework",
5
+ "main": "client.js",
6
+ "bin": {
7
+ "slice": "./client.js"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/vkneider/slicejs-cli.git"
12
+ },
13
+ "scripts": {
14
+ "test": "node --test",
15
+ "postinstall": "node post.js"
16
+ },
17
+ "keywords": [
18
+ "framework",
19
+ "web",
20
+ "client",
21
+ "cli",
22
+ "slice",
23
+ "slicejs",
24
+ "component",
25
+ "development server"
26
+ ],
27
+ "author": "vkneider",
28
+ "type": "module",
29
+ "preferGlobal": false,
30
+ "license": "ISC",
31
+ "dependencies": {
32
+ "@babel/parser": "^7.28.5",
33
+ "@babel/traverse": "^7.28.5",
34
+ "chalk": "^5.6.2",
35
+ "chokidar": "^3.6.0",
36
+ "clean-css": "^5.3.3",
37
+ "cli-table3": "^0.6.5",
38
+ "commander": "^12.0.0",
39
+ "fs-extra": "^11.2.0",
40
+ "html-minifier-terser": "^7.2.0",
41
+ "inquirer": "^12.4.2",
42
+ "ora": "^8.2.0",
43
+ "slicejs-web-framework": "latest",
44
+ "terser": "^5.43.1"
45
+ }
46
+ }
package/post.js CHANGED
@@ -1,65 +1,66 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- import { fileURLToPath } from 'url';
4
- import { getProjectRoot } from './commands/utils/PathHelper.js';
5
-
6
- const __filename = fileURLToPath(import.meta.url);
7
-
8
- const isGlobal = process.env.npm_config_global === 'true';
9
-
10
- if (isGlobal) {
11
- console.log('⚠️ Global installation of slicejs-cli detected.');
12
- console.log(' We strongly recommend using a local installation to avoid version mismatches.');
13
- console.log(' Uninstall global: npm uninstall -g slicejs-cli');
14
- process.exit(0);
15
- }
16
-
17
- const projectRoot = getProjectRoot(import.meta.url);
18
- const pkgPath = path.join(projectRoot, 'package.json');
19
-
20
- const sliceScripts = {
21
- 'slice:dev': 'slice dev',
22
- 'slice:start': 'slice start',
23
- 'slice:create': 'slice component create',
24
- 'slice:list': 'slice component list',
25
- 'slice:delete': 'slice component delete',
26
- 'slice:init': 'slice init',
27
- 'slice:get': 'slice get',
28
- 'slice:browse': 'slice browse',
29
- 'slice:sync': 'slice sync',
30
- 'slice:version': 'slice version',
31
- 'slice:update': 'slice update',
32
- };
33
-
34
- try {
35
- let pkg = {};
36
- if (fs.existsSync(pkgPath)) {
37
- pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
38
- } else {
39
- pkg = {
40
- name: path.basename(projectRoot),
41
- version: '1.0.0',
42
- description: 'Slice.js project',
43
- scripts: {}
44
- };
45
- }
46
-
47
- pkg.scripts = pkg.scripts || {};
48
- let addedCount = 0;
49
- for (const [script, command] of Object.entries(sliceScripts)) {
50
- if (!pkg.scripts[script]) {
51
- pkg.scripts[script] = command;
52
- addedCount++;
53
- }
54
- }
55
-
56
- fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2), 'utf-8');
57
- console.log(`✅ slicejs-cli installed successfully. Added ${addedCount} npm scripts to package.json.`);
58
- console.log(' Run: npm run slice:dev');
59
- } catch (err) {
60
- console.log('✅ slicejs-cli installed successfully.');
61
- console.log(' Could not auto-configure scripts:', err.message);
62
- console.log(' Run: npx slice dev');
63
- }
64
-
65
- process.exit(0);
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import { getProjectRoot } from './commands/utils/PathHelper.js';
5
+
6
+ const __filename = fileURLToPath(import.meta.url);
7
+
8
+ const isGlobal = process.env.npm_config_global === 'true';
9
+
10
+ if (isGlobal) {
11
+ console.log('⚠️ Global installation of slicejs-cli detected.');
12
+ console.log(' We strongly recommend using a local installation to avoid version mismatches.');
13
+ console.log(' Uninstall global: npm uninstall -g slicejs-cli');
14
+ process.exit(0);
15
+ }
16
+
17
+ const projectRoot = getProjectRoot(import.meta.url);
18
+ const pkgPath = path.join(projectRoot, 'package.json');
19
+
20
+ const sliceScripts = {
21
+ 'slice:dev': 'slice dev',
22
+ 'slice:start': 'slice start',
23
+ 'slice:create': 'slice component create',
24
+ 'slice:list': 'slice component list',
25
+ 'slice:delete': 'slice component delete',
26
+ 'slice:init': 'slice init',
27
+ 'slice:get': 'slice get',
28
+ 'slice:browse': 'slice browse',
29
+ 'slice:sync': 'slice sync',
30
+ 'slice:version': 'slice version',
31
+ 'slice:update': 'slice update',
32
+ 'slice:types': 'slice types generate',
33
+ };
34
+
35
+ try {
36
+ let pkg = {};
37
+ if (fs.existsSync(pkgPath)) {
38
+ pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
39
+ } else {
40
+ pkg = {
41
+ name: path.basename(projectRoot),
42
+ version: '1.0.0',
43
+ description: 'Slice.js project',
44
+ scripts: {}
45
+ };
46
+ }
47
+
48
+ pkg.scripts = pkg.scripts || {};
49
+ let addedCount = 0;
50
+ for (const [script, command] of Object.entries(sliceScripts)) {
51
+ if (!pkg.scripts[script]) {
52
+ pkg.scripts[script] = command;
53
+ addedCount++;
54
+ }
55
+ }
56
+
57
+ fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2), 'utf-8');
58
+ console.log(`✅ slicejs-cli installed successfully. Added ${addedCount} npm scripts to package.json.`);
59
+ console.log(' Run: npm run slice:dev');
60
+ } catch (err) {
61
+ console.log('✅ slicejs-cli installed successfully.');
62
+ console.log(' Could not auto-configure scripts:', err.message);
63
+ console.log(' Run: npx slice dev');
64
+ }
65
+
66
+ process.exit(0);