@atlaspack/resolver-glob 2.14.5-canary.17 → 2.14.5-canary.171

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/CHANGELOG.md CHANGED
@@ -1,5 +1,202 @@
1
1
  # @atlaspack/resolver-glob
2
2
 
3
+ ## 2.14.27
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - @atlaspack/utils@2.18.4
9
+ - @atlaspack/node-resolver-core@3.6.3
10
+ - @atlaspack/plugin@2.14.27
11
+
12
+ ## 2.14.26
13
+
14
+ ### Patch Changes
15
+
16
+ - [#742](https://github.com/atlassian-labs/atlaspack/pull/742) [`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd) Thanks [@yamadapc](https://github.com/yamadapc)! - Internal changes and bug fixes to environmentDeduplication flag
17
+
18
+ - Updated dependencies [[`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd), [`889c65c`](https://github.com/atlassian-labs/atlaspack/commit/889c65cd25b811045e26a117e7404f694dde77a2)]:
19
+ - @atlaspack/node-resolver-core@3.6.2
20
+ - @atlaspack/diagnostic@2.14.3
21
+ - @atlaspack/plugin@2.14.26
22
+ - @atlaspack/utils@2.18.3
23
+
24
+ ## 2.14.25
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies []:
29
+ - @atlaspack/utils@2.18.2
30
+ - @atlaspack/node-resolver-core@3.6.1
31
+ - @atlaspack/plugin@2.14.25
32
+
33
+ ## 2.14.24
34
+
35
+ ### Patch Changes
36
+
37
+ - Updated dependencies [[`7f5841c`](https://github.com/atlassian-labs/atlaspack/commit/7f5841c39df049f9546cccbeea2a7337e0337b45)]:
38
+ - @atlaspack/node-resolver-core@3.6.0
39
+ - @atlaspack/utils@2.18.1
40
+ - @atlaspack/plugin@2.14.24
41
+
42
+ ## 2.14.23
43
+
44
+ ### Patch Changes
45
+
46
+ - Updated dependencies [[`23d561e`](https://github.com/atlassian-labs/atlaspack/commit/23d561e51e68b0c38fd1ff4e4fb173e5e7b01cf2)]:
47
+ - @atlaspack/utils@2.18.0
48
+ - @atlaspack/node-resolver-core@3.5.23
49
+ - @atlaspack/plugin@2.14.23
50
+
51
+ ## 2.14.22
52
+
53
+ ### Patch Changes
54
+
55
+ - [#720](https://github.com/atlassian-labs/atlaspack/pull/720) [`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94) Thanks [@alshdavid](https://github.com/alshdavid)! - Migrate to TypeScript
56
+
57
+ - Updated dependencies [[`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94)]:
58
+ - @atlaspack/node-resolver-core@3.5.22
59
+ - @atlaspack/diagnostic@2.14.2
60
+ - @atlaspack/plugin@2.14.22
61
+ - @atlaspack/utils@2.17.4
62
+
63
+ ## 2.14.21
64
+
65
+ ### Patch Changes
66
+
67
+ - Updated dependencies []:
68
+ - @atlaspack/utils@2.17.3
69
+ - @atlaspack/node-resolver-core@3.5.21
70
+ - @atlaspack/plugin@2.14.21
71
+
72
+ ## 2.14.20
73
+
74
+ ### Patch Changes
75
+
76
+ - [#702](https://github.com/atlassian-labs/atlaspack/pull/702) [`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa) Thanks [@alshdavid](https://github.com/alshdavid)! - Fixes to Flow types
77
+
78
+ - Updated dependencies [[`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa)]:
79
+ - @atlaspack/plugin@2.14.20
80
+ - @atlaspack/utils@2.17.2
81
+ - @atlaspack/node-resolver-core@3.5.20
82
+
83
+ ## 2.14.19
84
+
85
+ ### Patch Changes
86
+
87
+ - Updated dependencies []:
88
+ - @atlaspack/utils@2.17.1
89
+ - @atlaspack/node-resolver-core@3.5.19
90
+ - @atlaspack/plugin@2.14.19
91
+
92
+ ## 2.14.18
93
+
94
+ ### Patch Changes
95
+
96
+ - Updated dependencies [[`dbb4072`](https://github.com/atlassian-labs/atlaspack/commit/dbb40721ebeb45990a14ba04e6b44e7f836fb32d), [`de23e0c`](https://github.com/atlassian-labs/atlaspack/commit/de23e0ce49d5504fe3947ac26640a3d951087da3), [`18a57cf`](https://github.com/atlassian-labs/atlaspack/commit/18a57cf8a4789b2de5ad8e2676f317a26cc91417), [`a5ed1b4`](https://github.com/atlassian-labs/atlaspack/commit/a5ed1b414498560f393ff491af4da25b6e8dde56)]:
97
+ - @atlaspack/utils@2.17.0
98
+ - @atlaspack/node-resolver-core@3.5.18
99
+ - @atlaspack/plugin@2.14.18
100
+
101
+ ## 2.14.17
102
+
103
+ ### Patch Changes
104
+
105
+ - Updated dependencies []:
106
+ - @atlaspack/utils@2.16.1
107
+ - @atlaspack/node-resolver-core@3.5.17
108
+ - @atlaspack/plugin@2.14.17
109
+
110
+ ## 2.14.16
111
+
112
+ ### Patch Changes
113
+
114
+ - Updated dependencies [[`30ee2cf`](https://github.com/atlassian-labs/atlaspack/commit/30ee2cfcd34cf2646ded0eda13fdb80a2a5de529)]:
115
+ - @atlaspack/utils@2.16.0
116
+ - @atlaspack/node-resolver-core@3.5.16
117
+ - @atlaspack/plugin@2.14.16
118
+
119
+ ## 2.14.15
120
+
121
+ ### Patch Changes
122
+
123
+ - Updated dependencies []:
124
+ - @atlaspack/utils@2.15.3
125
+ - @atlaspack/node-resolver-core@3.5.15
126
+ - @atlaspack/plugin@2.14.15
127
+
128
+ ## 2.14.14
129
+
130
+ ### Patch Changes
131
+
132
+ - Updated dependencies []:
133
+ - @atlaspack/utils@2.15.2
134
+ - @atlaspack/node-resolver-core@3.5.14
135
+ - @atlaspack/plugin@2.14.14
136
+
137
+ ## 2.14.13
138
+
139
+ ### Patch Changes
140
+
141
+ - Updated dependencies []:
142
+ - @atlaspack/utils@2.15.1
143
+ - @atlaspack/node-resolver-core@3.5.13
144
+ - @atlaspack/plugin@2.14.13
145
+
146
+ ## 2.14.12
147
+
148
+ ### Patch Changes
149
+
150
+ - Updated dependencies [[`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c)]:
151
+ - @atlaspack/utils@2.15.0
152
+ - @atlaspack/node-resolver-core@3.5.12
153
+ - @atlaspack/plugin@2.14.12
154
+
155
+ ## 2.14.11
156
+
157
+ ### Patch Changes
158
+
159
+ - Updated dependencies []:
160
+ - @atlaspack/utils@2.14.11
161
+ - @atlaspack/node-resolver-core@3.5.11
162
+ - @atlaspack/plugin@2.14.11
163
+
164
+ ## 2.14.10
165
+
166
+ ### Patch Changes
167
+
168
+ - Updated dependencies []:
169
+ - @atlaspack/node-resolver-core@3.5.10
170
+ - @atlaspack/plugin@2.14.10
171
+ - @atlaspack/utils@2.14.10
172
+
173
+ ## 2.14.9
174
+
175
+ ### Patch Changes
176
+
177
+ - Updated dependencies []:
178
+ - @atlaspack/utils@2.14.9
179
+ - @atlaspack/node-resolver-core@3.5.9
180
+ - @atlaspack/plugin@2.14.9
181
+
182
+ ## 2.14.8
183
+
184
+ ### Patch Changes
185
+
186
+ - Updated dependencies []:
187
+ - @atlaspack/utils@2.14.8
188
+ - @atlaspack/node-resolver-core@3.5.8
189
+ - @atlaspack/plugin@2.14.8
190
+
191
+ ## 2.14.7
192
+
193
+ ### Patch Changes
194
+
195
+ - Updated dependencies []:
196
+ - @atlaspack/utils@2.14.7
197
+ - @atlaspack/node-resolver-core@3.5.7
198
+ - @atlaspack/plugin@2.14.7
199
+
3
200
  ## 2.14.6
4
201
 
5
202
  ### Patch Changes
@@ -57,7 +57,9 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
57
57
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
58
58
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
59
59
  const jsAssetTypes = new Set(['jsx', 'ts', 'tsx', 'mjs', 'mts', 'cts']);
60
- function errorToThrowableDiagnostic(error, dependency) {
60
+ function errorToThrowableDiagnostic(error,
61
+ // @ts-expect-error TS2304
62
+ dependency) {
61
63
  return new (_diagnostic().default)({
62
64
  diagnostic: {
63
65
  message: error,
@@ -68,6 +70,7 @@ function errorToThrowableDiagnostic(error, dependency) {
68
70
  });
69
71
  }
70
72
  var _default = exports.default = new (_plugin().Resolver)({
73
+ // @ts-expect-error TS2322
71
74
  async resolve({
72
75
  dependency,
73
76
  options,
@@ -94,6 +97,8 @@ var _default = exports.default = new (_plugin().Resolver)({
94
97
  if (error) {
95
98
  throw errorToThrowableDiagnostic(error, dependency);
96
99
  }
100
+
101
+ // @ts-expect-error TS2304
97
102
  let invalidateOnFileCreate = [];
98
103
  let invalidateOnFileChange = new Set();
99
104
  switch (specifier[0]) {
@@ -232,7 +237,11 @@ var _default = exports.default = new (_plugin().Resolver)({
232
237
  };
233
238
  }
234
239
  });
235
- function set(obj, path, value) {
240
+ function set(
241
+ // @ts-expect-error TS7006
242
+ obj, path,
243
+ // @ts-expect-error TS2304
244
+ value) {
236
245
  for (let i = 0; i < path.length - 1; i++) {
237
246
  let part = path[i];
238
247
  if (obj[part] == null) {
@@ -242,6 +251,8 @@ function set(obj, path, value) {
242
251
  }
243
252
  obj[path[path.length - 1]] = value;
244
253
  }
254
+
255
+ // @ts-expect-error TS7006
245
256
  function generate(matches, isAsync, indent = '', count = 0) {
246
257
  if (typeof matches === 'string') {
247
258
  if (isAsync) {
@@ -0,0 +1,3 @@
1
+ import { Resolver } from '@atlaspack/plugin';
2
+ declare const _default: Resolver<unknown>;
3
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/resolver-glob",
3
- "version": "2.14.5-canary.17+a1773d2a6",
3
+ "version": "2.14.5-canary.171+f0349a6b9",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -9,18 +9,23 @@
9
9
  "type": "git",
10
10
  "url": "https://github.com/atlassian-labs/atlaspack.git"
11
11
  },
12
- "main": "lib/GlobResolver.js",
13
- "source": "src/GlobResolver.js",
12
+ "main": "./lib/GlobResolver.js",
13
+ "source": "./src/GlobResolver.ts",
14
+ "types": "./lib/types/GlobResolver.d.ts",
14
15
  "engines": {
15
16
  "node": ">= 16.0.0"
16
17
  },
17
18
  "dependencies": {
18
- "@atlaspack/diagnostic": "2.14.1-canary.85+a1773d2a6",
19
- "@atlaspack/node-resolver-core": "3.5.5-canary.17+a1773d2a6",
20
- "@atlaspack/plugin": "2.14.5-canary.17+a1773d2a6",
21
- "@atlaspack/utils": "2.14.5-canary.17+a1773d2a6",
19
+ "@atlaspack/diagnostic": "2.14.1-canary.239+f0349a6b9",
20
+ "@atlaspack/node-resolver-core": "3.5.5-canary.171+f0349a6b9",
21
+ "@atlaspack/plugin": "2.14.5-canary.171+f0349a6b9",
22
+ "@atlaspack/utils": "2.14.5-canary.171+f0349a6b9",
22
23
  "nullthrows": "^1.1.1"
23
24
  },
24
25
  "type": "commonjs",
25
- "gitHead": "a1773d2a62d0ef7805ac7524621dcabcc1afe929"
26
+ "scripts": {
27
+ "check-ts": "tsc --emitDeclarationOnly --rootDir src",
28
+ "build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
29
+ },
30
+ "gitHead": "f0349a6b9b04755088f121095ca6301a2ada3767"
26
31
  }
@@ -1,4 +1,3 @@
1
- // @flow
2
1
  import {Resolver} from '@atlaspack/plugin';
3
2
  import {
4
3
  isGlob,
@@ -17,7 +16,11 @@ import invariant from 'assert';
17
16
 
18
17
  const jsAssetTypes = new Set(['jsx', 'ts', 'tsx', 'mjs', 'mts', 'cts']);
19
18
 
20
- function errorToThrowableDiagnostic(error, dependency): ThrowableDiagnostic {
19
+ function errorToThrowableDiagnostic(
20
+ error: string,
21
+ // @ts-expect-error TS2304
22
+ dependency: Dependency,
23
+ ): ThrowableDiagnostic {
21
24
  return new ThrowableDiagnostic({
22
25
  diagnostic: {
23
26
  message: error,
@@ -34,7 +37,8 @@ function errorToThrowableDiagnostic(error, dependency): ThrowableDiagnostic {
34
37
  });
35
38
  }
36
39
 
37
- export default (new Resolver({
40
+ export default new Resolver({
41
+ // @ts-expect-error TS2322
38
42
  async resolve({dependency, options, specifier, pipeline, logger}) {
39
43
  if (!isGlob(specifier)) {
40
44
  return;
@@ -65,7 +69,8 @@ export default (new Resolver({
65
69
  throw errorToThrowableDiagnostic(error, dependency);
66
70
  }
67
71
 
68
- let invalidateOnFileCreate = [];
72
+ // @ts-expect-error TS2304
73
+ let invalidateOnFileCreate: Array<FileCreateInvalidation> = [];
69
74
  let invalidateOnFileChange = new Set();
70
75
 
71
76
  switch (specifier[0]) {
@@ -137,7 +142,7 @@ export default (new Resolver({
137
142
  env: dependency.env,
138
143
  sourcePath: dependency.sourcePath,
139
144
  });
140
- } catch (err) {
145
+ } catch (err: any) {
141
146
  if (err instanceof ThrowableDiagnostic) {
142
147
  // Return instead of throwing so we can provide invalidations.
143
148
  return {
@@ -187,14 +192,14 @@ export default (new Resolver({
187
192
  let code = '';
188
193
  if (sourceAssetType === 'js') {
189
194
  let re = globToRegex(normalized, {capture: true});
190
- let matches = {};
195
+ let matches: Record<string, any> = {};
191
196
  for (let [file, relative] of results) {
192
197
  let match = file.match(re);
193
198
  if (!match) continue;
194
199
  let parts = match
195
200
  .slice(1)
196
201
  .filter(Boolean)
197
- .reduce((a, p) => a.concat(p.split('/')), []);
202
+ .reduce<Array<any>>((a, p) => a.concat(p.split('/')), []);
198
203
  set(matches, parts, relative);
199
204
  }
200
205
 
@@ -222,9 +227,15 @@ export default (new Resolver({
222
227
  priority: 'sync',
223
228
  };
224
229
  },
225
- }): Resolver);
226
-
227
- function set(obj, path, value) {
230
+ }) as Resolver<unknown>;
231
+
232
+ function set(
233
+ // @ts-expect-error TS7006
234
+ obj,
235
+ path: Array<never> | Array<string>,
236
+ // @ts-expect-error TS2304
237
+ value: FilePath | string,
238
+ ) {
228
239
  for (let i = 0; i < path.length - 1; i++) {
229
240
  let part = path[i];
230
241
 
@@ -238,7 +249,8 @@ function set(obj, path, value) {
238
249
  obj[path[path.length - 1]] = value;
239
250
  }
240
251
 
241
- function generate(matches, isAsync, indent = '', count = 0) {
252
+ // @ts-expect-error TS7006
253
+ function generate(matches, isAsync: boolean, indent = '', count = 0) {
242
254
  if (typeof matches === 'string') {
243
255
  if (isAsync) {
244
256
  return {
package/tsconfig.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "include": ["src"]
4
+ }