polylith 0.1.53 → 0.1.55
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 +14 -14
- package/bin/apps.js +3 -2
- package/bin/instructions.txt +2 -0
- package/bin/polylith.js +2 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -9,21 +9,21 @@ will be explained below.
|
|
|
9
9
|
## Rollup vs Webpack
|
|
10
10
|
|
|
11
11
|
Because of the specific requirements of building the application,
|
|
12
|
-
[Rollup](https://www.npmjs.com/package/rollup)
|
|
12
|
+
[Rollup](https://www.npmjs.com/package/rollup) is used as the core of the
|
|
13
13
|
build system rather than Webpack. These requirements include the creation of
|
|
14
|
-
synthetic modules and the automatic creation of chunks based on
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
synthetic modules and the automatic creation of chunks based on dependencies
|
|
15
|
+
shared between files that can be loaded dynamically. It also does tree shaking
|
|
16
|
+
to remove unused code.
|
|
17
17
|
|
|
18
|
-
The configuration of a build is
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
The configuration of a build is high-level, focused on how the application is
|
|
19
|
+
constructed rather than the technology used. A build can be specified as either
|
|
20
|
+
a .json file, or though code.
|
|
21
21
|
|
|
22
22
|
## Command Line Interface
|
|
23
23
|
|
|
24
|
-
There is a command line interface for building and running
|
|
25
|
-
This can be installed globally to be run from the command line, and
|
|
26
|
-
to be accessed through npm scripts. To access this from the command line
|
|
24
|
+
There is a command line interface for building and running a polylith
|
|
25
|
+
application. This can be installed globally to be run from the command line, and
|
|
26
|
+
locally to be accessed through npm scripts. To access this from the command line
|
|
27
27
|
install the module polylith globally, like this:
|
|
28
28
|
|
|
29
29
|
`npm install -g polylith`
|
|
@@ -61,9 +61,9 @@ should not need to be updated.
|
|
|
61
61
|
|
|
62
62
|
## Services
|
|
63
63
|
|
|
64
|
-
Services are the core of
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
Services are the core of polylith, and the code necessary to implement and use
|
|
65
|
+
them is defined in the module @polylith/core. This module exports four things:
|
|
66
|
+
Service, Registry, registry, makeEventable.
|
|
67
67
|
|
|
68
68
|
### ServiceObject
|
|
69
69
|
|
|
@@ -71,7 +71,7 @@ An instance of ServiceObject is the external representation of a service as
|
|
|
71
71
|
retrieved from the registry. An object of this type is a different than the
|
|
72
72
|
implementation of the service, which extends the class Service.
|
|
73
73
|
ServiceObject is not exported from the core and cannot be directly created.
|
|
74
|
-
|
|
74
|
+
A ServiceObject is at its heart an EventBus. Use the methods, listen,
|
|
75
75
|
unlisten and firefor handling events from the service object. In principle,
|
|
76
76
|
all methods on a service are implemented as events, although for
|
|
77
77
|
performance reasons, under most circumstances, they will also be added as
|
package/bin/apps.js
CHANGED
|
@@ -143,7 +143,7 @@ export async function build(name, config, options, watch) {
|
|
|
143
143
|
async function server(options) {
|
|
144
144
|
var server = new PolylithServer(options, options.dest);
|
|
145
145
|
await server.create(options.apps);
|
|
146
|
-
|
|
146
|
+
server.start(options.port || '8081');
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
export async function watch(name, config, options) {
|
|
@@ -153,7 +153,8 @@ export async function watch(name, config, options) {
|
|
|
153
153
|
await app.watch();
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
if (options.serve)
|
|
157
|
+
await server({...options, apps: apps});
|
|
157
158
|
}
|
|
158
159
|
|
|
159
160
|
export async function run(name, config, options) {
|
package/bin/instructions.txt
CHANGED
package/bin/polylith.js
CHANGED
|
@@ -24,6 +24,7 @@ var clOptions = {
|
|
|
24
24
|
index: true,
|
|
25
25
|
react: true,
|
|
26
26
|
watch: false,
|
|
27
|
+
serve: true,
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
var thisDir = path.dirname(forceToPosix(import.meta.url));
|
|
@@ -170,6 +171,7 @@ async function getOptions() {
|
|
|
170
171
|
clOptions.index = getOption('index', 'i')
|
|
171
172
|
clOptions.react = getOption('react', 'r')
|
|
172
173
|
clOptions.watch = getOption('watch', 'w')
|
|
174
|
+
clOptions.serve = getOption('serve', 'v')
|
|
173
175
|
|
|
174
176
|
// force multiple if we already have more than one app;
|
|
175
177
|
if (config.apps && config.apps.length > 1) clOptions.multiple = true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polylith",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.55",
|
|
4
4
|
"description": "cli for the polylith environment",
|
|
5
5
|
"bin": {
|
|
6
6
|
"polylith": "bin/polylith.js"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"author": "Glenn Anderson",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@polylith/builder": "0.2.
|
|
20
|
+
"@polylith/builder": "0.2.10",
|
|
21
21
|
"@polylith/server": "0.1.17",
|
|
22
22
|
"fs-extra": "^10.1.0",
|
|
23
23
|
"minimist": "^1.2.7"
|