fyn 1.1.21 → 1.1.22

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 (2) hide show
  1. package/dist/fyn.js +22 -16
  2. package/package.json +1 -1
package/dist/fyn.js CHANGED
@@ -1073,10 +1073,7 @@ class FynCli {
1073
1073
  }
1074
1074
  }));
1075
1075
 
1076
- const pathKey = xsh.envPath.envKey;
1077
- const env = {
1078
- [pathKey]: process.env[pathKey]
1079
- };
1076
+ const env = npmLifecycle.initEnv(process.env, this.fyn.production);
1080
1077
  setupNodeGypEnv(env);
1081
1078
  return Promise.each(_scripts, s => _.get(pkg, ["scripts", s]) && this.runScript(pkg, s, Object.assign({}, env)));
1082
1079
  }
@@ -53411,8 +53408,10 @@ async function generateNpmPackage(yes = false, template = initialTemplate, exist
53411
53408
  delete answers.main;
53412
53409
  }
53413
53410
 
53414
- if (lodash_1.default.get(exist, "publishConfig") || !answers.name.startsWith("@")) {
53411
+ if (!answers.name.startsWith("@")) {
53415
53412
  delete answers.publishConfig;
53413
+ } else if (lodash_1.default.get(exist, "publishConfig")) {
53414
+ answers.publishConfig = lodash_1.default.pick(answers.publishConfig, Object.keys(exist.publishConfig));
53416
53415
  }
53417
53416
 
53418
53417
  const finalData = lodash_1.default.mergeWith({}, exist, answers, mergeReplaceArray); //
@@ -77303,6 +77302,7 @@ walk.BundleWalkerSync = BundleWalkerSync;
77303
77302
 
77304
77303
 
77305
77304
  exports = module.exports = lifecycle;
77305
+ exports.initEnv = initEnv;
77306
77306
  exports.makeEnv = makeEnv;
77307
77307
  exports._incorrectWorkingDirectory = _incorrectWorkingDirectory; // for testing
77308
77308
 
@@ -77708,20 +77708,26 @@ function runHookLifecycle(pkg, stage, env, wd, opts, cb) {
77708
77708
  });
77709
77709
  }
77710
77710
 
77711
- function makeEnv(data, opts, prefix, env) {
77712
- prefix = prefix || 'npm_package_';
77711
+ function initEnv(fromEnv, production) {
77712
+ fromEnv = fromEnv || process.env;
77713
+ var env = {};
77713
77714
 
77714
- if (!env) {
77715
- env = {};
77715
+ for (var i in fromEnv) {
77716
+ if (!i.match(/^npm_/)) {
77717
+ env[i] = fromEnv[i];
77718
+ }
77719
+ } // express and others respect the NODE_ENV value.
77716
77720
 
77717
- for (var i in process.env) {
77718
- if (!i.match(/^npm_/)) {
77719
- env[i] = process.env[i];
77720
- }
77721
- } // express and others respect the NODE_ENV value.
77722
77721
 
77722
+ if (production) env.NODE_ENV = 'production';
77723
+ return env;
77724
+ }
77725
+
77726
+ function makeEnv(data, opts, prefix, env) {
77727
+ prefix = prefix || 'npm_package_';
77723
77728
 
77724
- if (opts.production) env.NODE_ENV = 'production';
77729
+ if (!env) {
77730
+ env = initEnv(process.env, opts.production);
77725
77731
  } else if (!data.hasOwnProperty('_lifecycleEnv')) {
77726
77732
  Object.defineProperty(data, '_lifecycleEnv', {
77727
77733
  value: env,
@@ -77731,7 +77737,7 @@ function makeEnv(data, opts, prefix, env) {
77731
77737
 
77732
77738
  if (opts.nodeOptions) env.NODE_OPTIONS = opts.nodeOptions;
77733
77739
 
77734
- for (i in data) {
77740
+ for (var i in data) {
77735
77741
  if (i.charAt(0) !== '_') {
77736
77742
  var envKey = (prefix + i).replace(/[^a-zA-Z0-9_]/g, '_');
77737
77743
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fyn",
3
- "version": "1.1.21",
3
+ "version": "1.1.22",
4
4
  "description": "A node package manager, fast, workspace, and better productivity and efficiency",
5
5
  "main": "./bin/fyn.js",
6
6
  "homepage": "https://www.electrode.io/fynpo/",