@jcoreio/toolchain 5.3.6 → 5.4.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcoreio/toolchain",
3
- "version": "5.3.6",
3
+ "version": "5.4.1",
4
4
  "description": "base JS build toolchain",
5
5
  "repository": {
6
6
  "type": "git",
@@ -69,6 +69,31 @@ async function migrateProjectPackageJson({ fromVersion }) {
69
69
  unset(packageJson, path)
70
70
  }
71
71
  }
72
+
73
+ const promptRemoveDevDeps = require('./migrateRemoveDevDeps.cjs')
74
+ .filter((dep) => devDependencies[dep])
75
+ .sort()
76
+ if (promptRemoveDevDeps.length) {
77
+ const selected =
78
+ require('../../util/isInteractive.cjs') ?
79
+ (
80
+ await require('../../util/prompt.cjs')({
81
+ name: 'selected',
82
+ type: 'multiselect',
83
+ message: 'Select dependencies to uninstall:',
84
+ choices: promptRemoveDevDeps.map((dep) => ({
85
+ title: dep,
86
+ value: dep,
87
+ selected: true,
88
+ })),
89
+ })
90
+ ).selected
91
+ : promptRemoveDevDeps
92
+ for (const dep of selected) {
93
+ delete devDependencies[dep]
94
+ }
95
+ }
96
+
72
97
  if (
73
98
  !fromVersion &&
74
99
  !packageJson.main &&
@@ -89,10 +114,6 @@ async function migrateProjectPackageJson({ fromVersion }) {
89
114
  packageJson.types = 'dist/index.d.ts'
90
115
  }
91
116
 
92
- for (const dep of require('./migrateRemoveDevDeps.cjs')) {
93
- delete devDependencies[dep]
94
- }
95
-
96
117
  if (
97
118
  semver.lt(fromVersion || '0.0.0', '3.0.0') &&
98
119
  !packageJson.exports &&
@@ -22,6 +22,7 @@ module.exports = [
22
22
  '@babel/plugin-transform-export-extensions',
23
23
  '@babel/plugin-transform-flow-comments',
24
24
  '@babel/plugin-transform-object-rest-spread',
25
+ '@babel/plugin-transform-react-jsx',
25
26
  '@babel/plugin-transform-regenerator',
26
27
  '@babel/plugin-transform-runtime',
27
28
  '@babel/polyfill',
@@ -97,6 +98,8 @@ module.exports = [
97
98
  'babylon',
98
99
  'codecov',
99
100
  'commitizen',
101
+ 'copy',
102
+ 'cross-env',
100
103
  'cz-conventional-changelog',
101
104
  'coveralls',
102
105
  'eslint-watch',
@@ -110,10 +113,8 @@ module.exports = [
110
113
  'isparta',
111
114
  'istanbul',
112
115
  'jsdom-global',
113
- 'lint-staged',
114
- 'nyc',
115
116
  'prettier-eslint',
116
- 'prettier',
117
+ 'rimraf',
117
118
  'semantic-release',
118
119
  'travis-deploy-once',
119
120
  ]
package/util/glob.cjs CHANGED
@@ -1,13 +1,41 @@
1
1
  const { glob, globSync, globIterate, globIterateSync } = require('glob')
2
2
  const { projectDir } = require('./findUps.cjs')
3
3
 
4
+ const extendOptions = (options) => ({
5
+ cwd: projectDir,
6
+ ...options,
7
+ ignore:
8
+ (
9
+ options &&
10
+ options.ignore &&
11
+ !Array.isArray(options.ignore) &&
12
+ typeof options.ignore !== 'string'
13
+ ) ?
14
+ {
15
+ ignored: (p) =>
16
+ !/\/node_modules\/|\\node_modules\\/.test(p.fullpath()) &&
17
+ (!options.ignore.ignored || options.ignore.ignored(p)),
18
+ childrenIgnored: (p) =>
19
+ !/\/node_modules\/|\\node_modules\\/.test(p.fullpath()) &&
20
+ (!options.ignore.childrenIgnored ||
21
+ options.ignore.childrenIgnored(p)),
22
+ }
23
+ : [
24
+ ...((options && options.ignore ?
25
+ Array.isArray(options.ignore) ?
26
+ options.ignore
27
+ : [options.ignore]
28
+ : []) || []),
29
+ '**/node_modules/**',
30
+ ],
31
+ })
32
+
4
33
  module.exports = {
5
- glob: (what, options) => glob(what, { cwd: projectDir, ...options }),
6
- globSync: (what, options) => globSync(what, { cwd: projectDir, ...options }),
7
- globIterate: (what, options) =>
8
- globIterate(what, { cwd: projectDir, ...options }),
34
+ glob: (what, options) => glob(what, extendOptions(options)),
35
+ globSync: (what, options) => globSync(what, extendOptions(options)),
36
+ globIterate: (what, options) => globIterate(what, extendOptions(options)),
9
37
  globIterateSync: (what, options) =>
10
- globIterateSync(what, { cwd: projectDir, ...options }),
38
+ globIterateSync(what, extendOptions(options)),
11
39
  globExists: async (what, options) => {
12
40
  for await (const _ of module.exports.globIterate(what, options)) {
13
41
  return true