@marko/compiler 5.37.19 → 5.37.21
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/dist/taglib/index.js +24 -16
- package/dist/types.d.ts +10 -2
- package/package.json +14 -14
package/dist/taglib/index.js
CHANGED
|
@@ -37,26 +37,16 @@ function buildLookup(dirname, requestedTranslator, onError) {
|
|
|
37
37
|
loadedTranslatorsTaglibs.set(
|
|
38
38
|
translator,
|
|
39
39
|
taglibsForDir = registeredTaglibs.concat(
|
|
40
|
-
resolveOptionalTaglibs(translator.optionalTaglibs || []).
|
|
40
|
+
resolveOptionalTaglibs(translator.optionalTaglibs || [], onError).
|
|
41
41
|
concat(translator.taglibs).
|
|
42
42
|
map(([id, props]) => loadTaglib(id, props))
|
|
43
43
|
)
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
const prevOnError = _config.default.onError;
|
|
49
|
-
_config.default.onError = onError;
|
|
50
|
-
try {
|
|
51
|
-
taglibsForDir = _finder2.default.find(dirname, taglibsForDir);
|
|
52
|
-
} catch (err) {
|
|
53
|
-
_config.default.onError(err);
|
|
54
|
-
} finally {
|
|
55
|
-
_config.default.onError = prevOnError;
|
|
56
|
-
}
|
|
57
|
-
} else {
|
|
47
|
+
runAndCatchErrors(() => {
|
|
58
48
|
taglibsForDir = _finder2.default.find(dirname, taglibsForDir);
|
|
59
|
-
}
|
|
49
|
+
}, onError);
|
|
60
50
|
|
|
61
51
|
const cacheKey = taglibsForDir.
|
|
62
52
|
map((it) => it.id).
|
|
@@ -95,11 +85,13 @@ function clearCaches() {
|
|
|
95
85
|
lookupCache = Object.create(null);
|
|
96
86
|
}
|
|
97
87
|
|
|
98
|
-
function resolveOptionalTaglibs(taglibIds) {
|
|
88
|
+
function resolveOptionalTaglibs(taglibIds, onError) {
|
|
99
89
|
const resolvedTaglibs = [];
|
|
100
90
|
for (const id of taglibIds) {
|
|
101
91
|
if (hasRootDependency(id)) {
|
|
102
|
-
|
|
92
|
+
runAndCatchErrors(() => {
|
|
93
|
+
resolvedTaglibs.push(resolveTaglib(id));
|
|
94
|
+
}, onError);
|
|
103
95
|
}
|
|
104
96
|
}
|
|
105
97
|
|
|
@@ -110,6 +102,22 @@ function resolveOptionalTaglibs(taglibIds) {
|
|
|
110
102
|
const _loader = exports._loader = _loader2.default;
|
|
111
103
|
const _finder = exports._finder = _finder2.default;
|
|
112
104
|
|
|
105
|
+
function runAndCatchErrors(fn, onError) {
|
|
106
|
+
if (onError) {
|
|
107
|
+
const prevOnError = _config.default.onError;
|
|
108
|
+
_config.default.onError = onError;
|
|
109
|
+
try {
|
|
110
|
+
fn();
|
|
111
|
+
} catch (err) {
|
|
112
|
+
_config.default.onError(err);
|
|
113
|
+
} finally {
|
|
114
|
+
_config.default.onError = prevOnError;
|
|
115
|
+
}
|
|
116
|
+
} else {
|
|
117
|
+
fn();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
113
121
|
function loadTaglib(id, props) {
|
|
114
122
|
return _loader2.default.loadTaglibFromProps(_loader2.default.createTaglib(id), props);
|
|
115
123
|
}
|
|
@@ -133,5 +141,5 @@ function resolveTaglib(id) {
|
|
|
133
141
|
|
|
134
142
|
function hasRootDependency(id) {
|
|
135
143
|
const pkg = (0, _lassoPackageRoot.getRootPackage)(process.cwd());
|
|
136
|
-
return !!(pkg && pkg.dependencies?.[id] || pkg.devDependencies?.[id]);
|
|
144
|
+
return !!(pkg && (pkg.dependencies?.[id] || pkg.devDependencies?.[id]));
|
|
137
145
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -789,12 +789,16 @@ export interface DeclareExportDeclaration extends BaseNode {
|
|
|
789
789
|
declaration: Flow | null;
|
|
790
790
|
specifiers: Array<ExportSpecifier | ExportNamespaceSpecifier> | null;
|
|
791
791
|
source: StringLiteral | null;
|
|
792
|
+
attributes: Array<ImportAttribute> | null;
|
|
793
|
+
assertions: Array<ImportAttribute> | null;
|
|
792
794
|
default: boolean | null;
|
|
793
795
|
}
|
|
794
796
|
|
|
795
797
|
export interface DeclareExportAllDeclaration extends BaseNode {
|
|
796
798
|
type: "DeclareExportAllDeclaration";
|
|
797
799
|
source: StringLiteral;
|
|
800
|
+
attributes: Array<ImportAttribute> | null;
|
|
801
|
+
assertions: Array<ImportAttribute> | null;
|
|
798
802
|
exportKind: "type" | "value" | null;
|
|
799
803
|
}
|
|
800
804
|
|
|
@@ -1182,6 +1186,9 @@ export interface Placeholder extends BaseNode {
|
|
|
1182
1186
|
type: "Placeholder";
|
|
1183
1187
|
expectedNode: "Identifier" | "StringLiteral" | "Expression" | "Statement" | "Declaration" | "BlockStatement" | "ClassBody" | "Pattern";
|
|
1184
1188
|
name: Identifier;
|
|
1189
|
+
decorators: Array<Decorator> | null;
|
|
1190
|
+
optional: boolean | null;
|
|
1191
|
+
typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
|
1185
1192
|
}
|
|
1186
1193
|
|
|
1187
1194
|
export interface V8IntrinsicIdentifier extends BaseNode {
|
|
@@ -1596,6 +1603,7 @@ export interface TSModuleDeclaration extends BaseNode {
|
|
|
1596
1603
|
body: TSModuleBlock | TSModuleDeclaration;
|
|
1597
1604
|
declare: boolean | null;
|
|
1598
1605
|
global: boolean | null;
|
|
1606
|
+
kind: "global" | "module" | "namespace";
|
|
1599
1607
|
}
|
|
1600
1608
|
|
|
1601
1609
|
export interface TSModuleBlock extends BaseNode {
|
|
@@ -1979,8 +1987,8 @@ export function declareModuleExports(typeAnnotation: TypeAnnotation): DeclareMod
|
|
|
1979
1987
|
export function declareTypeAlias(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, right: FlowType): DeclareTypeAlias;
|
|
1980
1988
|
export function declareOpaqueType(id: Identifier, typeParameters?: TypeParameterDeclaration | null, supertype?: FlowType | null): DeclareOpaqueType;
|
|
1981
1989
|
export function declareVariable(id: Identifier): DeclareVariable;
|
|
1982
|
-
export function declareExportDeclaration(declaration?: Flow | null, specifiers?: Array<ExportSpecifier | ExportNamespaceSpecifier> | null, source?: StringLiteral | null): DeclareExportDeclaration;
|
|
1983
|
-
export function declareExportAllDeclaration(source: StringLiteral): DeclareExportAllDeclaration;
|
|
1990
|
+
export function declareExportDeclaration(declaration?: Flow | null, specifiers?: Array<ExportSpecifier | ExportNamespaceSpecifier> | null, source?: StringLiteral | null, attributes?: Array<ImportAttribute> | null): DeclareExportDeclaration;
|
|
1991
|
+
export function declareExportAllDeclaration(source: StringLiteral, attributes?: Array<ImportAttribute> | null): DeclareExportAllDeclaration;
|
|
1984
1992
|
export function declaredPredicate(value: Flow): DeclaredPredicate;
|
|
1985
1993
|
export function existsTypeAnnotation(): ExistsTypeAnnotation;
|
|
1986
1994
|
export function functionTypeAnnotation(typeParameters: TypeParameterDeclaration | null | undefined, params: Array<FunctionTypeParam>, rest: FunctionTypeParam | null | undefined, returnType: FlowType): FunctionTypeAnnotation;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/compiler",
|
|
3
|
-
"version": "5.37.
|
|
3
|
+
"version": "5.37.21",
|
|
4
4
|
"description": "Marko template to JS compiler.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"babel",
|
|
@@ -55,19 +55,19 @@
|
|
|
55
55
|
"prepare": "node -r ~ts scripts/types"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@babel/code-frame": "^7.
|
|
59
|
-
"@babel/core": "^7.
|
|
60
|
-
"@babel/generator": "^7.
|
|
61
|
-
"@babel/parser": "^7.
|
|
62
|
-
"@babel/plugin-syntax-typescript": "^7.
|
|
63
|
-
"@babel/plugin-transform-modules-commonjs": "^7.
|
|
64
|
-
"@babel/plugin-transform-typescript": "^7.25.
|
|
65
|
-
"@babel/runtime": "^7.
|
|
66
|
-
"@babel/traverse": "^7.25.
|
|
67
|
-
"@babel/types": "^7.
|
|
58
|
+
"@babel/code-frame": "^7.26.0",
|
|
59
|
+
"@babel/core": "^7.26.0",
|
|
60
|
+
"@babel/generator": "^7.26.0",
|
|
61
|
+
"@babel/parser": "^7.26.1",
|
|
62
|
+
"@babel/plugin-syntax-typescript": "^7.25.9",
|
|
63
|
+
"@babel/plugin-transform-modules-commonjs": "^7.25.9",
|
|
64
|
+
"@babel/plugin-transform-typescript": "^7.25.9",
|
|
65
|
+
"@babel/runtime": "^7.26.0",
|
|
66
|
+
"@babel/traverse": "^7.25.9",
|
|
67
|
+
"@babel/types": "^7.26.0",
|
|
68
68
|
"@luxass/strip-json-comments": "^1.3.2",
|
|
69
|
-
"@marko/babel-utils": "^6.5.
|
|
70
|
-
"complain": "^1.6.
|
|
69
|
+
"@marko/babel-utils": "^6.5.8",
|
|
70
|
+
"complain": "^1.6.1",
|
|
71
71
|
"he": "^1.2.0",
|
|
72
72
|
"htmljs-parser": "^5.5.2",
|
|
73
73
|
"jsesc": "^3.0.2",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"source-map-support": "^0.5.21"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@marko/translator-default": "^6.0.
|
|
83
|
+
"@marko/translator-default": "^6.0.21"
|
|
84
84
|
},
|
|
85
85
|
"publishConfig": {
|
|
86
86
|
"access": "public"
|