polylith 0.1.39 → 0.1.41

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 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();
@@ -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 act on
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
 
package/bin/utils.js CHANGED
@@ -11,8 +11,8 @@ import {cwd} from 'node:process';
11
11
  * @returns {String} the new path
12
12
  */
13
13
  export function forceToPosix(src) {
14
- src = src.replace('file:', '');
15
- src = src.replace('///', '');
14
+ src = src.replace('file:', '/');
15
+ src = src.replace('///', '/');
16
16
  src = src.replace(/.*?:/, '');
17
17
  src = src.replace(/\\/g, '/');
18
18
 
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "polylith",
3
- "version": "0.1.39",
3
+ "version": "0.1.41",
4
4
  "description": "cli for the polylith environment",
5
5
  "bin": {
6
6
  "polylith": "bin/polylith.js"
7
7
  },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/Ondoher/polylith",
11
+ "directory": "packages/polylith"
12
+ },
8
13
  "scripts": {
9
14
  "test": "echo \"Error: no test specified\" && exit 1"
10
15
  },