slicejs-cli 3.6.3 → 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/LICENSE +21 -21
- package/README.md +226 -226
- package/client.js +744 -744
- package/commands/Print.js +163 -163
- package/commands/Validations.js +92 -92
- package/commands/build/build.js +40 -40
- package/commands/buildProduction/buildProduction.js +577 -579
- package/commands/bundle/bundle.js +234 -234
- package/commands/createComponent/VisualComponentTemplate.js +55 -55
- package/commands/createComponent/createComponent.js +128 -128
- package/commands/deleteComponent/deleteComponent.js +81 -81
- package/commands/doctor/doctor.js +440 -440
- package/commands/getComponent/getComponent.js +701 -701
- package/commands/init/init.js +467 -467
- package/commands/listComponents/listComponents.js +172 -172
- package/commands/startServer/startServer.js +261 -261
- package/commands/startServer/watchServer.js +66 -66
- package/commands/types/types.js +580 -580
- package/commands/utils/LocalCliDelegation.js +53 -53
- package/commands/utils/PackageManager.js +148 -148
- package/commands/utils/PathHelper.js +75 -75
- package/commands/utils/VersionChecker.js +169 -169
- package/commands/utils/bundling/BundleGenerator.js +2525 -2525
- package/commands/utils/bundling/DependencyAnalyzer.js +925 -925
- package/commands/utils/loadConfig.js +31 -31
- package/commands/utils/sliceScripts.js +23 -23
- package/commands/utils/updateManager.js +471 -471
- package/package.json +73 -73
- package/post.js +60 -60
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import fs from 'fs-extra';
|
|
2
|
-
import { getConfigPath } from './PathHelper.js';
|
|
3
|
-
import Print from '../Print.js';
|
|
4
|
-
|
|
5
|
-
export async function loadConfig(moduleUrl) {
|
|
6
|
-
try {
|
|
7
|
-
const configPath = getConfigPath(moduleUrl);
|
|
8
|
-
if (!await fs.pathExists(configPath)) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
const rawData = await fs.readFile(configPath, 'utf-8');
|
|
12
|
-
return JSON.parse(rawData);
|
|
13
|
-
} catch (error) {
|
|
14
|
-
Print.error(`Error loading configuration: ${error.message}`);
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function loadConfigSync(moduleUrl) {
|
|
20
|
-
try {
|
|
21
|
-
const configPath = getConfigPath(moduleUrl);
|
|
22
|
-
if (!fs.existsSync(configPath)) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
const rawData = fs.readFileSync(configPath, 'utf-8');
|
|
26
|
-
return JSON.parse(rawData);
|
|
27
|
-
} catch (error) {
|
|
28
|
-
Print.error(`Error loading configuration: ${error.message}`);
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import { getConfigPath } from './PathHelper.js';
|
|
3
|
+
import Print from '../Print.js';
|
|
4
|
+
|
|
5
|
+
export async function loadConfig(moduleUrl) {
|
|
6
|
+
try {
|
|
7
|
+
const configPath = getConfigPath(moduleUrl);
|
|
8
|
+
if (!await fs.pathExists(configPath)) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const rawData = await fs.readFile(configPath, 'utf-8');
|
|
12
|
+
return JSON.parse(rawData);
|
|
13
|
+
} catch (error) {
|
|
14
|
+
Print.error(`Error loading configuration: ${error.message}`);
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function loadConfigSync(moduleUrl) {
|
|
20
|
+
try {
|
|
21
|
+
const configPath = getConfigPath(moduleUrl);
|
|
22
|
+
if (!fs.existsSync(configPath)) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const rawData = fs.readFileSync(configPath, 'utf-8');
|
|
26
|
+
return JSON.parse(rawData);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
Print.error(`Error loading configuration: ${error.message}`);
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
// commands/utils/sliceScripts.js
|
|
2
|
-
//
|
|
3
|
-
// Single source of truth for the slice:* package scripts configured by the CLI.
|
|
4
|
-
// Used by post.js (the postinstall hook), 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
|
-
export const SLICE_SCRIPTS = {
|
|
8
|
-
'slice:init': 'node ./node_modules/slicejs-cli/client.js init',
|
|
9
|
-
'slice:dev': 'node ./node_modules/slicejs-cli/client.js dev',
|
|
10
|
-
'slice:build': 'node ./node_modules/slicejs-cli/client.js build',
|
|
11
|
-
'slice:start': 'node ./node_modules/slicejs-cli/client.js start',
|
|
12
|
-
'slice:create': 'node ./node_modules/slicejs-cli/client.js component create',
|
|
13
|
-
'slice:list': 'node ./node_modules/slicejs-cli/client.js component list',
|
|
14
|
-
'slice:delete': 'node ./node_modules/slicejs-cli/client.js component delete',
|
|
15
|
-
'slice:get': 'node ./node_modules/slicejs-cli/client.js get',
|
|
16
|
-
'slice:browse': 'node ./node_modules/slicejs-cli/client.js browse',
|
|
17
|
-
'slice:sync': 'node ./node_modules/slicejs-cli/client.js sync',
|
|
18
|
-
'slice:doctor': 'node ./node_modules/slicejs-cli/client.js doctor',
|
|
19
|
-
'slice:version': 'node ./node_modules/slicejs-cli/client.js version',
|
|
20
|
-
'slice:help': 'node ./node_modules/slicejs-cli/client.js --help',
|
|
21
|
-
'slice:update': 'node ./node_modules/slicejs-cli/client.js update',
|
|
22
|
-
'slice:types': 'node ./node_modules/slicejs-cli/client.js types generate',
|
|
23
|
-
};
|
|
1
|
+
// commands/utils/sliceScripts.js
|
|
2
|
+
//
|
|
3
|
+
// Single source of truth for the slice:* package scripts configured by the CLI.
|
|
4
|
+
// Used by post.js (the postinstall hook), 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
|
+
export const SLICE_SCRIPTS = {
|
|
8
|
+
'slice:init': 'node ./node_modules/slicejs-cli/client.js init',
|
|
9
|
+
'slice:dev': 'node ./node_modules/slicejs-cli/client.js dev',
|
|
10
|
+
'slice:build': 'node ./node_modules/slicejs-cli/client.js build',
|
|
11
|
+
'slice:start': 'node ./node_modules/slicejs-cli/client.js start',
|
|
12
|
+
'slice:create': 'node ./node_modules/slicejs-cli/client.js component create',
|
|
13
|
+
'slice:list': 'node ./node_modules/slicejs-cli/client.js component list',
|
|
14
|
+
'slice:delete': 'node ./node_modules/slicejs-cli/client.js component delete',
|
|
15
|
+
'slice:get': 'node ./node_modules/slicejs-cli/client.js get',
|
|
16
|
+
'slice:browse': 'node ./node_modules/slicejs-cli/client.js browse',
|
|
17
|
+
'slice:sync': 'node ./node_modules/slicejs-cli/client.js sync',
|
|
18
|
+
'slice:doctor': 'node ./node_modules/slicejs-cli/client.js doctor',
|
|
19
|
+
'slice:version': 'node ./node_modules/slicejs-cli/client.js version',
|
|
20
|
+
'slice:help': 'node ./node_modules/slicejs-cli/client.js --help',
|
|
21
|
+
'slice:update': 'node ./node_modules/slicejs-cli/client.js update',
|
|
22
|
+
'slice:types': 'node ./node_modules/slicejs-cli/client.js types generate',
|
|
23
|
+
};
|