@eui/tools 6.2.11 → 6.2.12

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.
@@ -134,7 +134,7 @@ module.exports.preBuild = (pkg) => {
134
134
 
135
135
  return Promise.resolve()
136
136
  .then(() => {
137
- const prebuildScript = path.join(pkg.paths.pkgDirectory, 'pre-build.js');
137
+ const prebuildScript = path.join(pkg.paths.root, 'pre-build.js');
138
138
  if (!dryRun && tools.isFileExists(prebuildScript)) {
139
139
  return tools.runScript(`node ${prebuildScript}`);
140
140
  } else {
@@ -159,7 +159,7 @@ module.exports.postBuild = (pkg) => {
159
159
  return Promise.resolve()
160
160
  .then(() => {
161
161
  tools.logInfo('Executing post-build.js script if present in package');
162
- const postbuildScript = path.join(pkg.paths.pkgDirectory, 'post-build.js');
162
+ const postbuildScript = path.join(pkg.paths.root, 'post-build.js');
163
163
  if (!dryRun && tools.isFileExists(postbuildScript)) {
164
164
  return tools.runScript(`node ${postbuildScript}`);
165
165
  } else {
@@ -170,7 +170,7 @@ module.exports.postBuild = (pkg) => {
170
170
  // Clean up temporary sonar generated folder and files
171
171
  .then(() => {
172
172
  tools.logInfo('Cleaning sonar temporary assets if exist');
173
- const sonarTempPath = path.join(pkg.paths.pkgDirectory, '.scannerwork');
173
+ const sonarTempPath = path.join(pkg.paths.root, '.scannerwork');
174
174
  if (tools.isDirExists(sonarTempPath)) {
175
175
  return tools.rimraf(sonarTempPath);
176
176
  }
@@ -190,7 +190,7 @@ module.exports.buildSubEntry = (pkg, subEntry) => {
190
190
  .then(() => {
191
191
  tools.logInfo(`Building sub-entry : ${subEntry} of package : ${pkg.name}`);
192
192
  // console.log(pkg);
193
- return tools.getFilesGlob(pkg.paths.pkgRootDirectory, `**/package.json`);
193
+ return tools.getFilesGlob(pkg.paths.root, `**/package.json`);
194
194
  })
195
195
 
196
196
  .then((files) => {
@@ -227,8 +227,8 @@ module.exports.buildSubEntry = (pkg, subEntry) => {
227
227
  tools.logInfo('Testing...');
228
228
  const ng = path.resolve(process.cwd(), 'node_modules', '@angular', 'cli', 'bin', 'ng');
229
229
  let args = ['--max_old_space_size=8096', ng, 'test', subEntry, '--code-coverage', '--watch=false'];
230
- tools.logInfo(`running ng test : with args: ${args} on folder : ${pkg.paths.pkgRootDirectory}`);
231
- return execa('node', args, { cwd: pkg.paths.pkgRootDirectory, stdio: 'inherit' });
230
+ tools.logInfo(`running ng test : with args: ${args} on folder : ${pkg.paths.root}`);
231
+ return execa('node', args, { cwd: pkg.paths.root, stdio: 'inherit' });
232
232
  }
233
233
  }
234
234
  })
@@ -237,7 +237,7 @@ module.exports.buildSubEntry = (pkg, subEntry) => {
237
237
 
238
238
  let args = ['--max_old_space_size=8096', ng, 'build', subEntry];
239
239
 
240
- return execa('node', args, { cwd: pkg.paths.pkgRootDirectory, stdio: 'inherit' });
240
+ return execa('node', args, { cwd: pkg.paths.root, stdio: 'inherit' });
241
241
  })
242
242
 
243
243
  .then(() => {
@@ -15,7 +15,7 @@ const { dryRun, registry } = tools.getArgs();
15
15
 
16
16
 
17
17
  const getPkgVersion = (pkg) => {
18
- const pathPkgJson = path.resolve(pkg.paths.pkgPublish, 'package.json');
18
+ const pathPkgJson = path.resolve(pkg.paths.publish, 'package.json');
19
19
  delete require.cache[pathPkgJson];
20
20
  require(pathPkgJson);
21
21
  const { version } = require(pathPkgJson);
@@ -23,9 +23,9 @@ const getPkgVersion = (pkg) => {
23
23
  }
24
24
 
25
25
  const publishCore = (pkg, registry, isPublicAccess) => {
26
- tools.logInfo(`Publishing package "${pkg.name}" from "${pkg.paths.pkgPublish}" on ${registry}`);
26
+ tools.logInfo(`Publishing package "${pkg.name}" from "${pkg.paths.publish}" on ${registry}`);
27
27
 
28
- let command = `npm publish ${pkg.paths.pkgPublish} --registry ${registry}`;
28
+ let command = `npm publish ${pkg.paths.publish} --registry ${registry}`;
29
29
 
30
30
  if (isPublicAccess) {
31
31
  command += ' --access public';
@@ -59,7 +59,7 @@ const publishCore = (pkg, registry, isPublicAccess) => {
59
59
  .then(() => {
60
60
  tools.logInfo('Write version properties file');
61
61
 
62
- const versionFile = path.resolve(pkg.paths.pkgDirectory, '.version.properties');
62
+ const versionFile = path.resolve(pkg.paths.root, '.version.properties');
63
63
  tools.writeFileContent(versionFile, version);
64
64
  })
65
65
 
@@ -164,9 +164,14 @@ module.exports.publish = (pkg) => {
164
164
  .then(() => {
165
165
 
166
166
  if (!pkg.parent) {
167
- // building normal package without linked children
168
- const pkgFull = configUtils.packages.getPackage(pkg.name); // TO CHECK
169
- return publishPackage(pkgFull);
167
+ if (pkg.remote && pkg.virtual) {
168
+ return publishPackage(pkg);
169
+
170
+ } else {
171
+ // building normal package without linked children
172
+ const pkgFull = configUtils.packages.getPackage(pkg.name); // TO CHECK
173
+ return publishPackage(pkgFull);
174
+ }
170
175
 
171
176
  } else {
172
177
 
@@ -25,7 +25,7 @@ module.exports.publish = (pkg) => {
25
25
  }
26
26
 
27
27
  module.exports.postPublish = (pkg) => {
28
- const postpublishScript = path.join(pkg.paths.pkgDirectory, 'post-publish.js');
28
+ const postpublishScript = path.join(pkg.paths.root, 'post-publish.js');
29
29
  if (!dryRun && tools.isFileExists(postpublishScript)) {
30
30
  return tools.runScript(`node ${postpublishScript}`);
31
31
  } else {
@@ -81,6 +81,29 @@ function getArgs() {
81
81
  }
82
82
 
83
83
 
84
+ function convertBooleanArg(arg) {
85
+ if (arg && typeof(arg) === 'boolean') {
86
+ return false;
87
+ } else {
88
+ if (arg) {
89
+ return true;
90
+ } else {
91
+ return false;
92
+ }
93
+ }
94
+ }
95
+
96
+ function convertStringArg(arg, defaultValue = null) {
97
+ if (arg && typeof(arg) === 'boolean') {
98
+ return defaultValue
99
+ } else {
100
+ if (arg) {
101
+ return arg;
102
+ } else {
103
+ return defaultValue;
104
+ }
105
+ }
106
+ }
84
107
 
85
108
 
86
109
  /* -------------------------------------------------------------------------------------------
@@ -796,6 +819,8 @@ module.exports.sortArray = sortArray;
796
819
  module.exports.removeArrayDuplicates = removeArrayDuplicates;
797
820
  module.exports.getArraySum = getArraySum;
798
821
  module.exports.getArgs = getArgs;
822
+ module.exports.convertBooleanArg = convertBooleanArg;
823
+ module.exports.convertStringArg = convertStringArg;
799
824
  module.exports.getXMLJsContent = getXMLJsContent;
800
825
  module.exports.getFolders = getFolders;
801
826
  module.exports.getFiles = getFiles;