piral-core 0.14.22-beta.4103 → 0.14.23-beta.4124
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/dependencies.codegen
CHANGED
|
@@ -16,6 +16,7 @@ module.exports = function () {
|
|
|
16
16
|
const appName = process.env.BUILD_PCKG_NAME || '';
|
|
17
17
|
const externals = (process.env.SHARED_DEPENDENCIES || '').split(',').filter(Boolean);
|
|
18
18
|
const assignments = [];
|
|
19
|
+
const imports = [];
|
|
19
20
|
|
|
20
21
|
if (appName) {
|
|
21
22
|
assignments.push(`deps['${appName}']={}`);
|
|
@@ -23,13 +24,14 @@ module.exports = function () {
|
|
|
23
24
|
|
|
24
25
|
for (const name of externals) {
|
|
25
26
|
const identifiers = getIdentifiers(name);
|
|
27
|
+
const ref = `_${imports.length}`;
|
|
28
|
+
imports.push(`import * as ${ref} from ${JSON.stringify(name)}`);
|
|
26
29
|
|
|
27
30
|
for (const id of identifiers) {
|
|
28
|
-
assignments.push(`deps[${JSON.stringify(id)}]
|
|
31
|
+
assignments.push(`deps[${JSON.stringify(id)}]=${ref}`);
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
}`;
|
|
35
|
+
return `${imports.join(';\n')}
|
|
36
|
+
export default function(deps) {${assignments.join(';')}}`;
|
|
35
37
|
};
|
|
@@ -1,32 +1,12 @@
|
|
|
1
1
|
import { isfunc } from 'piral-base';
|
|
2
|
-
import
|
|
2
|
+
import fillDependencies from '../../dependencies.codegen';
|
|
3
3
|
/**
|
|
4
4
|
* The global dependencies, which represent the dependencies
|
|
5
5
|
* shared from the app shell itself.
|
|
6
6
|
*/
|
|
7
7
|
export const globalDependencies = {};
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
if (isfunc(fillDependencies)) {
|
|
11
|
-
fillDependencies(globalDependencies);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
// fall back to the default list if the codegen is invalid / not supported
|
|
15
|
-
__assign(globalDependencies, {
|
|
16
|
-
react: require('react'),
|
|
17
|
-
'react-dom': require('react-dom'),
|
|
18
|
-
'react-router': require('react-router'),
|
|
19
|
-
'react-router-dom': require('react-router-dom'),
|
|
20
|
-
history: require('history'),
|
|
21
|
-
tslib: require('tslib'),
|
|
22
|
-
'path-to-regexp': require('path-to-regexp'),
|
|
23
|
-
'@libre/atom': require('@libre/atom'),
|
|
24
|
-
'@dbeining/react-atom': require('@dbeining/react-atom'),
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
// App shell is built with something else than the Piral CLI - just don't fill ...
|
|
8
|
+
if (isfunc(fillDependencies)) {
|
|
9
|
+
fillDependencies(globalDependencies);
|
|
30
10
|
}
|
|
31
11
|
/**
|
|
32
12
|
* The default dependency selector, which just returns the provided
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../src/modules/dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,MAAM,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,
|
|
1
|
+
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../src/modules/dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,MAAM,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,gBAAgB,MAAM,4BAA4B,CAAC;AAE1D;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA0B,EAAE,CAAC;AAE5D,IAAI,MAAM,CAAC,gBAAgB,CAAC,EAAE;IAC5B,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,YAAmC;IAC3E,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -2,34 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defaultModuleRequester = exports.defaultDependencySelector = exports.globalDependencies = void 0;
|
|
4
4
|
const piral_base_1 = require("piral-base");
|
|
5
|
-
const
|
|
5
|
+
const dependencies_codegen_1 = require("../../dependencies.codegen");
|
|
6
6
|
/**
|
|
7
7
|
* The global dependencies, which represent the dependencies
|
|
8
8
|
* shared from the app shell itself.
|
|
9
9
|
*/
|
|
10
10
|
exports.globalDependencies = {};
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
if ((0, piral_base_1.isfunc)(fillDependencies)) {
|
|
14
|
-
fillDependencies(exports.globalDependencies);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
// fall back to the default list if the codegen is invalid / not supported
|
|
18
|
-
(0, tslib_1.__assign)(exports.globalDependencies, {
|
|
19
|
-
react: require('react'),
|
|
20
|
-
'react-dom': require('react-dom'),
|
|
21
|
-
'react-router': require('react-router'),
|
|
22
|
-
'react-router-dom': require('react-router-dom'),
|
|
23
|
-
history: require('history'),
|
|
24
|
-
tslib: require('tslib'),
|
|
25
|
-
'path-to-regexp': require('path-to-regexp'),
|
|
26
|
-
'@libre/atom': require('@libre/atom'),
|
|
27
|
-
'@dbeining/react-atom': require('@dbeining/react-atom'),
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
// App shell is built with something else than the Piral CLI - just don't fill ...
|
|
11
|
+
if ((0, piral_base_1.isfunc)(dependencies_codegen_1.default)) {
|
|
12
|
+
(0, dependencies_codegen_1.default)(exports.globalDependencies);
|
|
33
13
|
}
|
|
34
14
|
/**
|
|
35
15
|
* The default dependency selector, which just returns the provided
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../src/modules/dependencies.ts"],"names":[],"mappings":";;;AAAA,2CAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../src/modules/dependencies.ts"],"names":[],"mappings":";;;AAAA,2CAA0E;AAC1E,qEAA0D;AAE1D;;;GAGG;AACU,QAAA,kBAAkB,GAA0B,EAAE,CAAC;AAE5D,IAAI,IAAA,mBAAM,EAAC,8BAAgB,CAAC,EAAE;IAC5B,IAAA,8BAAgB,EAAC,0BAAkB,CAAC,CAAC;CACtC;AAED;;;GAGG;AACH,SAAgB,yBAAyB,CAAC,YAAmC;IAC3E,OAAO,YAAY,CAAC;AACtB,CAAC;AAFD,8DAEC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,sBAAsB;IACpC,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC;AAFD,wDAEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-core",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.23-beta.4124",
|
|
4
4
|
"description": "The core library for creating a Piral instance.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"portal",
|
|
@@ -17,6 +17,19 @@
|
|
|
17
17
|
"module": "esm/index.js",
|
|
18
18
|
"main": "lib/index.js",
|
|
19
19
|
"typings": "lib/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"import": "./esm/index.js",
|
|
23
|
+
"require": "./lib/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./esm/": {
|
|
26
|
+
"import": "./esm/"
|
|
27
|
+
},
|
|
28
|
+
"./lib/": {
|
|
29
|
+
"require": "./lib/"
|
|
30
|
+
},
|
|
31
|
+
"./package.json": "./package.json"
|
|
32
|
+
},
|
|
20
33
|
"sideEffects": false,
|
|
21
34
|
"files": [
|
|
22
35
|
"esm",
|
|
@@ -50,8 +63,8 @@
|
|
|
50
63
|
},
|
|
51
64
|
"dependencies": {
|
|
52
65
|
"@dbeining/react-atom": "^4.0.0",
|
|
53
|
-
"piral-base": "0.14.
|
|
54
|
-
"piral-debug-utils": "0.14.
|
|
66
|
+
"piral-base": "0.14.23-beta.4124",
|
|
67
|
+
"piral-debug-utils": "0.14.23-beta.4124"
|
|
55
68
|
},
|
|
56
69
|
"peerDependencies": {
|
|
57
70
|
"react": ">=16.8.0",
|
|
@@ -78,5 +91,5 @@
|
|
|
78
91
|
"@libre/atom",
|
|
79
92
|
"@dbeining/react-atom"
|
|
80
93
|
],
|
|
81
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "cc9d2e72edff0faffad79f84d28a114e195461a0"
|
|
82
95
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PiletMetadata, AvailableDependencies, isfunc } from 'piral-base';
|
|
2
|
-
import
|
|
2
|
+
import fillDependencies from '../../dependencies.codegen';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The global dependencies, which represent the dependencies
|
|
@@ -7,27 +7,8 @@ import { __assign } from 'tslib';
|
|
|
7
7
|
*/
|
|
8
8
|
export const globalDependencies: AvailableDependencies = {};
|
|
9
9
|
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (isfunc(fillDependencies)) {
|
|
14
|
-
fillDependencies(globalDependencies);
|
|
15
|
-
} else {
|
|
16
|
-
// fall back to the default list if the codegen is invalid / not supported
|
|
17
|
-
__assign(globalDependencies, {
|
|
18
|
-
react: require('react'),
|
|
19
|
-
'react-dom': require('react-dom'),
|
|
20
|
-
'react-router': require('react-router'),
|
|
21
|
-
'react-router-dom': require('react-router-dom'),
|
|
22
|
-
history: require('history'),
|
|
23
|
-
tslib: require('tslib'),
|
|
24
|
-
'path-to-regexp': require('path-to-regexp'),
|
|
25
|
-
'@libre/atom': require('@libre/atom'),
|
|
26
|
-
'@dbeining/react-atom': require('@dbeining/react-atom'),
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
} else {
|
|
30
|
-
// App shell is built with something else than the Piral CLI - just don't fill ...
|
|
10
|
+
if (isfunc(fillDependencies)) {
|
|
11
|
+
fillDependencies(globalDependencies);
|
|
31
12
|
}
|
|
32
13
|
|
|
33
14
|
/**
|