vovk 0.2.3-beta.126 → 0.2.3-beta.127
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/cli/index.js +4 -4
- package/cli/lib/parseCommandLineArgs.js +1 -1
- package/package.json +1 -1
package/cli/index.js
CHANGED
|
@@ -13,13 +13,13 @@ const {
|
|
|
13
13
|
// TODO not documented
|
|
14
14
|
project = process.cwd(), // Path to Next.js project
|
|
15
15
|
clientOut = path.join(process.cwd(), './node_modules/.vovk'), // Path to output directory
|
|
16
|
-
|
|
16
|
+
noNextDev = false, // Start Vovk Server without Next.js
|
|
17
17
|
} = flags;
|
|
18
18
|
|
|
19
19
|
if (command === 'dev') {
|
|
20
20
|
const portAttempts = 30;
|
|
21
21
|
void (async () => {
|
|
22
|
-
let PORT =
|
|
22
|
+
let PORT = noNextDev
|
|
23
23
|
? process.env.PORT
|
|
24
24
|
: process.env.PORT ||
|
|
25
25
|
(await getAvailablePort(3000, portAttempts).catch(() => {
|
|
@@ -27,7 +27,7 @@ if (command === 'dev') {
|
|
|
27
27
|
}));
|
|
28
28
|
|
|
29
29
|
if (!PORT) {
|
|
30
|
-
throw new Error(' 🐺 ❌ PORT env variable is required in
|
|
30
|
+
throw new Error(' 🐺 ❌ PORT env variable is required in --no-next-dev mode');
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
const env = getVars(config, { VOVK_CLIENT_OUT: clientOut, PORT });
|
|
@@ -45,7 +45,7 @@ if (command === 'dev') {
|
|
|
45
45
|
},
|
|
46
46
|
];
|
|
47
47
|
|
|
48
|
-
if (!
|
|
48
|
+
if (!noNextDev) {
|
|
49
49
|
commands.push({
|
|
50
50
|
command: `cd ${project} && npx next dev ${restArgs}`,
|
|
51
51
|
name: 'Next',
|
|
@@ -5,7 +5,7 @@ function toCamelCase(str) {
|
|
|
5
5
|
return str.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
/** @typedef {{ config?: string; project?: string; clientOut?: string;
|
|
8
|
+
/** @typedef {{ config?: string; project?: string; clientOut?: string; noNextDev?: true }} Flags */
|
|
9
9
|
/** @typedef {'dev' | 'build' | 'generate' | 'help'} Command */
|
|
10
10
|
function parseCommandLineArgs() {
|
|
11
11
|
const args = process.argv.slice(2); // Slice off node and script path
|