@atlaspack/cli 2.13.3-dev.16 → 2.13.3-dev.39

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 (3) hide show
  1. package/lib/cli.js +13 -1
  2. package/package.json +14 -14
  3. package/src/cli.js +15 -1
package/lib/cli.js CHANGED
@@ -121,7 +121,19 @@ command) {
121
121
  let options = await (0, _normalizeOptions.normalizeOptions)(command, fs);
122
122
  let atlaspack = new Atlaspack({
123
123
  entries,
124
- defaultConfig: require.resolve('@atlaspack/config-default', {
124
+ defaultConfig: ((specifier, {
125
+ paths
126
+ }) => {
127
+ for (let path of paths) {
128
+ let customRequire = require('module').createRequire(path);
129
+ try {
130
+ return customRequire.resolve('@atlaspack/config-default');
131
+ } catch (e) {
132
+ // Ignore error
133
+ }
134
+ }
135
+ throw new Error(`Can't resolve "${specifier}" from any of [${paths.join(', ')}]`);
136
+ })('@atlaspack/config-default', {
125
137
  paths: [fs.cwd(), __dirname]
126
138
  }),
127
139
  shouldPatchConsole: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/cli",
3
- "version": "2.13.3-dev.16+921d08b68",
3
+ "version": "2.13.3-dev.39+cb7a8afb9",
4
4
  "description": "Blazing fast, zero configuration web application bundler",
5
5
  "license": "(MIT OR Apache-2.0)",
6
6
  "type": "commonjs",
@@ -24,18 +24,18 @@
24
24
  "node": ">= 16.0.0"
25
25
  },
26
26
  "dependencies": {
27
- "@atlaspack/config-default": "3.1.1-dev.16+921d08b68",
28
- "@atlaspack/core": "2.14.1-dev.16+921d08b68",
29
- "@atlaspack/diagnostic": "2.14.1-dev.16+921d08b68",
30
- "@atlaspack/events": "2.14.1-dev.16+921d08b68",
31
- "@atlaspack/feature-flags": "2.14.1-dev.16+921d08b68",
32
- "@atlaspack/fs": "2.14.1-dev.16+921d08b68",
33
- "@atlaspack/logger": "2.14.1-dev.16+921d08b68",
34
- "@atlaspack/package-manager": "2.14.1-dev.16+921d08b68",
35
- "@atlaspack/reporter-cli": "2.14.1-dev.16+921d08b68",
36
- "@atlaspack/reporter-dev-server": "2.14.1-dev.16+921d08b68",
37
- "@atlaspack/reporter-tracer": "2.14.1-dev.16+921d08b68",
38
- "@atlaspack/utils": "2.14.1-dev.16+921d08b68",
27
+ "@atlaspack/config-default": "3.1.1-dev.39+cb7a8afb9",
28
+ "@atlaspack/core": "2.14.1-dev.39+cb7a8afb9",
29
+ "@atlaspack/diagnostic": "2.14.1-dev.39+cb7a8afb9",
30
+ "@atlaspack/events": "2.14.1-dev.39+cb7a8afb9",
31
+ "@atlaspack/feature-flags": "2.14.1-dev.39+cb7a8afb9",
32
+ "@atlaspack/fs": "2.14.1-dev.39+cb7a8afb9",
33
+ "@atlaspack/logger": "2.14.1-dev.39+cb7a8afb9",
34
+ "@atlaspack/package-manager": "2.14.1-dev.39+cb7a8afb9",
35
+ "@atlaspack/reporter-cli": "2.14.1-dev.39+cb7a8afb9",
36
+ "@atlaspack/reporter-dev-server": "2.14.1-dev.39+cb7a8afb9",
37
+ "@atlaspack/reporter-tracer": "2.14.1-dev.39+cb7a8afb9",
38
+ "@atlaspack/utils": "2.14.1-dev.39+cb7a8afb9",
39
39
  "chalk": "^4.1.0",
40
40
  "commander": "^7.0.0",
41
41
  "get-port": "^4.2.0"
@@ -45,5 +45,5 @@
45
45
  "@babel/core": "^7.22.11",
46
46
  "rimraf": "^5.0.5"
47
47
  },
48
- "gitHead": "921d08b68ca593f8cc8cb9ed0d182a5883a9e165"
48
+ "gitHead": "cb7a8afb9b35e4570ba1b04175774f30561dc6fb"
49
49
  }
package/src/cli.js CHANGED
@@ -132,12 +132,26 @@ async function run(
132
132
 
133
133
  entries = entries.map((entry) => path.resolve(entry));
134
134
 
135
+ const resolve = (specifier, {paths}) => {
136
+ for (let path of paths) {
137
+ let customRequire = require('module').createRequire(path);
138
+ try {
139
+ return customRequire.resolve('@atlaspack/config-default');
140
+ } catch (e) {
141
+ // Ignore error
142
+ }
143
+ }
144
+ throw new Error(
145
+ `Can't resolve "${specifier}" from any of [${paths.join(', ')}]`,
146
+ );
147
+ };
148
+
135
149
  let Atlaspack = require('@atlaspack/core').default;
136
150
  let fs = new NodeFS();
137
151
  let options = await normalizeOptions(command, fs);
138
152
  let atlaspack = new Atlaspack({
139
153
  entries,
140
- defaultConfig: require.resolve('@atlaspack/config-default', {
154
+ defaultConfig: resolve('@atlaspack/config-default', {
141
155
  paths: [fs.cwd(), __dirname],
142
156
  }),
143
157
  shouldPatchConsole: false,