@atlaspack/resolver-glob 2.14.5-canary.18 → 2.14.5-canary.180

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,224 @@
1
1
  # @atlaspack/resolver-glob
2
2
 
3
+ ## 2.14.29
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`53dd47b`](https://github.com/atlassian-labs/atlaspack/commit/53dd47bd6d23cd47f87297347f03a609ab38a03d)]:
8
+ - @atlaspack/node-resolver-core@3.7.0
9
+ - @atlaspack/utils@2.19.1
10
+ - @atlaspack/plugin@2.14.29
11
+ - @atlaspack/types@2.15.19
12
+
13
+ ## 2.14.28
14
+
15
+ ### Patch Changes
16
+
17
+ - [#760](https://github.com/atlassian-labs/atlaspack/pull/760) [`f930003`](https://github.com/atlassian-labs/atlaspack/commit/f930003364fdc31e5487520ebe256f1a9389f579) Thanks [@marcins](https://github.com/marcins)! - Fix TypeScript errors in various packages
18
+
19
+ - Updated dependencies [[`f0349a6`](https://github.com/atlassian-labs/atlaspack/commit/f0349a6b9b04755088f121095ca6301a2ada3767)]:
20
+ - @atlaspack/utils@2.19.0
21
+ - @atlaspack/node-resolver-core@3.6.4
22
+ - @atlaspack/plugin@2.14.28
23
+ - @atlaspack/types@2.15.18
24
+
25
+ ## 2.14.27
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies []:
30
+ - @atlaspack/utils@2.18.4
31
+ - @atlaspack/node-resolver-core@3.6.3
32
+ - @atlaspack/plugin@2.14.27
33
+
34
+ ## 2.14.26
35
+
36
+ ### Patch Changes
37
+
38
+ - [#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
39
+
40
+ - Updated dependencies [[`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd), [`889c65c`](https://github.com/atlassian-labs/atlaspack/commit/889c65cd25b811045e26a117e7404f694dde77a2)]:
41
+ - @atlaspack/node-resolver-core@3.6.2
42
+ - @atlaspack/diagnostic@2.14.3
43
+ - @atlaspack/plugin@2.14.26
44
+ - @atlaspack/utils@2.18.3
45
+
46
+ ## 2.14.25
47
+
48
+ ### Patch Changes
49
+
50
+ - Updated dependencies []:
51
+ - @atlaspack/utils@2.18.2
52
+ - @atlaspack/node-resolver-core@3.6.1
53
+ - @atlaspack/plugin@2.14.25
54
+
55
+ ## 2.14.24
56
+
57
+ ### Patch Changes
58
+
59
+ - Updated dependencies [[`7f5841c`](https://github.com/atlassian-labs/atlaspack/commit/7f5841c39df049f9546cccbeea2a7337e0337b45)]:
60
+ - @atlaspack/node-resolver-core@3.6.0
61
+ - @atlaspack/utils@2.18.1
62
+ - @atlaspack/plugin@2.14.24
63
+
64
+ ## 2.14.23
65
+
66
+ ### Patch Changes
67
+
68
+ - Updated dependencies [[`23d561e`](https://github.com/atlassian-labs/atlaspack/commit/23d561e51e68b0c38fd1ff4e4fb173e5e7b01cf2)]:
69
+ - @atlaspack/utils@2.18.0
70
+ - @atlaspack/node-resolver-core@3.5.23
71
+ - @atlaspack/plugin@2.14.23
72
+
73
+ ## 2.14.22
74
+
75
+ ### Patch Changes
76
+
77
+ - [#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
78
+
79
+ - Updated dependencies [[`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94)]:
80
+ - @atlaspack/node-resolver-core@3.5.22
81
+ - @atlaspack/diagnostic@2.14.2
82
+ - @atlaspack/plugin@2.14.22
83
+ - @atlaspack/utils@2.17.4
84
+
85
+ ## 2.14.21
86
+
87
+ ### Patch Changes
88
+
89
+ - Updated dependencies []:
90
+ - @atlaspack/utils@2.17.3
91
+ - @atlaspack/node-resolver-core@3.5.21
92
+ - @atlaspack/plugin@2.14.21
93
+
94
+ ## 2.14.20
95
+
96
+ ### Patch Changes
97
+
98
+ - [#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
99
+
100
+ - Updated dependencies [[`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa)]:
101
+ - @atlaspack/plugin@2.14.20
102
+ - @atlaspack/utils@2.17.2
103
+ - @atlaspack/node-resolver-core@3.5.20
104
+
105
+ ## 2.14.19
106
+
107
+ ### Patch Changes
108
+
109
+ - Updated dependencies []:
110
+ - @atlaspack/utils@2.17.1
111
+ - @atlaspack/node-resolver-core@3.5.19
112
+ - @atlaspack/plugin@2.14.19
113
+
114
+ ## 2.14.18
115
+
116
+ ### Patch Changes
117
+
118
+ - 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)]:
119
+ - @atlaspack/utils@2.17.0
120
+ - @atlaspack/node-resolver-core@3.5.18
121
+ - @atlaspack/plugin@2.14.18
122
+
123
+ ## 2.14.17
124
+
125
+ ### Patch Changes
126
+
127
+ - Updated dependencies []:
128
+ - @atlaspack/utils@2.16.1
129
+ - @atlaspack/node-resolver-core@3.5.17
130
+ - @atlaspack/plugin@2.14.17
131
+
132
+ ## 2.14.16
133
+
134
+ ### Patch Changes
135
+
136
+ - Updated dependencies [[`30ee2cf`](https://github.com/atlassian-labs/atlaspack/commit/30ee2cfcd34cf2646ded0eda13fdb80a2a5de529)]:
137
+ - @atlaspack/utils@2.16.0
138
+ - @atlaspack/node-resolver-core@3.5.16
139
+ - @atlaspack/plugin@2.14.16
140
+
141
+ ## 2.14.15
142
+
143
+ ### Patch Changes
144
+
145
+ - Updated dependencies []:
146
+ - @atlaspack/utils@2.15.3
147
+ - @atlaspack/node-resolver-core@3.5.15
148
+ - @atlaspack/plugin@2.14.15
149
+
150
+ ## 2.14.14
151
+
152
+ ### Patch Changes
153
+
154
+ - Updated dependencies []:
155
+ - @atlaspack/utils@2.15.2
156
+ - @atlaspack/node-resolver-core@3.5.14
157
+ - @atlaspack/plugin@2.14.14
158
+
159
+ ## 2.14.13
160
+
161
+ ### Patch Changes
162
+
163
+ - Updated dependencies []:
164
+ - @atlaspack/utils@2.15.1
165
+ - @atlaspack/node-resolver-core@3.5.13
166
+ - @atlaspack/plugin@2.14.13
167
+
168
+ ## 2.14.12
169
+
170
+ ### Patch Changes
171
+
172
+ - Updated dependencies [[`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c)]:
173
+ - @atlaspack/utils@2.15.0
174
+ - @atlaspack/node-resolver-core@3.5.12
175
+ - @atlaspack/plugin@2.14.12
176
+
177
+ ## 2.14.11
178
+
179
+ ### Patch Changes
180
+
181
+ - Updated dependencies []:
182
+ - @atlaspack/utils@2.14.11
183
+ - @atlaspack/node-resolver-core@3.5.11
184
+ - @atlaspack/plugin@2.14.11
185
+
186
+ ## 2.14.10
187
+
188
+ ### Patch Changes
189
+
190
+ - Updated dependencies []:
191
+ - @atlaspack/node-resolver-core@3.5.10
192
+ - @atlaspack/plugin@2.14.10
193
+ - @atlaspack/utils@2.14.10
194
+
195
+ ## 2.14.9
196
+
197
+ ### Patch Changes
198
+
199
+ - Updated dependencies []:
200
+ - @atlaspack/utils@2.14.9
201
+ - @atlaspack/node-resolver-core@3.5.9
202
+ - @atlaspack/plugin@2.14.9
203
+
204
+ ## 2.14.8
205
+
206
+ ### Patch Changes
207
+
208
+ - Updated dependencies []:
209
+ - @atlaspack/utils@2.14.8
210
+ - @atlaspack/node-resolver-core@3.5.8
211
+ - @atlaspack/plugin@2.14.8
212
+
213
+ ## 2.14.7
214
+
215
+ ### Patch Changes
216
+
217
+ - Updated dependencies []:
218
+ - @atlaspack/utils@2.14.7
219
+ - @atlaspack/node-resolver-core@3.5.7
220
+ - @atlaspack/plugin@2.14.7
221
+
3
222
  ## 2.14.6
4
223
 
5
224
  ### Patch Changes
@@ -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.18+556d6ab8e",
3
+ "version": "2.14.5-canary.180+58b9fb037",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -9,18 +9,24 @@
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.86+556d6ab8e",
19
- "@atlaspack/node-resolver-core": "3.5.5-canary.18+556d6ab8e",
20
- "@atlaspack/plugin": "2.14.5-canary.18+556d6ab8e",
21
- "@atlaspack/utils": "2.14.5-canary.18+556d6ab8e",
19
+ "@atlaspack/diagnostic": "2.14.1-canary.248+58b9fb037",
20
+ "@atlaspack/node-resolver-core": "3.5.5-canary.180+58b9fb037",
21
+ "@atlaspack/plugin": "2.14.5-canary.180+58b9fb037",
22
+ "@atlaspack/types": "2.14.5-canary.180+58b9fb037",
23
+ "@atlaspack/utils": "2.14.5-canary.180+58b9fb037",
22
24
  "nullthrows": "^1.1.1"
23
25
  },
24
26
  "type": "commonjs",
25
- "gitHead": "556d6ab8ede759fa7f37fcd3f4da336ef1c55e8f"
27
+ "scripts": {
28
+ "check-ts": "tsc --emitDeclarationOnly --rootDir src",
29
+ "build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
30
+ },
31
+ "gitHead": "58b9fb037680a36a0b4af7890f2a03532095b88f"
26
32
  }
@@ -1,4 +1,3 @@
1
- // @flow
2
1
  import {Resolver} from '@atlaspack/plugin';
3
2
  import {
4
3
  isGlob,
@@ -7,6 +6,11 @@ import {
7
6
  relativePath,
8
7
  normalizeSeparators,
9
8
  } from '@atlaspack/utils';
9
+ import type {
10
+ Dependency,
11
+ FileCreateInvalidation,
12
+ FilePath,
13
+ } from '@atlaspack/types';
10
14
  import path from 'path';
11
15
  import nullthrows from 'nullthrows';
12
16
  import ThrowableDiagnostic, {
@@ -17,7 +21,10 @@ import invariant from 'assert';
17
21
 
18
22
  const jsAssetTypes = new Set(['jsx', 'ts', 'tsx', 'mjs', 'mts', 'cts']);
19
23
 
20
- function errorToThrowableDiagnostic(error, dependency): ThrowableDiagnostic {
24
+ function errorToThrowableDiagnostic(
25
+ error: string,
26
+ dependency: Dependency,
27
+ ): ThrowableDiagnostic {
21
28
  return new ThrowableDiagnostic({
22
29
  diagnostic: {
23
30
  message: error,
@@ -34,7 +41,7 @@ function errorToThrowableDiagnostic(error, dependency): ThrowableDiagnostic {
34
41
  });
35
42
  }
36
43
 
37
- export default (new Resolver({
44
+ export default new Resolver({
38
45
  async resolve({dependency, options, specifier, pipeline, logger}) {
39
46
  if (!isGlob(specifier)) {
40
47
  return;
@@ -65,8 +72,8 @@ export default (new Resolver({
65
72
  throw errorToThrowableDiagnostic(error, dependency);
66
73
  }
67
74
 
68
- let invalidateOnFileCreate = [];
69
- let invalidateOnFileChange = new Set();
75
+ let invalidateOnFileCreate: Array<FileCreateInvalidation> = [];
76
+ let invalidateOnFileChange = new Set<string>();
70
77
 
71
78
  switch (specifier[0]) {
72
79
  // Path specifier
@@ -137,7 +144,7 @@ export default (new Resolver({
137
144
  env: dependency.env,
138
145
  sourcePath: dependency.sourcePath,
139
146
  });
140
- } catch (err) {
147
+ } catch (err: any) {
141
148
  if (err instanceof ThrowableDiagnostic) {
142
149
  // Return instead of throwing so we can provide invalidations.
143
150
  return {
@@ -187,14 +194,14 @@ export default (new Resolver({
187
194
  let code = '';
188
195
  if (sourceAssetType === 'js') {
189
196
  let re = globToRegex(normalized, {capture: true});
190
- let matches = {};
197
+ let matches: Record<string, any> = {};
191
198
  for (let [file, relative] of results) {
192
199
  let match = file.match(re);
193
200
  if (!match) continue;
194
201
  let parts = match
195
202
  .slice(1)
196
203
  .filter(Boolean)
197
- .reduce((a, p) => a.concat(p.split('/')), []);
204
+ .reduce<Array<any>>((a, p) => a.concat(p.split('/')), []);
198
205
  set(matches, parts, relative);
199
206
  }
200
207
 
@@ -222,9 +229,13 @@ export default (new Resolver({
222
229
  priority: 'sync',
223
230
  };
224
231
  },
225
- }): Resolver);
232
+ }) as Resolver<unknown>;
226
233
 
227
- function set(obj, path, value) {
234
+ function set(
235
+ obj: Record<string, any>,
236
+ path: Array<never> | Array<string>,
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,12 @@ 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
+ function generate(
253
+ matches: Record<string, any>,
254
+ isAsync: boolean,
255
+ indent = '',
256
+ count = 0,
257
+ ) {
242
258
  if (typeof matches === 'string') {
243
259
  if (isAsync) {
244
260
  return {
package/tsconfig.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "include": ["src"]
4
+ }