piral-cli-webpack5 0.14.0-unstable.3065 → 0.14.1-beta.3244

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 (75) hide show
  1. package/README.md +20 -0
  2. package/extend-config.js +57 -15
  3. package/lib/actions.js +6 -40
  4. package/lib/actions.js.map +1 -1
  5. package/lib/enhancers/html5-entry-webpack-config-enhancer/helpers.d.ts +1 -1
  6. package/lib/enhancers/html5-entry-webpack-config-enhancer/helpers.js.map +1 -1
  7. package/lib/enhancers/html5-entry-webpack-config-enhancer/index.js.map +1 -1
  8. package/lib/enhancers/pilet-webpack-config-enhancer/index.js +20 -2
  9. package/lib/enhancers/pilet-webpack-config-enhancer/index.js.map +1 -1
  10. package/lib/helpers.d.ts +1 -1
  11. package/lib/{configs → plugins}/SheetPlugin.d.ts +3 -1
  12. package/lib/plugins/SheetPlugin.js +44 -0
  13. package/lib/plugins/SheetPlugin.js.map +1 -0
  14. package/lib/webpack/bundler-run.d.ts +2 -21
  15. package/lib/webpack/bundler-run.js +44 -44
  16. package/lib/webpack/bundler-run.js.map +1 -1
  17. package/lib/{configs → webpack}/common.d.ts +0 -0
  18. package/lib/{configs → webpack}/common.js +3 -2
  19. package/lib/webpack/common.js.map +1 -0
  20. package/lib/webpack/pilet.d.ts +19 -0
  21. package/lib/{configs → webpack}/pilet.js +19 -3
  22. package/lib/webpack/pilet.js.map +1 -0
  23. package/lib/webpack/piral.d.ts +16 -0
  24. package/lib/{configs → webpack}/piral.js +21 -3
  25. package/lib/{configs → webpack}/piral.js.map +1 -1
  26. package/package.json +8 -8
  27. package/src/actions.ts +6 -21
  28. package/src/enhancers/html5-entry-webpack-config-enhancer/helpers.ts +1 -1
  29. package/src/enhancers/html5-entry-webpack-config-enhancer/index.ts +20 -21
  30. package/src/enhancers/pilet-webpack-config-enhancer/index.ts +27 -2
  31. package/src/helpers.ts +1 -1
  32. package/src/plugins/SheetPlugin.ts +46 -0
  33. package/src/webpack/bundler-run.ts +49 -55
  34. package/src/{configs → webpack}/common.ts +3 -2
  35. package/src/{configs → webpack}/pilet.ts +32 -1
  36. package/src/{configs → webpack}/piral.ts +32 -1
  37. package/lib/configs/SheetPlugin.js +0 -23
  38. package/lib/configs/SheetPlugin.js.map +0 -1
  39. package/lib/configs/common.js.map +0 -1
  40. package/lib/configs/index.d.ts +0 -2
  41. package/lib/configs/index.js +0 -15
  42. package/lib/configs/index.js.map +0 -1
  43. package/lib/configs/pilet.d.ts +0 -3
  44. package/lib/configs/pilet.js.map +0 -1
  45. package/lib/configs/piral.d.ts +0 -2
  46. package/lib/webpack/bundler-calls.d.ts +0 -3
  47. package/lib/webpack/bundler-calls.js +0 -93
  48. package/lib/webpack/bundler-calls.js.map +0 -1
  49. package/lib/webpack/index.d.ts +0 -1
  50. package/lib/webpack/index.js +0 -14
  51. package/lib/webpack/index.js.map +0 -1
  52. package/lib/webpack/run-build-pilet.d.ts +0 -1
  53. package/lib/webpack/run-build-pilet.js +0 -53
  54. package/lib/webpack/run-build-pilet.js.map +0 -1
  55. package/lib/webpack/run-build-piral.d.ts +0 -1
  56. package/lib/webpack/run-build-piral.js +0 -56
  57. package/lib/webpack/run-build-piral.js.map +0 -1
  58. package/lib/webpack/run-debug-mono-piral.d.ts +0 -1
  59. package/lib/webpack/run-debug-mono-piral.js +0 -61
  60. package/lib/webpack/run-debug-mono-piral.js.map +0 -1
  61. package/lib/webpack/run-debug-pilet.d.ts +0 -1
  62. package/lib/webpack/run-debug-pilet.js +0 -77
  63. package/lib/webpack/run-debug-pilet.js.map +0 -1
  64. package/lib/webpack/run-debug-piral.d.ts +0 -1
  65. package/lib/webpack/run-debug-piral.js +0 -76
  66. package/lib/webpack/run-debug-piral.js.map +0 -1
  67. package/src/configs/SheetPlugin.ts +0 -21
  68. package/src/configs/index.ts +0 -2
  69. package/src/webpack/bundler-calls.ts +0 -107
  70. package/src/webpack/index.ts +0 -1
  71. package/src/webpack/run-build-pilet.ts +0 -84
  72. package/src/webpack/run-build-piral.ts +0 -82
  73. package/src/webpack/run-debug-mono-piral.ts +0 -65
  74. package/src/webpack/run-debug-pilet.ts +0 -95
  75. package/src/webpack/run-debug-piral.ts +0 -84
@@ -1,3 +0,0 @@
1
- import { Bundler, BaseBundleParameters } from 'piral-cli';
2
- export declare function callDynamic<T extends BaseBundleParameters>(name: string, args: T): Promise<Bundler>;
3
- export declare function callStatic<T extends BaseBundleParameters>(name: string, args: T): Promise<Bundler>;
@@ -1,93 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.callStatic = exports.callDynamic = void 0;
4
- const path_1 = require("path");
5
- const child_process_1 = require("child_process");
6
- function getPath(name) {
7
- return (0, path_1.resolve)(__dirname, '..', '..', 'lib', 'webpack', `run-${name}.js`);
8
- }
9
- function createBundler(cwd, ps, args) {
10
- let promise = Promise.resolve();
11
- const listeners = [];
12
- const bundle = {
13
- dir: cwd,
14
- hash: '',
15
- name: '',
16
- };
17
- const setPending = () => {
18
- promise = new Promise((done) => {
19
- const f = () => {
20
- done();
21
- bundler.off(f);
22
- };
23
- bundler.on(f);
24
- });
25
- };
26
- const bundler = {
27
- bundle,
28
- start() {
29
- ps.send(Object.assign({ type: 'bundle' }, args));
30
- },
31
- on(cb) {
32
- listeners.push(cb);
33
- },
34
- off(cb) {
35
- listeners.splice(listeners.indexOf(cb), 1);
36
- },
37
- emit(args) {
38
- [...listeners].forEach((cb) => cb(args));
39
- },
40
- ready() {
41
- return promise;
42
- },
43
- setPending,
44
- };
45
- setPending();
46
- return bundler;
47
- }
48
- function callDynamic(name, args) {
49
- const cwd = args.root;
50
- return new Promise((resolve, reject) => {
51
- const ps = (0, child_process_1.fork)(getPath(name), [], { cwd });
52
- const bundler = createBundler(cwd, ps, args);
53
- ps.on('message', (msg) => {
54
- switch (msg.type) {
55
- case 'pending':
56
- bundler.setPending();
57
- break;
58
- case 'update':
59
- bundler.bundle.hash = msg.outHash;
60
- bundler.bundle.name = msg.outName;
61
- bundler.emit(msg.args);
62
- break;
63
- case 'done':
64
- bundler.bundle.dir = msg.outDir;
65
- return resolve(bundler);
66
- case 'fail':
67
- return reject(msg.error);
68
- }
69
- });
70
- ps.send(Object.assign({ type: 'start' }, args));
71
- });
72
- }
73
- exports.callDynamic = callDynamic;
74
- function callStatic(name, args) {
75
- const cwd = args.root;
76
- return new Promise((resolve, reject) => {
77
- const ps = (0, child_process_1.fork)(getPath(name), [], { cwd });
78
- const bundler = createBundler(cwd, ps, args);
79
- ps.on('message', (msg) => {
80
- switch (msg.type) {
81
- case 'done':
82
- bundler.bundle.dir = msg.outDir;
83
- bundler.bundle.name = msg.outFile;
84
- return resolve(bundler);
85
- case 'fail':
86
- return reject(msg.error);
87
- }
88
- });
89
- ps.send(Object.assign({ type: 'start' }, args));
90
- });
91
- }
92
- exports.callStatic = callStatic;
93
- //# sourceMappingURL=bundler-calls.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundler-calls.js","sourceRoot":"","sources":["../../src/webpack/bundler-calls.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,iDAAmD;AAGnD,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,IAAA,cAAO,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,IAAI,KAAK,CAAC,CAAC;AAC5E,CAAC;AAID,SAAS,aAAa,CAAC,GAAW,EAAE,EAAgB,EAAE,IAAS;IAC7D,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAChC,MAAM,SAAS,GAA0B,EAAE,CAAC;IAC5C,MAAM,MAAM,GAAkB;QAC5B,GAAG,EAAE,GAAG;QACR,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,EAAE;KACT,CAAC;IACF,MAAM,UAAU,GAAG,GAAG,EAAE;QACtB,OAAO,GAAG,IAAI,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAC7B,MAAM,CAAC,GAA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BAChC,OAAO,CAAC,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC;oBAClC,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC1B,KAAK,MAAM;oBACT,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;aAC5B;QACH,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,IAAI,iBACL,IAAI,EAAE,OAAO,IACV,IAAI,EACP,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAtBD,gCAsBC"}
@@ -1 +0,0 @@
1
- export * from './bundler-calls';
@@ -1,14 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./bundler-calls"), exports);
14
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webpack/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAgC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,53 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const utils_1 = require("piral-cli/utils");
13
- const path_1 = require("path");
14
- const bundler_run_1 = require("./bundler-run");
15
- const configs_1 = require("../configs");
16
- const helpers_1 = require("../helpers");
17
- const constants_1 = require("../constants");
18
- function run(root, piral, sourceMaps, contentHash, minify, externals, importmap, outDir, outFile, entryModule, version, logLevel) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- (0, utils_1.setStandardEnvs)({
21
- production: true,
22
- piral,
23
- root,
24
- });
25
- const otherConfigPath = (0, path_1.resolve)(root, constants_1.defaultWebpackConfig);
26
- const baseConfig = yield (0, configs_1.getPiletConfig)(entryModule, outDir, outFile, externals, importmap, piral, version, false, sourceMaps, contentHash, minify);
27
- const wpConfig = (0, helpers_1.extendConfig)(baseConfig, otherConfigPath, {
28
- watch: false,
29
- });
30
- const bundler = (0, bundler_run_1.runWebpack)(wpConfig, logLevel);
31
- return yield bundler.bundle();
32
- });
33
- }
34
- process.on('message', (msg) => __awaiter(void 0, void 0, void 0, function* () {
35
- switch (msg.type) {
36
- case 'start':
37
- const result = yield run(process.cwd(), msg.piral, msg.sourceMaps, msg.contentHash, msg.minify, msg.externals, msg.importmap, msg.outDir, msg.outFile, msg.entryModule, msg.version, msg.logLevel).catch((error) => {
38
- process.send({
39
- type: 'fail',
40
- error: error === null || error === void 0 ? void 0 : error.message,
41
- });
42
- });
43
- if (result) {
44
- process.send({
45
- type: 'done',
46
- outDir: result.outDir,
47
- outFile: result.outFile,
48
- });
49
- }
50
- break;
51
- }
52
- }));
53
- //# sourceMappingURL=run-build-pilet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-build-pilet.js","sourceRoot":"","sources":["../../src/webpack/run-build-pilet.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,2CAAkD;AAClD,+BAA+B;AAC/B,+CAA2C;AAC3C,wCAA4C;AAC5C,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,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;gBAChB,OAAO,CAAC,IAAI,CAAC;oBACX,IAAI,EAAE,MAAM;oBACZ,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO;iBACtB,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,IAAI,MAAM,EAAE;gBACV,OAAO,CAAC,IAAI,CAAC;oBACX,IAAI,EAAE,MAAM;oBACZ,MAAM,EAAE,MAAM,CAAC,MAAM;oBACrB,OAAO,EAAE,MAAM,CAAC,OAAO;iBACxB,CAAC,CAAC;aACJ;YAED,MAAM;KACT;AACH,CAAC,CAAA,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,56 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const utils_1 = require("piral-cli/utils");
13
- const path_1 = require("path");
14
- const bundler_run_1 = require("./bundler-run");
15
- const configs_1 = require("../configs");
16
- const helpers_1 = require("../helpers");
17
- const constants_1 = require("../constants");
18
- function run(root, piral, emulator, sourceMaps, contentHash, minify, externals, publicUrl, outDir, entryFiles, logLevel) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- (0, utils_1.setStandardEnvs)({
21
- production: !emulator,
22
- root,
23
- debugPiral: emulator,
24
- debugPilet: emulator,
25
- piral,
26
- dependencies: externals,
27
- });
28
- const otherConfigPath = (0, path_1.resolve)(root, constants_1.defaultWebpackConfig);
29
- const baseConfig = yield (0, configs_1.getPiralConfig)(entryFiles, outDir, externals, emulator, sourceMaps, contentHash, minify, publicUrl);
30
- const wpConfig = (0, helpers_1.extendConfig)(baseConfig, otherConfigPath, {
31
- watch: false,
32
- });
33
- const bundler = (0, bundler_run_1.runWebpack)(wpConfig, logLevel);
34
- return bundler.bundle();
35
- });
36
- }
37
- process.on('message', (msg) => __awaiter(void 0, void 0, void 0, function* () {
38
- switch (msg.type) {
39
- case 'start':
40
- const result = yield run(process.cwd(), msg.piral, msg.emulator, msg.sourceMaps, msg.contentHash, msg.minify, msg.externals, msg.publicUrl, msg.outDir, msg.entryFiles, msg.logLevel).catch((error) => {
41
- process.send({
42
- type: 'fail',
43
- error: error === null || error === void 0 ? void 0 : error.message,
44
- });
45
- });
46
- if (result) {
47
- process.send({
48
- type: 'done',
49
- outDir: result.outDir,
50
- outFile: result.outFile,
51
- });
52
- }
53
- break;
54
- }
55
- }));
56
- //# sourceMappingURL=run-build-piral.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-build-piral.js","sourceRoot":"","sources":["../../src/webpack/run-build-piral.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,2CAAkD;AAClD,+BAA+B;AAC/B,+CAA2C;AAC3C,wCAA4C;AAC5C,wCAA0C;AAC1C,4CAAoD;AAEpD,SAAe,GAAG,CAChB,IAAY,EACZ,KAAa,EACb,QAAiB,EACjB,UAAmB,EACnB,WAAoB,EACpB,MAAe,EACf,SAAwB,EACxB,SAAiB,EACjB,MAAc,EACd,UAAkB,EAClB,QAAmB;;QAEnB,IAAA,uBAAe,EAAC;YACd,UAAU,EAAE,CAAC,QAAQ;YACrB,IAAI;YACJ,UAAU,EAAE,QAAQ;YACpB,UAAU,EAAE,QAAQ;YACpB,KAAK;YACL,YAAY,EAAE,SAAS;SACxB,CAAC,CAAC;QAEH,MAAM,eAAe,GAAG,IAAA,cAAO,EAAC,IAAI,EAAE,gCAAoB,CAAC,CAAC;QAC5D,MAAM,UAA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0,0 @@
1
- export {};
@@ -1,61 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const utils_1 = require("piral-cli/utils");
13
- const path_1 = require("path");
14
- const bundler_run_1 = require("./bundler-run");
15
- const helpers_1 = require("../helpers");
16
- const configs_1 = require("../configs");
17
- const constants_1 = require("../constants");
18
- function run(root, piral, hmr, externals, entryFiles, logLevel) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- (0, utils_1.progress)(`Preparing supplied Piral instance ...`);
21
- const outDir = (0, path_1.resolve)(root, 'dist', 'app');
22
- (0, utils_1.setStandardEnvs)({
23
- piral,
24
- dependencies: externals,
25
- production: false,
26
- debugPiral: true,
27
- debugPilet: true,
28
- root,
29
- });
30
- const otherConfigPath = (0, path_1.resolve)(root, constants_1.defaultWebpackConfig);
31
- const hmrPort = hmr ? yield (0, utils_1.getFreePort)(62123) : 0;
32
- const baseConfig = yield (0, configs_1.getPiralConfig)(entryFiles, outDir, externals, true, true, false, false, undefined, hmrPort);
33
- const wpConfig = (0, helpers_1.extendConfig)(baseConfig, otherConfigPath, {
34
- watch: true,
35
- });
36
- const bundler = (0, bundler_run_1.runWebpack)(wpConfig, logLevel);
37
- const bundle = yield bundler.bundle();
38
- (0, utils_1.logReset)();
39
- return bundle;
40
- });
41
- }
42
- process.on('message', (msg) => __awaiter(void 0, void 0, void 0, function* () {
43
- switch (msg.type) {
44
- case 'start':
45
- const result = yield run(process.cwd(), msg.piral, true, msg.externals, msg.entryFiles, msg.logLevel).catch((error) => {
46
- process.send({
47
- type: 'fail',
48
- error: error === null || error === void 0 ? void 0 : error.message,
49
- });
50
- });
51
- if (result) {
52
- process.send({
53
- type: 'done',
54
- outDir: result.outDir,
55
- outFile: result.outFile,
56
- });
57
- }
58
- break;
59
- }
60
- }));
61
- //# sourceMappingURL=run-debug-mono-piral.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-debug-mono-piral.js","sourceRoot":"","sources":["../../src/webpack/run-debug-mono-piral.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,2CAAmF;AACnF,+BAA+B;AAC/B,+CAA2C;AAC3C,wCAA0C;AAC1C,wCAA4C;AAC5C,4CAAoD;AAEpD,SAAe,GAAG,CAChB,IAAY,EACZ,KAAa,EACb,GAAY,EACZ,SAAwB,EACxB,UAAkB,EAClB,QAAmB;;QAEnB,IAAA,gBAAQ,EAAC,uCAAuC,CAAC,CAAC;QAElD,MAAM,MAAM,GAAG,IAAA,cAAO,EAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;QAE5C,IAAA,uBAAe,EAAC;YACd,KAAK;YACL,YAAY,EAAE,SAAS;YACvB,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,IAAI;YAChB,IAAI;SACL,CAAC,CAAC;QAEH,MAAM,eAAe,GAAG,IAAA,cAAO,EAAC,IAAI,EAAE,gCAAoB,CAAC,CAAC;QAC5D,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,MAAM,IAAA,mBAAW,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,MAAM,UAAU,GAAG,MAAM,IAAA,wBAAc,EAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QACrH,MAAM,QAAQ,GAAG,IAAA,sBAAY,EAAC,UAAU,EAAE,eAAe,EAAE;YACzD,KAAK,EAAE,IAAI;SACZ,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,IAAA,wBAAU,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC;QACtC,IAAA,gBAAQ,GAAE,CAAC;QACX,OAAO,MAAM,CAAC;IAChB,CAAC;CAAA;AAED,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,CAAO,GAAG,EAAE,EAAE;IAClC,QAAQ,GAAG,CAAC,IAAI,EAAE;QAChB,KAAK,OAAO;YACV,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CACzG,CAAC,KAAK,EAAE,EAAE;gBACR,OAAO,CAAC,IAAI,CAAC;oBACX,IAAI,EAAE,MAAM;oBACZ,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO;iBACtB,CAAC,CAAC;YACL,CAAC,CACF,CAAC;YAEF,IAAI,MAAM,EAAE;gBACV,OAAO,CAAC,IAAI,CAAC;oBACX,IAAI,EAAE,MAAM;oBACZ,MAAM,EAAE,MAAM,CAAC,MAAM;oBACrB,OAAO,EAAE,MAAM,CAAC,OAAO;iBACxB,CAAC,CAAC;aACJ;YAED,MAAM;KACT;AACH,CAAC,CAAA,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,77 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const utils_1 = require("piral-cli/utils");
13
- const path_1 = require("path");
14
- const bundler_run_1 = require("./bundler-run");
15
- const configs_1 = require("../configs");
16
- const helpers_1 = require("../helpers");
17
- const constants_1 = require("../constants");
18
- function run(root, piral, externals, importmap, entryModule, version, logLevel) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- (0, utils_1.setStandardEnvs)({
21
- piral,
22
- root,
23
- });
24
- const otherConfigPath = (0, path_1.resolve)(root, constants_1.defaultWebpackConfig);
25
- const dist = (0, path_1.resolve)(root, 'dist');
26
- const baseConfig = yield (0, configs_1.getPiletConfig)(entryModule, dist, 'index.js', externals, importmap, piral, version, true, true, true, false);
27
- const wpConfig = (0, helpers_1.extendConfig)(baseConfig, otherConfigPath, {
28
- watch: true,
29
- });
30
- return (0, bundler_run_1.runWebpack)(wpConfig, logLevel);
31
- });
32
- }
33
- let bundler;
34
- process.on('message', (msg) => __awaiter(void 0, void 0, void 0, function* () {
35
- const root = process.cwd();
36
- switch (msg.type) {
37
- case 'bundle':
38
- if (bundler) {
39
- yield bundler.bundle();
40
- bundler.on('buildStart', () => {
41
- process.send({
42
- type: 'pending',
43
- });
44
- });
45
- }
46
- break;
47
- case 'start':
48
- bundler = yield run(root, msg.piral, msg.externals, msg.importmap, msg.entryModule, msg.version, msg.logLevel).catch((error) => {
49
- process.send({
50
- type: 'fail',
51
- error: error === null || error === void 0 ? void 0 : error.message,
52
- });
53
- });
54
- if (bundler) {
55
- bundler.on('bundled', () => __awaiter(void 0, void 0, void 0, function* () {
56
- if (msg.hmr) {
57
- process.send({
58
- type: 'update',
59
- outHash: bundler.mainBundle.entryAsset.hash,
60
- outName: bundler.mainBundle.name.substr(bundler.options.outDir.length),
61
- args: {
62
- requireRef: bundler.mainBundle.requireRef,
63
- version: msg.version,
64
- root,
65
- },
66
- });
67
- }
68
- }));
69
- process.send({
70
- type: 'done',
71
- outDir: bundler.options.outDir,
72
- });
73
- }
74
- break;
75
- }
76
- }));
77
- //# sourceMappingURL=run-debug-pilet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-debug-pilet.js","sourceRoot":"","sources":["../../src/webpack/run-debug-pilet.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,2CAAkD;AAClD,+BAA+B;AAC/B,+CAA2C;AAC3C,wCAA4C;AAC5C,wCAA0C;AAC1C,4CAAoD;AAEpD,SAAe,GAAG,CAChB,IAAY,EACZ,KAAa,EACb,SAAwB,EACxB,SAAkC,EAClC,WAAmB,EACnB,OAA2B,EAC3B,QAAmB;;QAEnB,IAAA,uBAAe,EAAC;YACd,KAAK;YACL,IAAI;SACL,CAAC,CAAC;QAEH,MAAM,eAAe,GAAG,IAAA,cAAO,EAAC,IAAI,EAAE,gCAAoB,CAAC,CAAC;QAC5D,MAAM,IAAI,GAAG,IAAA,cAAO,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACnC,MAAM,UAAU,GAAG,MAAM,IAAA,wBAAc,EACrC,WAAW,EACX,IAAI,EACJ,UAAU,EACV,SAAS,EACT,SAAS,EACT,KAAK,EACL,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,KAAK,CACN,CAAC;QACF,MAAM,QAAQ,GAAG,IAAA,sBAAY,EAAC,UAAU,EAAE,eAAe,EAAE;YACzD,KAAK,EAAE,IAAI;SACZ,CAAC,CAAC;QAEH,OAAO,IAAA,wBAAU,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;CAAA;AAED,IAAI,OAAO,CAAC;AAEZ,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,CAAO,GAAG,EAAE,EAAE;IAClC,MAAM,IAAI,GAAG,OAA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;gBACH,CAAC,CAAA,CAAC,CAAC;gBAEH,OAAO,CAAC,IAAI,CAAC;oBACX,IAAI,EAAE,MAAM;oBACZ,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM;iBAC/B,CAAC,CAAC;aACJ;YAED,MAAM;KACT;AACH,CAAC,CAAA,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,76 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const utils_1 = require("piral-cli/utils");
13
- const path_1 = require("path");
14
- const bundler_run_1 = require("./bundler-run");
15
- const configs_1 = require("../configs");
16
- const helpers_1 = require("../helpers");
17
- const constants_1 = require("../constants");
18
- function run(root, piral, hmr, externals, publicUrl, entryFiles, logLevel) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- (0, utils_1.setStandardEnvs)({
21
- root,
22
- debugPiral: true,
23
- dependencies: externals,
24
- piral,
25
- });
26
- const otherConfigPath = (0, path_1.resolve)(root, constants_1.defaultWebpackConfig);
27
- const dist = (0, path_1.resolve)(root, 'dist');
28
- const hmrPort = hmr ? yield (0, utils_1.getFreePort)(62123) : 0;
29
- const baseConfig = yield (0, configs_1.getPiralConfig)(entryFiles, dist, externals, true, true, false, false, publicUrl, hmrPort);
30
- const wpConfig = (0, helpers_1.extendConfig)(baseConfig, otherConfigPath, {
31
- watch: true,
32
- });
33
- return (0, bundler_run_1.runWebpack)(wpConfig, logLevel);
34
- });
35
- }
36
- let bundler;
37
- process.on('message', (msg) => __awaiter(void 0, void 0, void 0, function* () {
38
- const root = process.cwd();
39
- switch (msg.type) {
40
- case 'bundle':
41
- if (bundler) {
42
- yield bundler.bundle();
43
- bundler.on('buildStart', () => {
44
- process.send({
45
- type: 'pending',
46
- });
47
- });
48
- }
49
- break;
50
- case 'start':
51
- bundler = yield run(root, msg.piral, msg.hmr, msg.externals, msg.publicUrl, msg.entryFiles, msg.logLevel).catch((error) => {
52
- process.send({
53
- type: 'fail',
54
- error: error === null || error === void 0 ? void 0 : error.message,
55
- });
56
- });
57
- if (bundler) {
58
- bundler.on('bundled', () => {
59
- process.send({
60
- type: 'update',
61
- outHash: bundler.mainBundle.entryAsset.hash,
62
- outName: 'index.html',
63
- args: {
64
- root,
65
- },
66
- });
67
- });
68
- process.send({
69
- type: 'done',
70
- outDir: bundler.options.outDir,
71
- });
72
- }
73
- break;
74
- }
75
- }));
76
- //# sourceMappingURL=run-debug-piral.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-debug-piral.js","sourceRoot":"","sources":["../../src/webpack/run-debug-piral.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,2CAA+D;AAC/D,+BAA+B;AAC/B,+CAA2C;AAC3C,wCAA4C;AAC5C,wCAA0C;AAC1C,4CAAoD;AAEpD,SAAe,GAAG,CAChB,IAAY,EACZ,KAAa,EACb,GAAY,EACZ,SAAwB,EACxB,SAAiB,EACjB,UAAkB,EAClB,QAAmB;;QAEnB,IAAA,uBAAe,EAAC;YACd,IAAI;YACJ,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,SAAS;YACvB,KAAK;SACN,CAAC,CAAC;QAEH,MAAM,eAAe,GAAG,IAAA,cAAO,EAAC,IAAI,EAAE,gCAAoB,CAAC,CAAC;QAC5D,MAAM,IAAI,GAAG,IAAA,cAAO,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACnC,MAAM,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,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;iBACtB,CAAC,CAAC;YACL,CAAC,CACF,CAAC;YAEF,IAAI,OAAO,EAAE;gBACX,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;oBACzB,OAAO,CAAC,IAAI,CAAC;wBACX,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI;wBAC3C,OAAO,EAAE,YAAY;wBACrB,IAAI,EAAE;4BACJ,IAAI;yBACL;qBACF,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;gBAEH,OAAO,CAAC,IAAI,CAAC;oBACX,IAAI,EAAE,MAAM;oBACZ,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM;iBAC/B,CAAC,CAAC;aACJ;YAED,MAAM;KACT;AACH,CAAC,CAAA,CAAC,CAAC"}
@@ -1,21 +0,0 @@
1
- import InjectPlugin from 'webpack-inject-plugin';
2
-
3
- function sheetLoader(cssName: string) {
4
- return () => {
5
- const lines = [
6
- `var d=document`,
7
- `var e=d.createElement("link")`,
8
- `e.type="text/css"`,
9
- `e.rel="stylesheet"`,
10
- `e.href=__webpack_public_path__ + ${JSON.stringify(cssName)}`,
11
- `d.head.appendChild(e)`,
12
- ];
13
- return lines.join(';');
14
- };
15
- }
16
-
17
- export default class SheetPlugin extends InjectPlugin {
18
- constructor(cssName: string) {
19
- super(sheetLoader(cssName));
20
- }
21
- }
@@ -1,2 +0,0 @@
1
- export * from './pilet';
2
- export * from './piral';
@@ -1,107 +0,0 @@
1
- import { resolve } from 'path';
2
- import { fork, ChildProcess } from 'child_process';
3
- import { Bundler, BundleDetails, BaseBundleParameters } from 'piral-cli';
4
-
5
- function getPath(name: string) {
6
- return resolve(__dirname, '..', '..', 'lib', 'webpack', `run-${name}.js`);
7
- }
8
-
9
- type BundleListener = (args: any) => void;
10
-
11
- function createBundler(cwd: string, ps: ChildProcess, args: any) {
12
- let promise = Promise.resolve();
13
- const listeners: Array<BundleListener> = [];
14
- const bundle: BundleDetails = {
15
- dir: cwd,
16
- hash: '',
17
- name: '',
18
- };
19
- const setPending = () => {
20
- promise = new Promise((done) => {
21
- const f = () => {
22
- done();
23
- bundler.off(f);
24
- };
25
- bundler.on(f);
26
- });
27
- };
28
- const bundler = {
29
- bundle,
30
- start() {
31
- ps.send({
32
- type: 'bundle',
33
- ...args,
34
- });
35
- },
36
- on(cb: BundleListener) {
37
- listeners.push(cb);
38
- },
39
- off(cb: BundleListener) {
40
- listeners.splice(listeners.indexOf(cb), 1);
41
- },
42
- emit(args: any) {
43
- [...listeners].forEach((cb) => cb(args));
44
- },
45
- ready() {
46
- return promise;
47
- },
48
- setPending,
49
- };
50
- setPending();
51
- return bundler;
52
- }
53
-
54
- export function callDynamic<T extends BaseBundleParameters>(name: string, args: T) {
55
- const cwd = args.root;
56
- return new Promise<Bundler>((resolve, reject) => {
57
- const ps = fork(getPath(name), [], { cwd });
58
- const bundler = createBundler(cwd, ps, args);
59
-
60
- ps.on('message', (msg: any) => {
61
- switch (msg.type) {
62
- case 'pending':
63
- bundler.setPending();
64
- break;
65
- case 'update':
66
- bundler.bundle.hash = msg.outHash;
67
- bundler.bundle.name = msg.outName;
68
- bundler.emit(msg.args);
69
- break;
70
- case 'done':
71
- bundler.bundle.dir = msg.outDir;
72
- return resolve(bundler);
73
- case 'fail':
74
- return reject(msg.error);
75
- }
76
- });
77
-
78
- ps.send({
79
- type: 'start',
80
- ...args,
81
- });
82
- });
83
- }
84
-
85
- export function callStatic<T extends BaseBundleParameters>(name: string, args: T) {
86
- const cwd = args.root;
87
- return new Promise<Bundler>((resolve, reject) => {
88
- const ps = fork(getPath(name), [], { cwd });
89
- const bundler = createBundler(cwd, ps, args);
90
-
91
- ps.on('message', (msg: any) => {
92
- switch (msg.type) {
93
- case 'done':
94
- bundler.bundle.dir = msg.outDir;
95
- bundler.bundle.name = msg.outFile;
96
- return resolve(bundler);
97
- case 'fail':
98
- return reject(msg.error);
99
- }
100
- });
101
-
102
- ps.send({
103
- type: 'start',
104
- ...args,
105
- });
106
- });
107
- }
@@ -1 +0,0 @@
1
- export * from './bundler-calls';