@stackbit/dev 0.0.12 → 0.0.13
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/dist/command.d.ts +3 -0
- package/dist/command.js +44 -0
- package/dist/command.js.map +1 -0
- package/dist/index.js +2 -38
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/.DS_Store +0 -0
- package/src/command.ts +41 -0
- package/src/index.ts +2 -44
package/dist/command.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handler = exports.builder = void 0;
|
|
4
|
+
function builder(yargs) {
|
|
5
|
+
yargs
|
|
6
|
+
.option('port', {
|
|
7
|
+
alias: 'p',
|
|
8
|
+
description: 'port',
|
|
9
|
+
default: 3000
|
|
10
|
+
})
|
|
11
|
+
.options('host', {
|
|
12
|
+
alias: 'h',
|
|
13
|
+
description: 'hostname',
|
|
14
|
+
default: 'localhost'
|
|
15
|
+
})
|
|
16
|
+
.options('dir', {
|
|
17
|
+
alias: 'd',
|
|
18
|
+
description: 'root dir',
|
|
19
|
+
default: process.cwd()
|
|
20
|
+
})
|
|
21
|
+
.options('runnable-dir', {
|
|
22
|
+
description: 'runnable dir',
|
|
23
|
+
default: ''
|
|
24
|
+
})
|
|
25
|
+
.options('log-level', {
|
|
26
|
+
description: 'log level',
|
|
27
|
+
default: 'info'
|
|
28
|
+
})
|
|
29
|
+
.options('help', {});
|
|
30
|
+
}
|
|
31
|
+
exports.builder = builder;
|
|
32
|
+
async function handler(argv) {
|
|
33
|
+
if (argv['log-level']) {
|
|
34
|
+
process.env.LOG_LEVEL = argv['log-level'];
|
|
35
|
+
}
|
|
36
|
+
return require('./dev').start({
|
|
37
|
+
ssgPort: argv.port,
|
|
38
|
+
ssgHost: argv.host,
|
|
39
|
+
rootDir: argv.dir,
|
|
40
|
+
runnableDir: argv['runnable-dir']
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
exports.handler = handler;
|
|
44
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;AAEA,SAAgB,OAAO,CAAC,KAAiB;IACrC,KAAK;SACA,MAAM,CAAC,MAAM,EAAE;QACZ,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,MAAM;QACnB,OAAO,EAAE,IAAI;KAChB,CAAC;SACD,OAAO,CAAC,MAAM,EAAE;QACb,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,UAAU;QACvB,OAAO,EAAE,WAAW;KACvB,CAAC;SACD,OAAO,CAAC,KAAK,EAAE;QACZ,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,UAAU;QACvB,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE;KACzB,CAAC;SACD,OAAO,CAAC,cAAc,EAAE;QACrB,WAAW,EAAE,cAAc;QAC3B,OAAO,EAAE,EAAE;KACd,CAAC;SACD,OAAO,CAAC,WAAW,EAAE;QAClB,WAAW,EAAE,WAAW;QACxB,OAAO,EAAE,MAAM;KAClB,CAAC;SACD,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AA1BD,0BA0BC;AAEM,KAAK,UAAU,OAAO,CAAC,IAAS;IACnC,IAAI,IAAI,CAAC,WAAW,CAAC,EAAE;QACnB,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;KAC7C;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC;QAC1B,OAAO,EAAE,IAAI,CAAC,IAAI;QAClB,OAAO,EAAE,IAAI,CAAC,IAAI;QAClB,OAAO,EAAE,IAAI,CAAC,GAAG;QACjB,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC;KACpC,CAAC,CAAC;AACP,CAAC;AAVD,0BAUC"}
|
package/dist/index.js
CHANGED
|
@@ -5,42 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const yargs_1 = __importDefault(require("yargs"));
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
.option('port', {
|
|
11
|
-
alias: 'p',
|
|
12
|
-
description: 'port',
|
|
13
|
-
default: 3000
|
|
14
|
-
})
|
|
15
|
-
.options('host', {
|
|
16
|
-
alias: 'h',
|
|
17
|
-
description: 'hostname',
|
|
18
|
-
default: 'localhost'
|
|
19
|
-
})
|
|
20
|
-
.options('dir', {
|
|
21
|
-
alias: 'd',
|
|
22
|
-
description: 'root dir',
|
|
23
|
-
default: process.cwd()
|
|
24
|
-
})
|
|
25
|
-
.options('runnable-dir', {
|
|
26
|
-
description: 'runnable dir',
|
|
27
|
-
default: ''
|
|
28
|
-
})
|
|
29
|
-
.options('log-level', {
|
|
30
|
-
description: 'log level',
|
|
31
|
-
default: 'info'
|
|
32
|
-
})
|
|
33
|
-
.options('help', {}), async (argv) => {
|
|
34
|
-
if (argv['log-level']) {
|
|
35
|
-
process.env.LOG_LEVEL = argv['log-level'];
|
|
36
|
-
}
|
|
37
|
-
return require('./dev').start({
|
|
38
|
-
ssgPort: argv.port,
|
|
39
|
-
ssgHost: argv.host,
|
|
40
|
-
rootDir: argv.dir,
|
|
41
|
-
runnableDir: argv['runnable-dir']
|
|
42
|
-
});
|
|
43
|
-
})
|
|
44
|
-
.demandCommand()
|
|
45
|
-
.parse();
|
|
8
|
+
const command_1 = require("./command");
|
|
9
|
+
(0, yargs_1.default)(process.argv.slice(2)).command('$0', 'stackbit-dev', command_1.builder, command_1.handler).demandCommand().parse();
|
|
46
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAEA,kDAA0B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAEA,kDAA0B;AAC1B,uCAA6C;AAE7C,IAAA,eAAK,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,cAAc,EAAE,iBAAO,EAAE,iBAAO,CAAC,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackbit/dev",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "stackbit-dev",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"ts-jest": "^27.1.3",
|
|
55
55
|
"typescript": "^4.5.4"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "8e4f212d57354e6c7f2d411f2fc3a19d614c4d8b"
|
|
58
58
|
}
|
package/src/.DS_Store
ADDED
|
Binary file
|
package/src/command.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import yargs from 'yargs';
|
|
2
|
+
|
|
3
|
+
export function builder(yargs: yargs.Argv) {
|
|
4
|
+
yargs
|
|
5
|
+
.option('port', {
|
|
6
|
+
alias: 'p',
|
|
7
|
+
description: 'port',
|
|
8
|
+
default: 3000
|
|
9
|
+
})
|
|
10
|
+
.options('host', {
|
|
11
|
+
alias: 'h',
|
|
12
|
+
description: 'hostname',
|
|
13
|
+
default: 'localhost'
|
|
14
|
+
})
|
|
15
|
+
.options('dir', {
|
|
16
|
+
alias: 'd',
|
|
17
|
+
description: 'root dir',
|
|
18
|
+
default: process.cwd()
|
|
19
|
+
})
|
|
20
|
+
.options('runnable-dir', {
|
|
21
|
+
description: 'runnable dir',
|
|
22
|
+
default: ''
|
|
23
|
+
})
|
|
24
|
+
.options('log-level', {
|
|
25
|
+
description: 'log level',
|
|
26
|
+
default: 'info'
|
|
27
|
+
})
|
|
28
|
+
.options('help', {});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export async function handler(argv: any) {
|
|
32
|
+
if (argv['log-level']) {
|
|
33
|
+
process.env.LOG_LEVEL = argv['log-level'];
|
|
34
|
+
}
|
|
35
|
+
return require('./dev').start({
|
|
36
|
+
ssgPort: argv.port,
|
|
37
|
+
ssgHost: argv.host,
|
|
38
|
+
rootDir: argv.dir,
|
|
39
|
+
runnableDir: argv['runnable-dir']
|
|
40
|
+
});
|
|
41
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,48 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import yargs from 'yargs';
|
|
4
|
+
import { builder, handler } from './command';
|
|
4
5
|
|
|
5
|
-
yargs(process.argv.slice(2))
|
|
6
|
-
.command(
|
|
7
|
-
'$0',
|
|
8
|
-
'stackbit-dev',
|
|
9
|
-
(yargs) =>
|
|
10
|
-
yargs
|
|
11
|
-
.option('port', {
|
|
12
|
-
alias: 'p',
|
|
13
|
-
description: 'port',
|
|
14
|
-
default: 3000
|
|
15
|
-
})
|
|
16
|
-
.options('host', {
|
|
17
|
-
alias: 'h',
|
|
18
|
-
description: 'hostname',
|
|
19
|
-
default: 'localhost'
|
|
20
|
-
})
|
|
21
|
-
.options('dir', {
|
|
22
|
-
alias: 'd',
|
|
23
|
-
description: 'root dir',
|
|
24
|
-
default: process.cwd()
|
|
25
|
-
})
|
|
26
|
-
.options('runnable-dir', {
|
|
27
|
-
description: 'runnable dir',
|
|
28
|
-
default: ''
|
|
29
|
-
})
|
|
30
|
-
.options('log-level', {
|
|
31
|
-
description: 'log level',
|
|
32
|
-
default: 'info'
|
|
33
|
-
})
|
|
34
|
-
.options('help', {}),
|
|
35
|
-
async (argv) => {
|
|
36
|
-
if (argv['log-level']) {
|
|
37
|
-
process.env.LOG_LEVEL = argv['log-level'];
|
|
38
|
-
}
|
|
39
|
-
return require('./dev').start({
|
|
40
|
-
ssgPort: argv.port,
|
|
41
|
-
ssgHost: argv.host,
|
|
42
|
-
rootDir: argv.dir,
|
|
43
|
-
runnableDir: argv['runnable-dir']
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
)
|
|
47
|
-
.demandCommand()
|
|
48
|
-
.parse();
|
|
6
|
+
yargs(process.argv.slice(2)).command('$0', 'stackbit-dev', builder, handler).demandCommand().parse();
|