@parcel/macros 2.16.5-canary.3498 → 3.0.0-alpha.1
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/macros.d.ts +6 -47
- package/package.json +7 -5
- package/LICENSE +0 -21
package/macros.d.ts
CHANGED
|
@@ -2,36 +2,16 @@ export interface MacroContext {
|
|
|
2
2
|
/** Adds an asset as a dependency of the JS module that called this macro. */
|
|
3
3
|
addAsset(asset: MacroAsset): void;
|
|
4
4
|
/** The source location of the macro call. */
|
|
5
|
-
loc: SourceLocation;
|
|
6
|
-
/** Invalidate the macro call whenever the given file changes. */
|
|
7
|
-
invalidateOnFileChange(filePath: string): void;
|
|
8
|
-
/** Invalidate the macro call when a file matching the given pattern is created. */
|
|
9
|
-
invalidateOnFileCreate(options: FileCreateInvalidation): void;
|
|
10
|
-
/** Invalidate the macro whenever the given environment variable changes. */
|
|
11
|
-
invalidateOnEnvChange(env: string): void;
|
|
12
|
-
/** Invalidate the macro whenever Parcel restarts. */
|
|
13
|
-
invalidateOnStartup(): void;
|
|
14
|
-
/** Invalidate the macro on every build. */
|
|
15
|
-
invalidateOnBuild(): void;
|
|
5
|
+
readonly loc: SourceLocation;
|
|
16
6
|
}
|
|
17
7
|
|
|
18
|
-
/**
|
|
19
|
-
* Source locations are 1-based, meaning lines and columns start at 1
|
|
20
|
-
*/
|
|
8
|
+
/** The location where a macro was called. */
|
|
21
9
|
export type SourceLocation = {
|
|
22
10
|
readonly filePath: string;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
readonly column: number;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
/** exclusive */
|
|
31
|
-
readonly end: {
|
|
32
|
-
readonly line: number;
|
|
33
|
-
readonly column: number;
|
|
34
|
-
};
|
|
11
|
+
/** The line of the start of the call expression (1-based). */
|
|
12
|
+
readonly line: number;
|
|
13
|
+
/** The column of the start of the call expression (0-based). */
|
|
14
|
+
readonly col: number;
|
|
35
15
|
};
|
|
36
16
|
|
|
37
17
|
export interface MacroAsset {
|
|
@@ -40,24 +20,3 @@ export interface MacroAsset {
|
|
|
40
20
|
/** The content of the asset. */
|
|
41
21
|
content: string;
|
|
42
22
|
}
|
|
43
|
-
|
|
44
|
-
export type FileCreateInvalidation =
|
|
45
|
-
| FileInvalidation
|
|
46
|
-
| GlobInvalidation
|
|
47
|
-
| FileAboveInvalidation;
|
|
48
|
-
|
|
49
|
-
/** Invalidate when a file matching a glob is created. */
|
|
50
|
-
export interface GlobInvalidation {
|
|
51
|
-
glob: string;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/** Invalidate when a specific file is created. */
|
|
55
|
-
export interface FileInvalidation {
|
|
56
|
-
filePath: string;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/** Invalidate when a file of a specific name is created above a certain directory in the hierarchy. */
|
|
60
|
-
export interface FileAboveInvalidation {
|
|
61
|
-
fileName: string;
|
|
62
|
-
aboveFilePath: string;
|
|
63
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parcel/macros",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -14,10 +14,12 @@
|
|
|
14
14
|
"url": "https://github.com/parcel-bundler/parcel.git"
|
|
15
15
|
},
|
|
16
16
|
"types": "macros.d.ts",
|
|
17
|
+
"files": [
|
|
18
|
+
"macros.d.ts"
|
|
19
|
+
],
|
|
17
20
|
"sideEffects": false,
|
|
18
21
|
"engines": {
|
|
19
22
|
"node": ">= 16.0.0",
|
|
20
|
-
"parcel": "^
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
}
|
|
23
|
+
"parcel": "^3.0.0-0"
|
|
24
|
+
}
|
|
25
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2017-present Devon Govett
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|