@atlaspack/core 2.13.2-canary.3683 → 2.13.2-canary.3686

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.
@@ -41,47 +41,26 @@ const NODE_MODULES = `${_path().default.sep}node_modules${_path().default.sep}`;
41
41
  const CONFIG = Symbol.for('parcel-plugin-config');
42
42
  async function loadPlugin(pluginName, configPath, keyPath, options) {
43
43
  let resolveFrom = configPath;
44
- if (resolveFrom.includes(NODE_MODULES)) {
45
- var _configPkg$config$dep;
46
- // Config packages can reference plugins, but cannot contain other plugins within them.
47
- // This forces every published plugin to be published separately so they can be mixed and matched if needed.
48
- if (pluginName.startsWith('.')) {
49
- let configContents = await options.inputFS.readFile(configPath, 'utf8');
50
- throw new (_diagnostic().default)({
51
- diagnostic: {
52
- message: (0, _diagnostic().md)`Local plugins are not supported in Atlaspack config packages. Please publish "${pluginName}" as a separate npm package.`,
53
- origin: '@atlaspack/core',
54
- codeFrames: keyPath ? [{
55
- filePath: configPath,
56
- language: 'json5',
57
- code: configContents,
58
- codeHighlights: (0, _diagnostic().generateJSONCodeHighlights)(configContents, [{
59
- key: keyPath,
60
- type: 'value'
61
- }])
62
- }] : undefined
63
- }
64
- });
65
- }
66
- let configPkg = await (0, _utils().loadConfig)(options.inputFS, resolveFrom, ['package.json'], options.projectRoot);
67
- if (configPkg != null && ((_configPkg$config$dep = configPkg.config.dependencies) === null || _configPkg$config$dep === void 0 ? void 0 : _configPkg$config$dep[pluginName]) == null) {
68
- let contents = await options.inputFS.readFile(configPkg.files[0].filePath, 'utf8');
69
- throw new (_diagnostic().default)({
70
- diagnostic: {
71
- message: (0, _diagnostic().md)`Could not determine version of ${pluginName} in ${_path().default.relative(process.cwd(), resolveFrom)}. Include it in "dependencies".`,
72
- origin: '@atlaspack/core',
73
- codeFrames: configPkg.config.dependencies ? [{
74
- filePath: configPkg.files[0].filePath,
75
- language: 'json5',
76
- code: contents,
77
- codeHighlights: (0, _diagnostic().generateJSONCodeHighlights)(contents, [{
78
- key: '/dependencies',
79
- type: 'key'
80
- }])
81
- }] : undefined
82
- }
83
- });
84
- }
44
+
45
+ // Config packages can reference plugins, but cannot contain other plugins within them.
46
+ // This forces every published plugin to be published separately so they can be mixed and matched if needed.
47
+ if (resolveFrom.includes(NODE_MODULES) && pluginName.startsWith('.')) {
48
+ let configContents = await options.inputFS.readFile(configPath, 'utf8');
49
+ throw new (_diagnostic().default)({
50
+ diagnostic: {
51
+ message: (0, _diagnostic().md)`Local plugins are not supported in Atlaspack config packages. Please publish "${pluginName}" as a separate npm package.`,
52
+ origin: '@atlaspack/core',
53
+ codeFrames: keyPath ? [{
54
+ filePath: configPath,
55
+ language: 'json5',
56
+ code: configContents,
57
+ codeHighlights: (0, _diagnostic().generateJSONCodeHighlights)(configContents, [{
58
+ key: keyPath,
59
+ type: 'value'
60
+ }])
61
+ }] : undefined
62
+ }
63
+ });
85
64
  }
86
65
  let resolved, pkg;
87
66
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/core",
3
- "version": "2.13.2-canary.3683+cd964eed5",
3
+ "version": "2.13.2-canary.3686+be88bd9fc",
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.13.2-canary.3683+cd964eed5",
24
- "@atlaspack/cache": "2.13.2-canary.3683+cd964eed5",
25
- "@atlaspack/diagnostic": "2.13.2-canary.3683+cd964eed5",
26
- "@atlaspack/events": "2.13.2-canary.3683+cd964eed5",
27
- "@atlaspack/feature-flags": "2.13.2-canary.3683+cd964eed5",
28
- "@atlaspack/fs": "2.13.2-canary.3683+cd964eed5",
29
- "@atlaspack/graph": "3.3.2-canary.3683+cd964eed5",
30
- "@atlaspack/logger": "2.13.2-canary.3683+cd964eed5",
31
- "@atlaspack/package-manager": "2.13.2-canary.3683+cd964eed5",
32
- "@atlaspack/plugin": "2.13.2-canary.3683+cd964eed5",
33
- "@atlaspack/profiler": "2.13.2-canary.3683+cd964eed5",
34
- "@atlaspack/rust": "2.13.2-canary.3683+cd964eed5",
35
- "@atlaspack/types": "2.13.2-canary.3683+cd964eed5",
36
- "@atlaspack/utils": "2.13.2-canary.3683+cd964eed5",
37
- "@atlaspack/workers": "2.13.2-canary.3683+cd964eed5",
23
+ "@atlaspack/build-cache": "2.13.2-canary.3686+be88bd9fc",
24
+ "@atlaspack/cache": "2.13.2-canary.3686+be88bd9fc",
25
+ "@atlaspack/diagnostic": "2.13.2-canary.3686+be88bd9fc",
26
+ "@atlaspack/events": "2.13.2-canary.3686+be88bd9fc",
27
+ "@atlaspack/feature-flags": "2.13.2-canary.3686+be88bd9fc",
28
+ "@atlaspack/fs": "2.13.2-canary.3686+be88bd9fc",
29
+ "@atlaspack/graph": "3.3.2-canary.3686+be88bd9fc",
30
+ "@atlaspack/logger": "2.13.2-canary.3686+be88bd9fc",
31
+ "@atlaspack/package-manager": "2.13.2-canary.3686+be88bd9fc",
32
+ "@atlaspack/plugin": "2.13.2-canary.3686+be88bd9fc",
33
+ "@atlaspack/profiler": "2.13.2-canary.3686+be88bd9fc",
34
+ "@atlaspack/rust": "2.13.2-canary.3686+be88bd9fc",
35
+ "@atlaspack/types": "2.13.2-canary.3686+be88bd9fc",
36
+ "@atlaspack/utils": "2.13.2-canary.3686+be88bd9fc",
37
+ "@atlaspack/workers": "2.13.2-canary.3686+be88bd9fc",
38
38
  "@mischnic/json-sourcemap": "^0.1.0",
39
39
  "@parcel/source-map": "^2.1.1",
40
40
  "base-x": "^3.0.8",
@@ -66,5 +66,5 @@
66
66
  "browser": {
67
67
  "./src/serializerCore.js": "./src/serializerCore.browser.js"
68
68
  },
69
- "gitHead": "cd964eed5a330ae63733656ded691d1ea3afe4e3"
69
+ "gitHead": "be88bd9fc4cbc1c579685bf2e5d834b4136a6c7c"
70
70
  }
@@ -10,11 +10,7 @@ import ThrowableDiagnostic, {
10
10
  generateJSONCodeHighlights,
11
11
  md,
12
12
  } from '@atlaspack/diagnostic';
13
- import {
14
- findAlternativeNodeModules,
15
- loadConfig,
16
- resolveConfig,
17
- } from '@atlaspack/utils';
13
+ import {findAlternativeNodeModules, resolveConfig} from '@atlaspack/utils';
18
14
  import {type ProjectPath, toProjectPath} from './projectPath';
19
15
  import {version as ATLASPACK_VERSION} from '../package.json';
20
16
 
@@ -32,73 +28,32 @@ export default async function loadPlugin<T>(
32
28
  resolveFrom: ProjectPath,
33
29
  |}> {
34
30
  let resolveFrom = configPath;
35
- if (resolveFrom.includes(NODE_MODULES)) {
36
- // Config packages can reference plugins, but cannot contain other plugins within them.
37
- // This forces every published plugin to be published separately so they can be mixed and matched if needed.
38
- if (pluginName.startsWith('.')) {
39
- let configContents = await options.inputFS.readFile(configPath, 'utf8');
40
- throw new ThrowableDiagnostic({
41
- diagnostic: {
42
- message: md`Local plugins are not supported in Atlaspack config packages. Please publish "${pluginName}" as a separate npm package.`,
43
- origin: '@atlaspack/core',
44
- codeFrames: keyPath
45
- ? [
46
- {
47
- filePath: configPath,
48
- language: 'json5',
49
- code: configContents,
50
- codeHighlights: generateJSONCodeHighlights(configContents, [
51
- {
52
- key: keyPath,
53
- type: 'value',
54
- },
55
- ]),
56
- },
57
- ]
58
- : undefined,
59
- },
60
- });
61
- }
62
31
 
63
- let configPkg = await loadConfig(
64
- options.inputFS,
65
- resolveFrom,
66
- ['package.json'],
67
- options.projectRoot,
68
- );
69
- if (
70
- configPkg != null &&
71
- configPkg.config.dependencies?.[pluginName] == null
72
- ) {
73
- let contents = await options.inputFS.readFile(
74
- configPkg.files[0].filePath,
75
- 'utf8',
76
- );
77
- throw new ThrowableDiagnostic({
78
- diagnostic: {
79
- message: md`Could not determine version of ${pluginName} in ${path.relative(
80
- process.cwd(),
81
- resolveFrom,
82
- )}. Include it in "dependencies".`,
83
- origin: '@atlaspack/core',
84
- codeFrames: configPkg.config.dependencies
85
- ? [
86
- {
87
- filePath: configPkg.files[0].filePath,
88
- language: 'json5',
89
- code: contents,
90
- codeHighlights: generateJSONCodeHighlights(contents, [
91
- {
92
- key: '/dependencies',
93
- type: 'key',
94
- },
95
- ]),
96
- },
97
- ]
98
- : undefined,
99
- },
100
- });
101
- }
32
+ // Config packages can reference plugins, but cannot contain other plugins within them.
33
+ // This forces every published plugin to be published separately so they can be mixed and matched if needed.
34
+ if (resolveFrom.includes(NODE_MODULES) && pluginName.startsWith('.')) {
35
+ let configContents = await options.inputFS.readFile(configPath, 'utf8');
36
+ throw new ThrowableDiagnostic({
37
+ diagnostic: {
38
+ message: md`Local plugins are not supported in Atlaspack config packages. Please publish "${pluginName}" as a separate npm package.`,
39
+ origin: '@atlaspack/core',
40
+ codeFrames: keyPath
41
+ ? [
42
+ {
43
+ filePath: configPath,
44
+ language: 'json5',
45
+ code: configContents,
46
+ codeHighlights: generateJSONCodeHighlights(configContents, [
47
+ {
48
+ key: keyPath,
49
+ type: 'value',
50
+ },
51
+ ]),
52
+ },
53
+ ]
54
+ : undefined,
55
+ },
56
+ });
102
57
  }
103
58
 
104
59
  let resolved, pkg;