polylith 0.1.3 → 0.1.5
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/app/manifest.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"files": [
|
|
3
3
|
{"when": "code", "path": "{builds}/{app}.js", "template": "build.js.txt"},
|
|
4
4
|
{"when-not": "code", "path": "{builds}/{app}.json", "template": "build.json"},
|
|
5
|
-
{"path": "{src}
|
|
6
|
-
{"when-not": "react", "path": "{src}
|
|
7
|
-
{"when": "react", "path": "{src}
|
|
8
|
-
{"when": "react", "path": "{src}
|
|
9
|
-
{"when": "react", "path": "{src}
|
|
5
|
+
{"path": "{src}{path}/templates/index.html", "template": "template.html"},
|
|
6
|
+
{"when-not": "react", "path": "{src}{path}/index.js", "template": "index.js"},
|
|
7
|
+
{"when": "react", "path": "{src}{path}/index.js", "template": "index-react.js"},
|
|
8
|
+
{"when": "react", "path": "{src}{path}/main/main.jsx", "template": "main.js"},
|
|
9
|
+
{"when": "react", "path": "{src}{path}/main/App.jsx", "template": "app.jsx.txt"}
|
|
10
10
|
]
|
|
11
11
|
}
|
|
@@ -5,7 +5,7 @@ var projectRoot = path.join(utils.fileToPath(import.meta.url), '../');
|
|
|
5
5
|
class {App}App extends App {
|
|
6
6
|
constructor() {
|
|
7
7
|
super('{app}', projectRoot, '{path}{src}/index.js', '{dest}');
|
|
8
|
-
this.setHtmlTemplate('{path}{src}/index.html', '{dest}
|
|
8
|
+
this.setHtmlTemplate('{path}/{src}/index.html', '{dest}{path}/index.html');
|
|
9
9
|
this.addResources('', [
|
|
10
10
|
{
|
|
11
11
|
"dest": "styles",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "{app}",
|
|
3
|
-
"dest": "{dest}
|
|
4
|
-
"source": "{src}
|
|
5
|
-
"index": "{src}
|
|
3
|
+
"dest": "{dest}{path}",
|
|
4
|
+
"source": "{src}{path}",
|
|
5
|
+
"index": "{src}{path}index.js",
|
|
6
6
|
"template": {
|
|
7
|
-
"source": "{src}
|
|
8
|
-
"destination": "{dest}
|
|
7
|
+
"source": "{src}{path}/templates/index.html",
|
|
8
|
+
"destination": "{dest}{path}/index.html"
|
|
9
9
|
},
|
|
10
10
|
"resources": [
|
|
11
11
|
{
|
package/bin/apps.js
CHANGED
|
@@ -87,8 +87,6 @@ async function getApp(spec, options) {
|
|
|
87
87
|
var filename = path.join(buildPath, spec.filename);
|
|
88
88
|
var app;
|
|
89
89
|
|
|
90
|
-
this.options = options;
|
|
91
|
-
|
|
92
90
|
if (!spec.code) {
|
|
93
91
|
var config = await(readJson(filename));
|
|
94
92
|
if (!config) return false;
|
|
@@ -136,10 +134,9 @@ export async function build(name, config, options, watch) {
|
|
|
136
134
|
}
|
|
137
135
|
|
|
138
136
|
|
|
139
|
-
async function server(apps) {
|
|
140
|
-
var
|
|
141
|
-
|
|
142
|
-
server.create();
|
|
137
|
+
async function server(apps, options) {
|
|
138
|
+
var server = new PolylithServer({apps: apps}, options.dest);
|
|
139
|
+
await server.create();
|
|
143
140
|
server.start(options.port || '8081');
|
|
144
141
|
}
|
|
145
142
|
|
|
@@ -150,5 +147,5 @@ export async function watch(name, config, options) {
|
|
|
150
147
|
app.watch();
|
|
151
148
|
}
|
|
152
149
|
|
|
153
|
-
server(apps);
|
|
150
|
+
server(apps, options);
|
|
154
151
|
}
|
package/bin/polylith.js
CHANGED
|
@@ -300,7 +300,7 @@ function getNames(params) {
|
|
|
300
300
|
names.builds = OPTIONS.builds;
|
|
301
301
|
names.src = OPTIONS.src;
|
|
302
302
|
names.react = OPTIONS.react;
|
|
303
|
-
names.path = OPTIONS.multiple ?
|
|
303
|
+
names.path = OPTIONS.multiple ? '/' + app : '';
|
|
304
304
|
|
|
305
305
|
return names;
|
|
306
306
|
}
|