@atlaspack/core 2.12.1-canary.3472 → 2.12.1-canary.3478

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.
@@ -178,6 +178,9 @@ class AtlaspackWorker {
178
178
  state.packageManager = packageManager;
179
179
  }
180
180
  const transformer = state.transformer;
181
+ const resolveFunc = (from, to) => Promise.resolve(require.resolve(to, {
182
+ paths: [from]
183
+ }));
181
184
  const env = new _compat.Environment(napiEnv);
182
185
  const mutableAsset = new _compat.MutableAsset(innerAsset, this.#fs, env);
183
186
  const defaultOptions = {
@@ -203,9 +206,7 @@ class AtlaspackWorker {
203
206
  const ast = await transformer.parse({
204
207
  asset: mutableAsset,
205
208
  config,
206
- get resolve() {
207
- throw new Error('Transformer.parse.resolve()');
208
- },
209
+ resolve: resolveFunc,
209
210
  ...defaultOptions
210
211
  });
211
212
  if (ast) {
@@ -215,9 +216,7 @@ class AtlaspackWorker {
215
216
  const result = await state.transformer.transform({
216
217
  asset: mutableAsset,
217
218
  config,
218
- get resolve() {
219
- throw new Error('Transformer.transform.resolve()');
220
- },
219
+ resolve: resolveFunc,
221
220
  ...defaultOptions
222
221
  });
223
222
  if (transformer.generate) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/core",
3
- "version": "2.12.1-canary.3472+8209dde07",
3
+ "version": "2.12.1-canary.3478+7832352eb",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -20,21 +20,21 @@
20
20
  "check-ts": "tsc --noEmit index.d.ts"
21
21
  },
22
22
  "dependencies": {
23
- "@atlaspack/build-cache": "2.12.1-canary.3472+8209dde07",
24
- "@atlaspack/cache": "2.12.1-canary.3472+8209dde07",
25
- "@atlaspack/diagnostic": "2.12.1-canary.3472+8209dde07",
26
- "@atlaspack/events": "2.12.1-canary.3472+8209dde07",
27
- "@atlaspack/feature-flags": "2.12.1-canary.3472+8209dde07",
28
- "@atlaspack/fs": "2.12.1-canary.3472+8209dde07",
29
- "@atlaspack/graph": "3.2.1-canary.3472+8209dde07",
30
- "@atlaspack/logger": "2.12.1-canary.3472+8209dde07",
31
- "@atlaspack/package-manager": "2.12.1-canary.3472+8209dde07",
32
- "@atlaspack/plugin": "2.12.1-canary.3472+8209dde07",
33
- "@atlaspack/profiler": "2.12.1-canary.3472+8209dde07",
34
- "@atlaspack/rust": "2.12.1-canary.3472+8209dde07",
35
- "@atlaspack/types": "2.12.1-canary.3472+8209dde07",
36
- "@atlaspack/utils": "2.12.1-canary.3472+8209dde07",
37
- "@atlaspack/workers": "2.12.1-canary.3472+8209dde07",
23
+ "@atlaspack/build-cache": "2.12.1-canary.3478+7832352eb",
24
+ "@atlaspack/cache": "2.12.1-canary.3478+7832352eb",
25
+ "@atlaspack/diagnostic": "2.12.1-canary.3478+7832352eb",
26
+ "@atlaspack/events": "2.12.1-canary.3478+7832352eb",
27
+ "@atlaspack/feature-flags": "2.12.1-canary.3478+7832352eb",
28
+ "@atlaspack/fs": "2.12.1-canary.3478+7832352eb",
29
+ "@atlaspack/graph": "3.2.1-canary.3478+7832352eb",
30
+ "@atlaspack/logger": "2.12.1-canary.3478+7832352eb",
31
+ "@atlaspack/package-manager": "2.12.1-canary.3478+7832352eb",
32
+ "@atlaspack/plugin": "2.12.1-canary.3478+7832352eb",
33
+ "@atlaspack/profiler": "2.12.1-canary.3478+7832352eb",
34
+ "@atlaspack/rust": "2.12.1-canary.3478+7832352eb",
35
+ "@atlaspack/types": "2.12.1-canary.3478+7832352eb",
36
+ "@atlaspack/utils": "2.12.1-canary.3478+7832352eb",
37
+ "@atlaspack/workers": "2.12.1-canary.3478+7832352eb",
38
38
  "@mischnic/json-sourcemap": "^0.1.0",
39
39
  "@parcel/source-map": "^2.1.1",
40
40
  "base-x": "^3.0.8",
@@ -65,5 +65,5 @@
65
65
  "browser": {
66
66
  "./src/serializerCore.js": "./src/serializerCore.browser.js"
67
67
  },
68
- "gitHead": "8209dde072b0d4726f70bcb319099a496c2651a1"
68
+ "gitHead": "7832352eb05e5982f2221de5666d8ae0a6e9cb30"
69
69
  }
@@ -162,6 +162,8 @@ export class AtlaspackWorker {
162
162
  }
163
163
 
164
164
  const transformer: Transformer<any> = state.transformer;
165
+ const resolveFunc = (from: string, to: string): Promise<any> =>
166
+ Promise.resolve(require.resolve(to, {paths: [from]}));
165
167
  const env = new Environment(napiEnv);
166
168
  const mutableAsset = new MutableAsset(innerAsset, this.#fs, env);
167
169
  const defaultOptions = {
@@ -189,9 +191,7 @@ export class AtlaspackWorker {
189
191
  const ast = await transformer.parse({
190
192
  asset: mutableAsset,
191
193
  config,
192
- get resolve() {
193
- throw new Error('Transformer.parse.resolve()');
194
- },
194
+ resolve: resolveFunc,
195
195
  ...defaultOptions,
196
196
  });
197
197
  if (ast) {
@@ -202,9 +202,7 @@ export class AtlaspackWorker {
202
202
  const result = await state.transformer.transform({
203
203
  asset: mutableAsset,
204
204
  config,
205
- get resolve() {
206
- throw new Error('Transformer.transform.resolve()');
207
- },
205
+ resolve: resolveFunc,
208
206
  ...defaultOptions,
209
207
  });
210
208