@configuratorware/scripts 1.41.1 → 1.42.0
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/createDist.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const fs = require('fs');
|
|
5
|
-
const rimraf = require('rimraf');
|
|
6
5
|
|
|
7
6
|
const { cpDirDeep } = require('./utils/fileSystem');
|
|
8
7
|
const { getDistConfig } = require('./utils/process');
|
|
@@ -13,8 +12,6 @@ console.log('\x1b[37m\x1b[42m%s\x1b[0m', 'Creating the dist directory based on '
|
|
|
13
12
|
|
|
14
13
|
const distDir = path.resolve(packageDir, distConfig.distDir);
|
|
15
14
|
|
|
16
|
-
rimraf.sync(distDir);
|
|
17
|
-
|
|
18
15
|
cpFiles.forEach(({ src, dst }) => {
|
|
19
16
|
(src instanceof Array ? src : [src]).forEach(srci => {
|
|
20
17
|
const srcAbs = path.resolve(packageDir, srci);
|
package/package.json
CHANGED
package/utils/fileSystem.js
CHANGED
|
@@ -16,7 +16,12 @@ function mkDirDeep(dst) {
|
|
|
16
16
|
dir = [dir, p].join('/');
|
|
17
17
|
if (!fs.existsSync(dir)) {
|
|
18
18
|
console.log('Create directory:', dir);
|
|
19
|
-
|
|
19
|
+
try {
|
|
20
|
+
fs.mkdirSync(dir);
|
|
21
|
+
} catch (e) {
|
|
22
|
+
console.log('Could not create directory:', dir);
|
|
23
|
+
console.log(e.message)
|
|
24
|
+
}
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
function resolveWorkspaceDependencies(dependencies, options = {}) {
|
|
1
|
+
function resolveWorkspaceDependencies(dependencies, packageRoot, options = {}) {
|
|
2
2
|
const {
|
|
3
3
|
isProduction = process.env.NODE_ENV === 'production',
|
|
4
|
-
paths = undefined
|
|
5
4
|
} = options;
|
|
6
5
|
if (isProduction) {
|
|
7
6
|
return {};
|
|
@@ -11,7 +10,9 @@ function resolveWorkspaceDependencies(dependencies, options = {}) {
|
|
|
11
10
|
if (dependencies[key].indexOf('workspace:') === 0) {
|
|
12
11
|
const lib = `${key}/lib/`;
|
|
13
12
|
try {
|
|
14
|
-
|
|
13
|
+
const resolvedPath = require('path').resolve(packageRoot, 'node_modules', lib);
|
|
14
|
+
const resolved = require.resolve(resolvedPath);
|
|
15
|
+
if (resolved) {
|
|
15
16
|
result[key] = lib;
|
|
16
17
|
}
|
|
17
18
|
} catch (e) {
|