@aj-shadow/z-build-project 0.0.0-aj-beta.227 → 0.0.0-aj-beta.236

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.
Files changed (40) hide show
  1. package/npm-shrinkwrap.json +3 -3
  2. package/package.json +4 -4
  3. package/project/server/bottleneck-queue.js +1 -1
  4. package/project/server/build-all.js +1 -1
  5. package/project/server/build-client-bundle.js +14 -12
  6. package/project/server/build-client-js.js +6 -4
  7. package/project/server/build-client-jsx.js +5 -4
  8. package/project/server/build-client-rc-bundle.js +4 -4
  9. package/project/server/build-server-js.js +5 -4
  10. package/project/server/build-server-rc.js +4 -4
  11. package/project/server/build.js +194 -17
  12. package/project/server/child-build-data.js +1 -1
  13. package/project/server/child-client-bundle.js +215 -218
  14. package/project/server/child-client-js.js +87 -94
  15. package/project/server/child-client-jsx.js +7 -46
  16. package/project/server/child-client-rc-bundle.js +4 -3
  17. package/project/server/child-macro.js +76 -0
  18. package/project/server/child-path-resolver.js +176 -0
  19. package/project/server/child-server-js.js +6 -39
  20. package/project/server/child-server-rc.js +4 -3
  21. package/project/server/git-global.js +1 -1
  22. package/project/server/git-tasks.js +1 -1
  23. package/project/server/log.js +18 -8
  24. package/project/server/new 1.txt +4 -0
  25. package/project/server/npm-install-all.js +1 -1
  26. package/project/server/pendings.js +1 -1
  27. package/project/server/process.js +1 -1
  28. package/project/server/project.js +1 -1
  29. package/project/server/repo-manager.js +1 -1
  30. package/project/server/service/commands.js +1 -1
  31. package/project/server/task-clean.js +1 -1
  32. package/project/server/task-list.js +1 -1
  33. package/project/server/task-runner-glob.js +1 -1
  34. package/project/server/task-runner.js +13 -31
  35. package/project/server/task-simple.js +1 -1
  36. package/project/server/task.js +1 -1
  37. package/project/server/workspace.js +4 -4
  38. package/project/z-build-project.tree +2 -0
  39. package/LICENSE.txt +0 -96
  40. package/package_release.json +0 -26
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@aj-shadow/z-build-project",
3
- "version": "0.0.0-aj-beta.227",
3
+ "version": "0.0.0-aj-beta.236",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@aj-shadow/z-build-project",
9
- "version": "0.0.0-aj-beta.227",
10
- "license": "SEE LICENSE IN LICENSE.txt"
9
+ "version": "0.0.0-aj-beta.236",
10
+ "license": "MIT"
11
11
  }
12
12
  }
13
13
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@aj-shadow/z-build-project",
3
- "version": "0.0.0-aj-beta.227",
3
+ "version": "0.0.0-aj-beta.236",
4
4
  "release-step": "delivery",
5
5
  "description": "Library used by @actorjs/actorjs",
6
6
  "author": "ActorJs",
7
- "license": "SEE LICENSE IN LICENSE.txt",
8
- "dependencies": {},
9
- "repository": "https://gitlab.com/actorjs-shadow-delivery-public/z-build-project.git"
7
+ "license": "MIT",
8
+ "repository": "https://gitlab.com/actorjs-shadow-delivery-public/z-build-project.git",
9
+ "dependencies": {}
10
10
  }
@@ -1,5 +1,5 @@
1
1
 
2
- 'use strict';
2
+ // SPDX-License-Identifier: MIT; Copyright (c) 2026 Hagnell Konsulting AB
3
3
 
4
4
 
5
5
  class BottleneckQueue {
@@ -1,5 +1,5 @@
1
1
 
2
- 'use strict';
2
+ // SPDX-License-Identifier: MIT; Copyright (c) 2026 Hagnell Konsulting AB
3
3
 
4
4
  const Log = require('./log');
5
5
  const Workspace = require('./workspace');
@@ -1,5 +1,5 @@
1
1
 
2
- 'use strict';
2
+ // SPDX-License-Identifier: MIT; Copyright (c) 2026 Hagnell Konsulting AB
3
3
 
4
4
  const Build = require('./build');
5
5
  const Log = require('./log');
@@ -9,17 +9,18 @@ const Fs = require('fs');
9
9
 
10
10
 
11
11
  class BuildClientBundle extends Build {
12
- constructor(appName, layer, part, source, dest, ignores, externals, externalGlobs, exports, exportSource, shim) {
13
- super(appName, `Bundle:${layer}Layer/${part}`, __filename, source, dest);
12
+ constructor(appName, folderName, layer, part, source, dest, ignores, maps, exports, allowRequire, entryFiles, externalsGlobMap, externalsMap) {
13
+ super(appName, folderName, `Bundle:${layer}Layer/${part}`, __filename, source, dest);
14
14
  this.layer = layer;
15
15
  this.part = part;
16
16
  this.bundleName = `${layer}Layer-${part}.js`;
17
17
  this.ignores = ignores;
18
- this.externals = externals;
19
- this.externalGlobs = externalGlobs;
18
+ this.maps = maps;
20
19
  this.exports = exports;
21
- this.exportSource = exportSource;
22
- this.shim = shim;
20
+ this.allowRequire = allowRequire;
21
+ this.entryFiles = entryFiles;
22
+ this.externalsGlobMap = Array.from(externalsGlobMap);
23
+ this.externalsMap = Array.from(externalsMap);
23
24
  this.buildEnv = 'development' === Reflect.get(global, 'release-data@actorjs_global').env ? 0 : 1;
24
25
  }
25
26
 
@@ -30,11 +31,12 @@ class BuildClientBundle extends Build {
30
31
  source: this.source,
31
32
  dest: this.dest,
32
33
  ignores: this.ignores,
33
- externals: this.externals,
34
- externalGlobs: this.externalGlobs,
34
+ maps: this.maps,
35
35
  exports: this.exports,
36
- exportSource: this.exportSource,
37
- shim: this.shim
36
+ allowRequire: this.allowRequire,
37
+ entryFiles: this.entryFiles,
38
+ externalsGlobMap: this.externalsGlobMap,
39
+ externalsMap: this.externalsMap,
38
40
  };
39
41
  }
40
42
 
@@ -56,7 +58,7 @@ class BuildClientBundle extends Build {
56
58
 
57
59
  execute(retries, code, cb) {
58
60
  if(2 >= retries) {
59
- const childProcess = ChildProcess.fork(require.resolve('./child-client-bundle.js'), [JSON.stringify([this.appName, this.name, this.silent, this.bundleName, this.source, this.dest, this.ignores, this.externals, this.externalGlobs, this.exports, this.exportSource, this.shim, process.env.NODE_ENV, this.buildEnv])], {execArgv: []});
61
+ const childProcess = ChildProcess.fork(require.resolve('./child-client-bundle.js'), [JSON.stringify([this.appName, this.folderName, this.name, this.silent, this.bundleName, this.source, this.dest, this.ignores, this.maps, this.exports, this.allowRequire, this.entryFiles, this.externalsGlobMap, this.externalsMap, process.env.NODE_ENV, this.buildEnv])], {execArgv: []});
60
62
  let done = false;
61
63
  childProcess.on('exit', (code) => {
62
64
  if(!done) {
@@ -1,5 +1,5 @@
1
1
 
2
- 'use strict';
2
+ // SPDX-License-Identifier: MIT; Copyright (c) 2026 Hagnell Konsulting AB
3
3
 
4
4
  const Build = require('./build');
5
5
  const Log = require('./log');
@@ -9,10 +9,11 @@ const Clc = require('cli-color');
9
9
 
10
10
 
11
11
  class BuildClientJs extends Build {
12
- constructor(appName, layer, part, source, dest) {
13
- super(appName, `Client:${layer}Layer/${part}`, __filename, source, dest);
12
+ constructor(appName, folderName, layer, part, source, dest) {
13
+ super(appName, folderName, `Client:${layer}Layer/${part}`, __filename, source, dest);
14
14
  this.layer = layer;
15
15
  this.part = part;
16
+ this.destFolder = 'App' === this.layer ? `${layer}Layer-${part}` : '';
16
17
  }
17
18
 
18
19
  saveData() {
@@ -30,7 +31,7 @@ class BuildClientJs extends Build {
30
31
 
31
32
  execute(retries, code, cb) {
32
33
  if(2 >= retries) {
33
- const childProcess = ChildProcess.fork(require.resolve('./child-client-js.js'), [JSON.stringify([this.appName, this.name, this.silent, this.repo, this.source, this.dest, process.env.NODE_ENV])], {execArgv: []});
34
+ const childProcess = ChildProcess.fork(require.resolve('./child-client-js.js'), [JSON.stringify([this.appName, this.folderName, this.name, this.silent, this.repo, this.source, this.dest, this.destFolder, process.env.NODE_ENV])], {execArgv: []});
34
35
  let done = false;
35
36
  childProcess.on('exit', (code) => {
36
37
  if(!done) {
@@ -55,4 +56,5 @@ class BuildClientJs extends Build {
55
56
  }
56
57
  }
57
58
 
59
+
58
60
  module.exports = BuildClientJs;
@@ -1,5 +1,5 @@
1
1
 
2
- 'use strict';
2
+ // SPDX-License-Identifier: MIT; Copyright (c) 2026 Hagnell Konsulting AB
3
3
 
4
4
  const Build = require('./build');
5
5
  const Log = require('./log');
@@ -9,11 +9,12 @@ const Clc = require('cli-color');
9
9
 
10
10
 
11
11
  class BuildClientJsx extends Build {
12
- constructor(appName, layer, part, source, dest) {
13
- super(appName, `Client:${layer}Layer/${part}-jsx`, __filename, source, dest);
12
+ constructor(appName, folderName, layer, part, source, dest) {
13
+ super(appName, folderName, `Client:${layer}Layer/${part}-jsx`, __filename, source, dest);
14
14
  this.layer = layer;
15
15
  this.part = part;
16
16
  this.dest = dest;
17
+ this.destFolder = 'App' === this.layer ? `${layer}Layer-${part}` : '';
17
18
  }
18
19
 
19
20
  saveData() {
@@ -31,7 +32,7 @@ class BuildClientJsx extends Build {
31
32
 
32
33
  execute(retries, code, cb) {
33
34
  if(2 >= retries) {
34
- const childProcess = ChildProcess.fork(require.resolve('./child-client-jsx.js'), [JSON.stringify([this.appName, this.name, this.silent, this.repo, this.source, this.dest, process.env.NODE_ENV])], {execArgv: []});
35
+ const childProcess = ChildProcess.fork(require.resolve('./child-client-jsx.js'), [JSON.stringify([this.appName, this.folderName, this.name, this.silent, this.repo, this.source, this.dest, this.destFolder, process.env.NODE_ENV])], {execArgv: []});
35
36
  let done = false;
36
37
  childProcess.on('exit', (code) => {
37
38
  if(!done) {
@@ -1,5 +1,5 @@
1
1
 
2
- 'use strict';
2
+ // SPDX-License-Identifier: MIT; Copyright (c) 2026 Hagnell Konsulting AB
3
3
 
4
4
  const Build = require('./build');
5
5
  const Log = require('./log');
@@ -9,8 +9,8 @@ const Fs = require('fs');
9
9
 
10
10
 
11
11
  class BuildClientRcBundle extends Build {
12
- constructor(appName, part, source, dest, remove) {
13
- super(appName, `client-css-${part}-bundle`, __filename, source, dest);
12
+ constructor(appName, folderName, part, source, dest, remove) {
13
+ super(appName, folderName, `client-css-${part}-bundle`, __filename, source, dest);
14
14
  this.part = part;
15
15
  this.remove = remove;
16
16
  this.bundleName = `bundle-${part}.css`;
@@ -44,7 +44,7 @@ class BuildClientRcBundle extends Build {
44
44
 
45
45
  execute(retries, code, cb) {
46
46
  if(2 >= retries) {
47
- const childProcess = ChildProcess.fork(require.resolve('./child-client-rc-bundle.js'), [JSON.stringify([this.appName, this.name, this.silent, this.bundleName, this.repo, this.source, this.dest, this.remove, process.env.NODE_ENV, this.buildEnv])], {execArgv: []});
47
+ const childProcess = ChildProcess.fork(require.resolve('./child-client-rc-bundle.js'), [JSON.stringify([this.appName, this.folderName, this.name, this.silent, this.bundleName, this.repo, this.source, this.dest, this.remove, process.env.NODE_ENV, this.buildEnv])], {execArgv: []});
48
48
  let done = false;
49
49
  childProcess.on('exit', (code) => {
50
50
  if(!done) {
@@ -1,5 +1,5 @@
1
1
 
2
- 'use strict';
2
+ // SPDX-License-Identifier: MIT; Copyright (c) 2026 Hagnell Konsulting AB
3
3
 
4
4
  const Build = require('./build');
5
5
  const Log = require('./log');
@@ -9,8 +9,8 @@ const Clc = require('cli-color');
9
9
 
10
10
 
11
11
  class BuildServerJs extends Build {
12
- constructor(appName, layer, part, source, dest, replaceCondition, replaceHandle) {
13
- super(appName, `Server:${layer}Layer/${part}`, __filename, source, dest);
12
+ constructor(appName, folderName, layer, part, source, dest, replaceCondition, replaceHandle) {
13
+ super(appName, folderName, `Server:${layer}Layer/${part}`, __filename, source, dest);
14
14
  this.layer = layer;
15
15
  this.part = part;
16
16
  this.replaceCondition = replaceCondition ? (new RegExp(replaceCondition)).source : null;
@@ -34,7 +34,7 @@ class BuildServerJs extends Build {
34
34
 
35
35
  execute(retries, code, cb) {
36
36
  if(2 >= retries) {
37
- const childProcess = ChildProcess.fork(require.resolve('./child-server-js.js'), [JSON.stringify([this.appName, this.name, this.silent, this.repo, this.source, this.dest, process.env.NODE_ENV, this.replaceCondition, this.replaceHandle])], {execArgv: []});
37
+ const childProcess = ChildProcess.fork(require.resolve('./child-server-js.js'), [JSON.stringify([this.appName, this.folderName, this.name, this.silent, this.repo, this.source, this.dest, process.env.NODE_ENV, this.replaceCondition, this.replaceHandle])], {execArgv: []});
38
38
  let done = false;
39
39
  childProcess.on('exit', (code) => {
40
40
  if(!done) {
@@ -59,4 +59,5 @@ class BuildServerJs extends Build {
59
59
  }
60
60
  }
61
61
 
62
+
62
63
  module.exports = BuildServerJs;
@@ -1,5 +1,5 @@
1
1
 
2
- 'use strict';
2
+ // SPDX-License-Identifier: MIT; Copyright (c) 2026 Hagnell Konsulting AB
3
3
 
4
4
  const Build = require('./build');
5
5
  const Log = require('./log');
@@ -9,8 +9,8 @@ const Fs = require('fs');
9
9
 
10
10
 
11
11
  class BuildServerRc extends Build {
12
- constructor(appName, part, source, dest) {
13
- super(appName, `server-${part}-rc`, __filename, source, dest);
12
+ constructor(appName, folderName, part, source, dest) {
13
+ super(appName, folderName, `server-${part}-rc`, __filename, source, dest);
14
14
  this.part = part;
15
15
  }
16
16
 
@@ -40,7 +40,7 @@ class BuildServerRc extends Build {
40
40
 
41
41
  execute(retries, code, cb) {
42
42
  if(2 >= retries) {
43
- const childProcess = ChildProcess.fork(require.resolve('./child-server-rc.js'), [JSON.stringify([this.appName, this.name, this.silent, this.repo, this.source, this.dest, process.env.NODE_ENV])], {execArgv: []});
43
+ const childProcess = ChildProcess.fork(require.resolve('./child-server-rc.js'), [JSON.stringify([this.appName, this.folderName, this.name, this.silent, this.repo, this.source, this.dest, process.env.NODE_ENV])], {execArgv: []});
44
44
  let done = false;
45
45
  childProcess.on('exit', (code) => {
46
46
  if(!done) {
@@ -1,5 +1,5 @@
1
1
 
2
- 'use strict';
2
+ // SPDX-License-Identifier: MIT; Copyright (c) 2026 Hagnell Konsulting AB
3
3
 
4
4
  const Log = require('./log');
5
5
  const Clc = require('cli-color');
@@ -11,10 +11,19 @@ const Path = require('path');
11
11
  class Build {
12
12
  static runningTasks = 0;
13
13
  static initialBuild = true;
14
-
15
- constructor(appName, name, fileName, source, dest) {
14
+ static BUNDLE_TYPE_CLIENT = 0;
15
+ static BUNDLE_TYPE_CS = 1;
16
+ static BUNDLE_TYPE_TEXT = [
17
+ 'client',
18
+ 'clientServer'
19
+ ];
20
+ static URL_PATH = 'abs-scripts';
21
+ static bundleFiles = new Map();
22
+
23
+ constructor(appName, folderName, name, fileName, source, dest) {
16
24
  this.bottleneckQueue = null;
17
25
  this.appName = appName;
26
+ this.folderName = folderName;
18
27
  this.name = name;
19
28
  this.fileName = name.replace(/[/\\?%*:|"<>]/g, '-');
20
29
  this.requireName = fileName.substring(__dirname.length + 1, fileName.length - '.js'.length);
@@ -86,7 +95,6 @@ class Build {
86
95
  }
87
96
  }
88
97
  if(Array.isArray(this.rawSource)) {
89
- console.log('OLD:', this.name, this.rawSource);
90
98
  this.rawSource.forEach((src) => {
91
99
  if('object' === typeof src) {
92
100
  this.source.push(this._formatSource(organization, src.path) + src.filter);
@@ -100,7 +108,6 @@ class Build {
100
108
  this.addSourceFromObject(organization);
101
109
  }
102
110
  else if('string' === typeof this.rawSource) {
103
- console.log('OLD:', this.name, this.rawSource);
104
111
  this.addSourceFromString(organization);
105
112
  }
106
113
  }
@@ -115,7 +122,135 @@ class Build {
115
122
  }
116
123
  }
117
124
 
118
- static load(appName, fileName, requireName, bottleneckQueue, cb) {
125
+ static findClientBld(clientBldPath, clientBldType, cb) {
126
+ if(null === clientBldPath) {
127
+ return process.nextTick(cb, null);
128
+ }
129
+ Fs.readdir(clientBldPath, (err, files) => {
130
+ let foundBld = null;
131
+ if(err) {
132
+ cb(foundBld);
133
+ }
134
+ else {
135
+ let pendings = files.length;
136
+ let pattern = Build.BUNDLE_TYPE_CLIENT === clientBldType ? /^Bundle-.*-client\.bld$/ : /^Bundle-.*-cs\.bld$/;
137
+ for(let i=0 ; i < files.length; ++i) {
138
+ const f = files[i];
139
+ if(pattern.test(f)) {
140
+ foundBld = `${clientBldPath}${Path.sep}${f}`;
141
+ process.nextTick(cb, foundBld);
142
+ break;
143
+ }
144
+ if(0 === --pendings) {
145
+ process.nextTick(cb, foundBld);
146
+ }
147
+ }
148
+ }
149
+ });
150
+ }
151
+
152
+ static getDependencyData(bundleFileName, cb) {
153
+ if(null === bundleFileName) {
154
+ return cb(null);
155
+ }
156
+ let bundleFileData = this.bundleFiles.get(bundleFileName);
157
+ if(bundleFileData) {
158
+ if(bundleFileData.bundle) {
159
+ process.nextTick((bundle, cb) => {
160
+ cb(`Client:${bundle.layer}Layer/${bundle.part}`, bundle.source.path, bundle.exports, `${bundle.layer}Layer-${bundle.part}`);
161
+ }, bundleFileData.bundle, cb);
162
+ }
163
+ else {
164
+ bundleFileData.cbs.push(cb);
165
+ }
166
+ }
167
+ else {
168
+ bundleFileData = {
169
+ cbs: [],
170
+ bundle: null
171
+ };
172
+ this.bundleFiles.set(bundleFileName, bundleFileData);
173
+ Fs.readFile(bundleFileName, (err, data) => {
174
+ if(err) {
175
+ cb(null);
176
+ }
177
+ else {
178
+ let bundle = null;
179
+ try {
180
+ bundle = JSON.parse(data);
181
+ bundleFileData.bundle = bundle;
182
+ }
183
+ catch(e) {
184
+ return cb(null);
185
+ }
186
+ bundleFileData.cbs.forEach((cb) => {
187
+ process.nextTick((bundleFileData) => {
188
+ cb(`Client:${bundle.layer}Layer/${bundle.part}`, bundle.source.path, bundle.exports, `${bundle.layer}Layer-${bundle.part}`);
189
+ }, bundleFileData);
190
+ });
191
+ cb(`Client:${bundle.layer}Layer/${bundle.part}`, bundle.source.path, bundle.exports, `${bundle.layer}Layer-${bundle.part}`);
192
+ }
193
+ });
194
+ }
195
+ }
196
+
197
+ static createBuild(requireName, appName, folderName, dataObject, parameters, bottleneckQueue, dependencyNames, entryFiles, externalsGlobMap, externalsMap, cb) {
198
+ let build = null;
199
+ try {
200
+ const B = require(`.${Path.sep}` + requireName);
201
+ build = new B(appName, folderName, ...parameters, entryFiles, externalsGlobMap, externalsMap);
202
+ build.setBottleneckQueue(bottleneckQueue);
203
+ build.isBundle = undefined !== dataObject._bundle ? dataObject._bundle : false;
204
+ }
205
+ catch(e) {
206
+ return cb(e);
207
+ }
208
+ cb(null, build, dependencyNames);
209
+ }
210
+
211
+ static addDependencyData(isCurrentFolder, dependency, part, dependencyNames, exportsSet, externalsGlobMap, externalsMap, dependencyMap, cb) {
212
+ let clientBldFile;
213
+ let clientBldType;
214
+ if('AppLayer-client' === dependency) {
215
+ clientBldFile = `.${Path.sep}workspace`;
216
+ clientBldType = Build.BUNDLE_TYPE_CLIENT;
217
+ }
218
+ else if('AppLayer-cs' === dependency) {
219
+ clientBldFile = `.${Path.sep}workspace`;
220
+ clientBldType = Build.BUNDLE_TYPE_CS;
221
+ }
222
+ else {
223
+ clientBldFile = `..${Path.sep}${dependency}${Path.sep}project${Path.sep}${Build.BUNDLE_TYPE_TEXT[part]}${Path.sep}_build`;
224
+ clientBldType = part;
225
+ }
226
+ Build.findClientBld(clientBldFile, clientBldType, (foundBld) => {
227
+ if(foundBld) {
228
+ Build.getDependencyData(foundBld, (dependencyName, externalSourcePath, externals, bundleName) => {
229
+ dependencyMap.set(dependency, bundleName);
230
+ const externalsGlob = `${externalSourcePath}/**/*.js`;
231
+ if(dependencyName) {
232
+ dependencyNames.add(dependencyName);
233
+ }
234
+ if(!isCurrentFolder) {
235
+ if(externalsGlob) {
236
+ externalsGlobMap.set(externalsGlob, bundleName);
237
+ }
238
+ if(0 !== externals.length) {
239
+ for (const item of externals) {
240
+ externalsMap.set(item, bundleName);
241
+ }
242
+ }
243
+ }
244
+ cb();
245
+ });
246
+ }
247
+ else {
248
+ cb();
249
+ }
250
+ });
251
+ }
252
+
253
+ static load(appName, folderName, fileName, requireName, bottleneckQueue, cb) {
119
254
  Fs.readFile(fileName, (err, data) => {
120
255
  if(err) {
121
256
  return cb(err);
@@ -123,22 +258,64 @@ class Build {
123
258
  const dataObject = Build.parseFile(data, fileName);
124
259
  const keys = Reflect.ownKeys(dataObject);
125
260
  const parameters = [];
126
- let dependencyNames = [];
261
+ const parametersNames = [];
262
+ let dependencyNames = new Set();
263
+ const externalsGlobMap = new Map();
264
+ const externalsMap = new Map();
265
+ const dependencyMap = new Map();
266
+ let exports = [];
267
+ const exportsSet = new Set();
127
268
  keys.forEach((key) => {
128
- if('dependencyNames' !== key) {
129
- if(!key.startsWith('_')) {
130
- parameters.push(Reflect.get(dataObject, key));
269
+ if('dependencies' !== key) {
270
+ if('dependencyNames' !== key) {
271
+ if(!key.startsWith('_')) {
272
+ parameters.push(Reflect.get(dataObject, key));
273
+ parametersNames.push(key);
274
+ if('exports' === key) {
275
+ exports = Reflect.get(dataObject, key);
276
+ }
277
+ }
278
+ }
279
+ else {
280
+ for(const item of Reflect.get(dataObject, key)) {
281
+ dependencyNames.add(item);
282
+ }
131
283
  }
132
284
  }
285
+ });
286
+ if(dataObject._bundle) {
287
+ if(dataObject.dependencies && 0 !== dataObject.dependencies.length) {
288
+ let pendings = dataObject.dependencies.length;
289
+ Build.p += pendings;
290
+ dataObject.dependencies.forEach((dependency) => {
291
+ Build.addDependencyData(dependency[0] === folderName, dependency[0], 'cs' === dependency[1] ? Build.BUNDLE_TYPE_CS : Build.BUNDLE_TYPE_CLIENT, dependencyNames, exportsSet, externalsGlobMap, externalsMap, dependencyMap, () => {
292
+ if(0 === --pendings) {
293
+ const appDependencies = folderName === 'AppLayer-client' ? dataObject.dependencies.map(d=>d[0]).reverse() : null;
294
+ const entryFiles = [];
295
+ if(appDependencies) {
296
+ appDependencies.forEach((dependency) => {
297
+ entryFiles.push(dependencyMap.get(dependency));
298
+ });
299
+ }
300
+ Build.createBuild(requireName, appName, folderName, dataObject, parameters, bottleneckQueue, Array.from(dependencyNames), entryFiles, externalsGlobMap, externalsMap, (err, build) => {
301
+ cb(err, build, Array.from(dependencyNames));
302
+ });
303
+ }
304
+ });
305
+ });
306
+ return;
307
+ }
133
308
  else {
134
- dependencyNames = Reflect.get(dataObject, key);
309
+ Build.createBuild(requireName, appName, folderName, dataObject, parameters, bottleneckQueue, Array.from(dependencyNames), null, externalsGlobMap, externalsMap, (err, build) => {
310
+ cb(err, build, Array.from(dependencyNames));
311
+ });
135
312
  }
136
- });
137
- const B = require(`.${Path.sep}` + requireName);
138
- const build = new B(appName, ...parameters);
139
- build.setBottleneckQueue(bottleneckQueue);
140
- build.isBundle = undefined !== dataObject._bundle ? dataObject._bundle : false;
141
- cb(err, build, dependencyNames);
313
+ }
314
+ else {
315
+ Build.createBuild(requireName, appName, folderName, dataObject, parameters, bottleneckQueue, Array.from(dependencyNames), null, externalsGlobMap, externalsMap, (err, build) => {
316
+ cb(err, build, Array.from(dependencyNames));
317
+ });
318
+ }
142
319
  });
143
320
  }
144
321
 
@@ -1,5 +1,5 @@
1
1
 
2
- 'use strict';
2
+ // SPDX-License-Identifier: MIT; Copyright (c) 2026 Hagnell Konsulting AB
3
3
 
4
4
  const Log = require('./log');
5
5
  const TaskRunnerGlob = require('./task-runner-glob');