@ywal123456/jskim 0.3.1 → 0.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.
- package/README.md +27 -11
- package/bin/jskim.js +32 -29
- package/docs/configuration.md +26 -3
- package/docs/create-jskim.md +3 -3
- package/package.json +1 -1
- package/scripts/build.js +14 -2
- package/scripts/commands/build-command.js +113 -3
- package/scripts/commands/dev-command.js +10 -1
- package/scripts/commands/help-text.js +23 -11
- package/scripts/commands/serve-command.js +20 -4
- package/scripts/commands/serve-errors.js +30 -4
- package/scripts/commands/watch-command.js +1 -1
- package/scripts/dev.js +16 -2
- package/scripts/lib/apply-serve-cli-overrides.js +96 -0
- package/scripts/lib/assert-output-dirs-compatible.js +88 -0
- package/scripts/lib/classify-reload.js +131 -0
- package/scripts/lib/create-live-reload.js +422 -32
- package/scripts/lib/create-project-watcher.js +3 -1
- package/scripts/lib/create-watch-runtime.js +109 -16
- package/scripts/lib/open-browser.js +102 -0
- package/scripts/lib/parse-cli-args.js +216 -0
- package/scripts/lib/select-project-name.js +64 -0
- package/scripts/lib/stylesheet-reload.js +58 -0
- package/scripts/serve.js +21 -2
- package/scripts/watch.js +13 -2
package/scripts/serve.js
CHANGED
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const { parseCommandArgv } = require('./lib/parse-cli-args');
|
|
3
4
|
const { runServeCommand } = require('./commands/serve-command');
|
|
4
5
|
|
|
6
|
+
let parsed;
|
|
7
|
+
try {
|
|
8
|
+
parsed = parseCommandArgv('serve', process.argv.slice(2));
|
|
9
|
+
} catch (err) {
|
|
10
|
+
const message = err && err.message ? err.message : String(err);
|
|
11
|
+
console.error(message);
|
|
12
|
+
process.exitCode = 1;
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const projectName = parsed.projectName;
|
|
17
|
+
const buildHint = projectName
|
|
18
|
+
? `jskim build ${projectName}`
|
|
19
|
+
: 'jskim build [<project>]';
|
|
20
|
+
|
|
5
21
|
runServeCommand({
|
|
6
|
-
projectName
|
|
22
|
+
projectName,
|
|
7
23
|
workspaceRoot: process.cwd(),
|
|
8
|
-
usageLine: '
|
|
24
|
+
usageLine: 'jskim serve [<project>] [--host <host>] [--port <port>]',
|
|
25
|
+
buildHint,
|
|
26
|
+
host: parsed.options.host,
|
|
27
|
+
port: parsed.options.port,
|
|
9
28
|
}).catch((err) => {
|
|
10
29
|
const message = err && err.message ? err.message : String(err);
|
|
11
30
|
console.error(message);
|
package/scripts/watch.js
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const { parseCommandArgv } = require('./lib/parse-cli-args');
|
|
3
4
|
const { runWatchCommand } = require('./commands/watch-command');
|
|
4
5
|
|
|
6
|
+
let parsed;
|
|
7
|
+
try {
|
|
8
|
+
parsed = parseCommandArgv('watch', process.argv.slice(2));
|
|
9
|
+
} catch (err) {
|
|
10
|
+
const message = err && err.message ? err.message : String(err);
|
|
11
|
+
console.error(message);
|
|
12
|
+
process.exitCode = 1;
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
5
16
|
runWatchCommand({
|
|
6
|
-
projectName:
|
|
17
|
+
projectName: parsed.projectName,
|
|
7
18
|
workspaceRoot: process.cwd(),
|
|
8
|
-
usageLine: '
|
|
19
|
+
usageLine: 'jskim watch [<project>]',
|
|
9
20
|
}).catch((err) => {
|
|
10
21
|
const message = err && err.message ? err.message : String(err);
|
|
11
22
|
console.error(message);
|