@atlaspack/resolver-glob 2.14.5-canary.20 → 2.14.5-canary.200

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,238 @@
1
1
  # @atlaspack/resolver-glob
2
2
 
3
+ ## 2.14.31
4
+
5
+ ### Patch Changes
6
+
7
+ - [#785](https://github.com/atlassian-labs/atlaspack/pull/785) [`0e7dd5e`](https://github.com/atlassian-labs/atlaspack/commit/0e7dd5ec6fbe05aa9e0bb5775a9d0975f206a922) Thanks [@matt-koko](https://github.com/matt-koko)! - We need to re-publish every package in Atlaspack with the corrected types field.
8
+
9
+ - Updated dependencies [[`0e7dd5e`](https://github.com/atlassian-labs/atlaspack/commit/0e7dd5ec6fbe05aa9e0bb5775a9d0975f206a922)]:
10
+ - @atlaspack/diagnostic@2.14.4
11
+ - @atlaspack/plugin@2.14.31
12
+ - @atlaspack/types@2.15.21
13
+ - @atlaspack/utils@2.19.3
14
+ - @atlaspack/node-resolver-core@3.7.2
15
+
16
+ ## 2.14.30
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies []:
21
+ - @atlaspack/utils@2.19.2
22
+ - @atlaspack/node-resolver-core@3.7.1
23
+ - @atlaspack/plugin@2.14.30
24
+ - @atlaspack/types@2.15.20
25
+
26
+ ## 2.14.29
27
+
28
+ ### Patch Changes
29
+
30
+ - Updated dependencies [[`53dd47b`](https://github.com/atlassian-labs/atlaspack/commit/53dd47bd6d23cd47f87297347f03a609ab38a03d)]:
31
+ - @atlaspack/node-resolver-core@3.7.0
32
+ - @atlaspack/utils@2.19.1
33
+ - @atlaspack/plugin@2.14.29
34
+ - @atlaspack/types@2.15.19
35
+
36
+ ## 2.14.28
37
+
38
+ ### Patch Changes
39
+
40
+ - [#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
41
+
42
+ - Updated dependencies [[`f0349a6`](https://github.com/atlassian-labs/atlaspack/commit/f0349a6b9b04755088f121095ca6301a2ada3767)]:
43
+ - @atlaspack/utils@2.19.0
44
+ - @atlaspack/node-resolver-core@3.6.4
45
+ - @atlaspack/plugin@2.14.28
46
+ - @atlaspack/types@2.15.18
47
+
48
+ ## 2.14.27
49
+
50
+ ### Patch Changes
51
+
52
+ - Updated dependencies []:
53
+ - @atlaspack/utils@2.18.4
54
+ - @atlaspack/node-resolver-core@3.6.3
55
+ - @atlaspack/plugin@2.14.27
56
+
57
+ ## 2.14.26
58
+
59
+ ### Patch Changes
60
+
61
+ - [#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
62
+
63
+ - Updated dependencies [[`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd), [`889c65c`](https://github.com/atlassian-labs/atlaspack/commit/889c65cd25b811045e26a117e7404f694dde77a2)]:
64
+ - @atlaspack/node-resolver-core@3.6.2
65
+ - @atlaspack/diagnostic@2.14.3
66
+ - @atlaspack/plugin@2.14.26
67
+ - @atlaspack/utils@2.18.3
68
+
69
+ ## 2.14.25
70
+
71
+ ### Patch Changes
72
+
73
+ - Updated dependencies []:
74
+ - @atlaspack/utils@2.18.2
75
+ - @atlaspack/node-resolver-core@3.6.1
76
+ - @atlaspack/plugin@2.14.25
77
+
78
+ ## 2.14.24
79
+
80
+ ### Patch Changes
81
+
82
+ - Updated dependencies [[`7f5841c`](https://github.com/atlassian-labs/atlaspack/commit/7f5841c39df049f9546cccbeea2a7337e0337b45)]:
83
+ - @atlaspack/node-resolver-core@3.6.0
84
+ - @atlaspack/utils@2.18.1
85
+ - @atlaspack/plugin@2.14.24
86
+
87
+ ## 2.14.23
88
+
89
+ ### Patch Changes
90
+
91
+ - Updated dependencies [[`23d561e`](https://github.com/atlassian-labs/atlaspack/commit/23d561e51e68b0c38fd1ff4e4fb173e5e7b01cf2)]:
92
+ - @atlaspack/utils@2.18.0
93
+ - @atlaspack/node-resolver-core@3.5.23
94
+ - @atlaspack/plugin@2.14.23
95
+
96
+ ## 2.14.22
97
+
98
+ ### Patch Changes
99
+
100
+ - [#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
101
+
102
+ - Updated dependencies [[`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94)]:
103
+ - @atlaspack/node-resolver-core@3.5.22
104
+ - @atlaspack/diagnostic@2.14.2
105
+ - @atlaspack/plugin@2.14.22
106
+ - @atlaspack/utils@2.17.4
107
+
108
+ ## 2.14.21
109
+
110
+ ### Patch Changes
111
+
112
+ - Updated dependencies []:
113
+ - @atlaspack/utils@2.17.3
114
+ - @atlaspack/node-resolver-core@3.5.21
115
+ - @atlaspack/plugin@2.14.21
116
+
117
+ ## 2.14.20
118
+
119
+ ### Patch Changes
120
+
121
+ - [#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
122
+
123
+ - Updated dependencies [[`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa)]:
124
+ - @atlaspack/plugin@2.14.20
125
+ - @atlaspack/utils@2.17.2
126
+ - @atlaspack/node-resolver-core@3.5.20
127
+
128
+ ## 2.14.19
129
+
130
+ ### Patch Changes
131
+
132
+ - Updated dependencies []:
133
+ - @atlaspack/utils@2.17.1
134
+ - @atlaspack/node-resolver-core@3.5.19
135
+ - @atlaspack/plugin@2.14.19
136
+
137
+ ## 2.14.18
138
+
139
+ ### Patch Changes
140
+
141
+ - 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)]:
142
+ - @atlaspack/utils@2.17.0
143
+ - @atlaspack/node-resolver-core@3.5.18
144
+ - @atlaspack/plugin@2.14.18
145
+
146
+ ## 2.14.17
147
+
148
+ ### Patch Changes
149
+
150
+ - Updated dependencies []:
151
+ - @atlaspack/utils@2.16.1
152
+ - @atlaspack/node-resolver-core@3.5.17
153
+ - @atlaspack/plugin@2.14.17
154
+
155
+ ## 2.14.16
156
+
157
+ ### Patch Changes
158
+
159
+ - Updated dependencies [[`30ee2cf`](https://github.com/atlassian-labs/atlaspack/commit/30ee2cfcd34cf2646ded0eda13fdb80a2a5de529)]:
160
+ - @atlaspack/utils@2.16.0
161
+ - @atlaspack/node-resolver-core@3.5.16
162
+ - @atlaspack/plugin@2.14.16
163
+
164
+ ## 2.14.15
165
+
166
+ ### Patch Changes
167
+
168
+ - Updated dependencies []:
169
+ - @atlaspack/utils@2.15.3
170
+ - @atlaspack/node-resolver-core@3.5.15
171
+ - @atlaspack/plugin@2.14.15
172
+
173
+ ## 2.14.14
174
+
175
+ ### Patch Changes
176
+
177
+ - Updated dependencies []:
178
+ - @atlaspack/utils@2.15.2
179
+ - @atlaspack/node-resolver-core@3.5.14
180
+ - @atlaspack/plugin@2.14.14
181
+
182
+ ## 2.14.13
183
+
184
+ ### Patch Changes
185
+
186
+ - Updated dependencies []:
187
+ - @atlaspack/utils@2.15.1
188
+ - @atlaspack/node-resolver-core@3.5.13
189
+ - @atlaspack/plugin@2.14.13
190
+
191
+ ## 2.14.12
192
+
193
+ ### Patch Changes
194
+
195
+ - Updated dependencies [[`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c)]:
196
+ - @atlaspack/utils@2.15.0
197
+ - @atlaspack/node-resolver-core@3.5.12
198
+ - @atlaspack/plugin@2.14.12
199
+
200
+ ## 2.14.11
201
+
202
+ ### Patch Changes
203
+
204
+ - Updated dependencies []:
205
+ - @atlaspack/utils@2.14.11
206
+ - @atlaspack/node-resolver-core@3.5.11
207
+ - @atlaspack/plugin@2.14.11
208
+
209
+ ## 2.14.10
210
+
211
+ ### Patch Changes
212
+
213
+ - Updated dependencies []:
214
+ - @atlaspack/node-resolver-core@3.5.10
215
+ - @atlaspack/plugin@2.14.10
216
+ - @atlaspack/utils@2.14.10
217
+
218
+ ## 2.14.9
219
+
220
+ ### Patch Changes
221
+
222
+ - Updated dependencies []:
223
+ - @atlaspack/utils@2.14.9
224
+ - @atlaspack/node-resolver-core@3.5.9
225
+ - @atlaspack/plugin@2.14.9
226
+
227
+ ## 2.14.8
228
+
229
+ ### Patch Changes
230
+
231
+ - Updated dependencies []:
232
+ - @atlaspack/utils@2.14.8
233
+ - @atlaspack/node-resolver-core@3.5.8
234
+ - @atlaspack/plugin@2.14.8
235
+
3
236
  ## 2.14.7
4
237
 
5
238
  ### 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.20+30f60175b",
3
+ "version": "2.14.5-canary.200+10ee3fa5b",
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.88+30f60175b",
19
- "@atlaspack/node-resolver-core": "3.5.5-canary.20+30f60175b",
20
- "@atlaspack/plugin": "2.14.5-canary.20+30f60175b",
21
- "@atlaspack/utils": "2.14.5-canary.20+30f60175b",
19
+ "@atlaspack/diagnostic": "2.14.1-canary.268+10ee3fa5b",
20
+ "@atlaspack/node-resolver-core": "3.5.5-canary.200+10ee3fa5b",
21
+ "@atlaspack/plugin": "2.14.5-canary.200+10ee3fa5b",
22
+ "@atlaspack/types": "2.14.5-canary.200+10ee3fa5b",
23
+ "@atlaspack/utils": "2.14.5-canary.200+10ee3fa5b",
22
24
  "nullthrows": "^1.1.1"
23
25
  },
24
26
  "type": "commonjs",
25
- "gitHead": "30f60175ba4d272c5fc193973c63bc298584775b"
26
- }
27
+ "scripts": {
28
+ "check-ts": "tsc --emitDeclarationOnly --rootDir src",
29
+ "build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
30
+ },
31
+ "gitHead": "10ee3fa5b75a92acde8973673d9b3c5b6f3958e5"
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
+ }