slicejs-cli 3.6.2 → 3.6.4

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.
package/package.json CHANGED
@@ -1,74 +1,74 @@
1
- {
2
- "name": "slicejs-cli",
3
- "version": "3.6.2",
4
- "description": "Command client for developing web applications with Slice.js framework",
5
- "main": "client.js",
6
- "bin": {
7
- "slice": "./client.js"
8
- },
9
- "engines": {
10
- "node": ">=20.0.0"
11
- },
12
- "files": [
13
- "client.js",
14
- "post.js",
15
- "commands",
16
- "assets"
17
- ],
18
- "repository": {
19
- "type": "git",
20
- "url": "https://github.com/vkneider/slicejs-cli.git"
21
- },
22
- "scripts": {
23
- "test": "node --test",
24
- "postinstall": "node post.js",
25
- "slice:dev": "slice dev",
26
- "slice:build": "slice build",
27
- "slice:start": "slice start",
28
- "slice:create": "slice component create",
29
- "slice:list": "slice component list",
30
- "slice:delete": "slice component delete",
31
- "slice:init": "slice init",
32
- "slice:get": "slice get",
33
- "slice:browse": "slice browse",
34
- "slice:sync": "slice sync",
35
- "slice:version": "slice version",
36
- "slice:update": "slice update",
37
- "slice:types": "slice types generate",
38
- "slice:doctor": "node ./node_modules/slicejs-cli/client.js doctor",
39
- "slice:help": "node ./node_modules/slicejs-cli/client.js --help"
40
- },
41
- "keywords": [
42
- "framework",
43
- "web",
44
- "client",
45
- "cli",
46
- "slice",
47
- "slicejs",
48
- "component",
49
- "development server"
50
- ],
51
- "author": "vkneider",
52
- "type": "module",
53
- "packageManager": "pnpm@11.1.1",
54
- "preferGlobal": false,
55
- "license": "ISC",
56
- "dependencies": {
57
- "@babel/parser": "^7.28.5",
58
- "@babel/traverse": "^7.28.5",
59
- "chalk": "^5.6.2",
60
- "chokidar": "^3.6.0",
61
- "clean-css": "^5.3.3",
62
- "cli-table3": "^0.6.5",
63
- "commander": "^12.0.0",
64
- "fs-extra": "^11.2.0",
65
- "html-minifier-terser": "^7.2.0",
66
- "inquirer": "^12.4.2",
67
- "ora": "^8.2.0",
68
- "slicejs-web-framework": "latest",
69
- "terser": "^5.43.1"
70
- },
71
- "devDependencies": {
72
- "@playwright/test": "^1.60.0"
73
- }
1
+ {
2
+ "name": "slicejs-cli",
3
+ "version": "3.6.4",
4
+ "description": "Command client for developing web applications with Slice.js framework",
5
+ "main": "client.js",
6
+ "bin": {
7
+ "slice": "./client.js"
8
+ },
9
+ "engines": {
10
+ "node": ">=20.0.0"
11
+ },
12
+ "files": [
13
+ "client.js",
14
+ "post.js",
15
+ "commands",
16
+ "assets"
17
+ ],
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/vkneider/slicejs-cli.git"
21
+ },
22
+ "scripts": {
23
+ "test": "node --test",
24
+ "postinstall": "node post.js",
25
+ "slice:dev": "slice dev",
26
+ "slice:build": "slice build",
27
+ "slice:start": "slice start",
28
+ "slice:create": "slice component create",
29
+ "slice:list": "slice component list",
30
+ "slice:delete": "slice component delete",
31
+ "slice:init": "slice init",
32
+ "slice:get": "slice get",
33
+ "slice:browse": "slice browse",
34
+ "slice:sync": "slice sync",
35
+ "slice:version": "slice version",
36
+ "slice:update": "slice update",
37
+ "slice:types": "slice types generate",
38
+ "slice:doctor": "node ./node_modules/slicejs-cli/client.js doctor",
39
+ "slice:help": "node ./node_modules/slicejs-cli/client.js --help"
40
+ },
41
+ "keywords": [
42
+ "framework",
43
+ "web",
44
+ "client",
45
+ "cli",
46
+ "slice",
47
+ "slicejs",
48
+ "component",
49
+ "development server"
50
+ ],
51
+ "author": "vkneider",
52
+ "type": "module",
53
+ "packageManager": "pnpm@11.1.1",
54
+ "preferGlobal": false,
55
+ "license": "ISC",
56
+ "dependencies": {
57
+ "@babel/parser": "^7.28.5",
58
+ "@babel/traverse": "^7.28.5",
59
+ "chalk": "^5.6.2",
60
+ "chokidar": "^3.6.0",
61
+ "clean-css": "^5.3.3",
62
+ "cli-table3": "^0.6.5",
63
+ "commander": "^12.0.0",
64
+ "fs-extra": "^11.2.0",
65
+ "html-minifier-terser": "^7.2.0",
66
+ "inquirer": "^12.4.2",
67
+ "ora": "^8.2.0",
68
+ "slicejs-web-framework": "latest",
69
+ "terser": "^5.43.1"
70
+ },
71
+ "devDependencies": {
72
+ "@playwright/test": "^1.60.0"
73
+ }
74
74
  }
package/post.js CHANGED
@@ -1,60 +1,60 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- import { fileURLToPath } from 'url';
4
- import { getProjectRoot, getPath } from './commands/utils/PathHelper.js';
5
- import { SLICE_SCRIPTS } from './commands/utils/sliceScripts.js';
6
- import { resolvePackageManager, runScriptCommand } from './commands/utils/PackageManager.js';
7
-
8
- const __filename = fileURLToPath(import.meta.url);
9
-
10
- // npm sets npm_config_global; pnpm does not — for pnpm a global install lives
11
- // under PNPM_HOME, so detect it by where this script is running from.
12
- const pnpmHome = process.env.PNPM_HOME;
13
- const isGlobal = process.env.npm_config_global === 'true'
14
- || (pnpmHome && __filename.startsWith(pnpmHome));
15
-
16
- if (isGlobal) {
17
- console.log('⚠️ Global installation of slicejs-cli detected.');
18
- console.log(' We strongly recommend using a local installation to avoid version mismatches.');
19
- console.log(` Uninstall global: ${pnpmHome ? 'pnpm remove -g slicejs-cli' : 'npm uninstall -g slicejs-cli'}`);
20
- process.exit(0);
21
- }
22
-
23
- const projectRoot = getProjectRoot(import.meta.url);
24
- const pkgPath = getPath(import.meta.url, 'package.json');
25
- const packageManager = resolvePackageManager(projectRoot).name;
26
-
27
- const sliceScripts = SLICE_SCRIPTS;
28
-
29
- try {
30
- let pkg = {};
31
- if (fs.existsSync(pkgPath)) {
32
- pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
33
- } else {
34
- pkg = {
35
- name: path.basename(projectRoot),
36
- version: '1.0.0',
37
- description: 'Slice.js project',
38
- scripts: {}
39
- };
40
- }
41
-
42
- pkg.scripts = pkg.scripts || {};
43
- let addedCount = 0;
44
- for (const [script, command] of Object.entries(sliceScripts)) {
45
- if (!pkg.scripts[script]) {
46
- pkg.scripts[script] = command;
47
- addedCount++;
48
- }
49
- }
50
-
51
- fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2), 'utf-8');
52
- console.log(`✅ slicejs-cli installed successfully. Added ${addedCount} package scripts to package.json.`);
53
- console.log(` Run: ${runScriptCommand(packageManager, 'slice:dev')}`);
54
- } catch (err) {
55
- console.log('✅ slicejs-cli installed successfully.');
56
- console.log(' Could not auto-configure scripts:', err.message);
57
- console.log(` Configure scripts manually and run: ${runScriptCommand(packageManager, 'slice:dev')}`);
58
- }
59
-
60
- process.exit(0);
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import { getProjectRoot, getPath } from './commands/utils/PathHelper.js';
5
+ import { SLICE_SCRIPTS } from './commands/utils/sliceScripts.js';
6
+ import { resolvePackageManager, runScriptCommand } from './commands/utils/PackageManager.js';
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+
10
+ // npm sets npm_config_global; pnpm does not — for pnpm a global install lives
11
+ // under PNPM_HOME, so detect it by where this script is running from.
12
+ const pnpmHome = process.env.PNPM_HOME;
13
+ const isGlobal = process.env.npm_config_global === 'true'
14
+ || (pnpmHome && __filename.startsWith(pnpmHome));
15
+
16
+ if (isGlobal) {
17
+ console.log('⚠️ Global installation of slicejs-cli detected.');
18
+ console.log(' We strongly recommend using a local installation to avoid version mismatches.');
19
+ console.log(` Uninstall global: ${pnpmHome ? 'pnpm remove -g slicejs-cli' : 'npm uninstall -g slicejs-cli'}`);
20
+ process.exit(0);
21
+ }
22
+
23
+ const projectRoot = getProjectRoot(import.meta.url);
24
+ const pkgPath = getPath(import.meta.url, 'package.json');
25
+ const packageManager = resolvePackageManager(projectRoot).name;
26
+
27
+ const sliceScripts = SLICE_SCRIPTS;
28
+
29
+ try {
30
+ let pkg = {};
31
+ if (fs.existsSync(pkgPath)) {
32
+ pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
33
+ } else {
34
+ pkg = {
35
+ name: path.basename(projectRoot),
36
+ version: '1.0.0',
37
+ description: 'Slice.js project',
38
+ scripts: {}
39
+ };
40
+ }
41
+
42
+ pkg.scripts = pkg.scripts || {};
43
+ let addedCount = 0;
44
+ for (const [script, command] of Object.entries(sliceScripts)) {
45
+ if (!pkg.scripts[script]) {
46
+ pkg.scripts[script] = command;
47
+ addedCount++;
48
+ }
49
+ }
50
+
51
+ fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2), 'utf-8');
52
+ console.log(`✅ slicejs-cli installed successfully. Added ${addedCount} package scripts to package.json.`);
53
+ console.log(` Run: ${runScriptCommand(packageManager, 'slice:dev')}`);
54
+ } catch (err) {
55
+ console.log('✅ slicejs-cli installed successfully.');
56
+ console.log(' Could not auto-configure scripts:', err.message);
57
+ console.log(` Configure scripts manually and run: ${runScriptCommand(packageManager, 'slice:dev')}`);
58
+ }
59
+
60
+ process.exit(0);