polylith 0.1.38 → 0.1.40
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/bin/apps.js +7 -2
- package/bin/instructions.txt +3 -2
- package/bin/polylith.js +5 -1
- package/package.json +1 -1
package/bin/apps.js
CHANGED
|
@@ -115,11 +115,10 @@ async function walkApps(name, config, options, cb) {
|
|
|
115
115
|
let app = await getApp(spec, options);
|
|
116
116
|
if (!app) continue;
|
|
117
117
|
|
|
118
|
-
if (await cb(app)) apps.push(app)
|
|
118
|
+
if (!cb || await cb(app)) apps.push(app)
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
return apps;
|
|
122
|
-
|
|
123
122
|
}
|
|
124
123
|
|
|
125
124
|
/**
|
|
@@ -163,6 +162,12 @@ export async function run(name, config, options) {
|
|
|
163
162
|
await server({...options, apps: apps});
|
|
164
163
|
}
|
|
165
164
|
|
|
165
|
+
export async function serve(name, config, options) {
|
|
166
|
+
var apps = await walkApps(name, config, options);
|
|
167
|
+
|
|
168
|
+
await server({...options, apps: apps});
|
|
169
|
+
}
|
|
170
|
+
|
|
166
171
|
export async function test(name, config, options) {
|
|
167
172
|
var apps = await walkApps(name, config, options, async function(app) {
|
|
168
173
|
return await app.test();
|
package/bin/instructions.txt
CHANGED
|
@@ -15,6 +15,7 @@ polylith watch builds and runs the specified app in dev mode. If no app
|
|
|
15
15
|
is specified it will run the default app. Dev mode will
|
|
16
16
|
monitor source for file changes and then rebuild and
|
|
17
17
|
reload the page with those changes.
|
|
18
|
+
polylith serve runs the currently built application
|
|
18
19
|
|
|
19
20
|
Parameters:
|
|
20
21
|
app for build, clear, run and dev, if this parameter is not
|
|
@@ -34,8 +35,8 @@ Options:
|
|
|
34
35
|
application in a subdirectory of src, and set src/<app>
|
|
35
36
|
as the source root. It will also set the destination to
|
|
36
37
|
be dist/<app>.
|
|
37
|
-
--all, -a when used with build, clear, run or dev this will
|
|
38
|
-
all apps.
|
|
38
|
+
--all, -a when used with build, serve, clear, run or dev this will
|
|
39
|
+
act on all apps.
|
|
39
40
|
--help, -h display this file
|
|
40
41
|
--react, -r create a new react app, or setup the initial project as
|
|
41
42
|
a react app. This is the default. use --react false to
|
package/bin/polylith.js
CHANGED
|
@@ -7,7 +7,7 @@ import { promisify } from 'node:util';
|
|
|
7
7
|
import child_process from 'node:child_process';
|
|
8
8
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
9
9
|
import { processManifest } from './templates.js';
|
|
10
|
-
import { watch, build, test, run } from './apps.js';
|
|
10
|
+
import { watch, build, test, run, serve } from './apps.js';
|
|
11
11
|
|
|
12
12
|
var exec = promisify(child_process.exec);
|
|
13
13
|
var argv = minimist(process.argv.slice(2))
|
|
@@ -442,6 +442,10 @@ async function execute() {
|
|
|
442
442
|
case 'run': {
|
|
443
443
|
await run(params[1], config, clOptions)
|
|
444
444
|
}
|
|
445
|
+
|
|
446
|
+
case 'serve' : {
|
|
447
|
+
await serve(params[1], config, clOptions)
|
|
448
|
+
}
|
|
445
449
|
}
|
|
446
450
|
}
|
|
447
451
|
|