@marko/language-tools 2.0.3 → 2.0.4
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/index.js +5 -5
- package/dist/index.mjs +5 -5
- package/marko.internal.d.ts +17 -7
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1894,9 +1894,9 @@ function ${templateName}() {
|
|
|
1894
1894
|
const internalInput = varLocal("input");
|
|
1895
1895
|
const internalInputWithExtends = `${internalInput} extends unknown`;
|
|
1896
1896
|
const internalApply = varLocal("apply");
|
|
1897
|
-
const renderAndReturn = `(input: Input${typeArgsStr} & ${varShared(
|
|
1897
|
+
const renderAndReturn = `(input: Marko.Directives & Input${typeArgsStr} & ${varShared(
|
|
1898
1898
|
"Relate"
|
|
1899
|
-
)}<${internalInput}, Input${typeArgsStr}>) => (${varShared(
|
|
1899
|
+
)}<${internalInput}, Marko.Directives & Input${typeArgsStr}>) => (${varShared(
|
|
1900
1900
|
"ReturnWithScope"
|
|
1901
1901
|
)}<${internalInput}, ${didReturn ? `typeof ${templateName + typeArgsStr} extends () => infer Return ? Return : never` : "void"}>)`;
|
|
1902
1902
|
const templateOverrideClass = `${templateBaseClass}<{${this.#runtimeTypes ? getRuntimeOverrides(this.#runtimeTypes, typeParamsStr, typeArgsStr) : ""}
|
|
@@ -2923,6 +2923,7 @@ function getTagLookup(dir) {
|
|
|
2923
2923
|
return getTagLookupForProject(getMeta(dir), dir);
|
|
2924
2924
|
}
|
|
2925
2925
|
function getTypeLibs(rootDir, ts, host) {
|
|
2926
|
+
var _a;
|
|
2926
2927
|
const config = getConfig(rootDir);
|
|
2927
2928
|
let typeLibs = config.cache.get(getTypeLibs);
|
|
2928
2929
|
if (typeLibs)
|
|
@@ -2935,12 +2936,12 @@ function getTypeLibs(rootDir, ts, host) {
|
|
|
2935
2936
|
".marko-run/routes.d.ts"
|
|
2936
2937
|
);
|
|
2937
2938
|
const resolveFromFile = import_path2.default.join(rootDir, "_.d.ts");
|
|
2938
|
-
const
|
|
2939
|
+
const internalTypesFile = defaultTypeLibs.internalTypesFile || ((_a = ts.resolveTypeReferenceDirective(
|
|
2939
2940
|
"@marko/language-tools/marko.internal.d.ts",
|
|
2940
2941
|
resolveFromFile,
|
|
2941
2942
|
resolveTypeCompilerOptions,
|
|
2942
2943
|
host
|
|
2943
|
-
);
|
|
2944
|
+
).resolvedTypeReferenceDirective) == null ? void 0 : _a.resolvedFileName);
|
|
2944
2945
|
const { resolvedTypeReferenceDirective: resolvedMarkoTypes } = ts.resolveTypeReferenceDirective(
|
|
2945
2946
|
config.translator.runtimeTypes || "marko",
|
|
2946
2947
|
resolveFromFile,
|
|
@@ -2953,7 +2954,6 @@ function getTypeLibs(rootDir, ts, host) {
|
|
|
2953
2954
|
resolveTypeCompilerOptions,
|
|
2954
2955
|
host
|
|
2955
2956
|
);
|
|
2956
|
-
const internalTypesFile = (resolvedInternalTypes == null ? void 0 : resolvedInternalTypes.resolvedFileName) || defaultTypeLibs.internalTypesFile;
|
|
2957
2957
|
const markoTypesFile = (resolvedMarkoTypes == null ? void 0 : resolvedMarkoTypes.resolvedFileName) || defaultTypeLibs.markoTypesFile;
|
|
2958
2958
|
const markoRunTypesFile = resolvedMarkoRunTypes == null ? void 0 : resolvedMarkoRunTypes.resolvedFileName;
|
|
2959
2959
|
if (!internalTypesFile || !markoTypesFile) {
|
package/dist/index.mjs
CHANGED
|
@@ -1863,9 +1863,9 @@ function ${templateName}() {
|
|
|
1863
1863
|
const internalInput = varLocal("input");
|
|
1864
1864
|
const internalInputWithExtends = `${internalInput} extends unknown`;
|
|
1865
1865
|
const internalApply = varLocal("apply");
|
|
1866
|
-
const renderAndReturn = `(input: Input${typeArgsStr} & ${varShared(
|
|
1866
|
+
const renderAndReturn = `(input: Marko.Directives & Input${typeArgsStr} & ${varShared(
|
|
1867
1867
|
"Relate"
|
|
1868
|
-
)}<${internalInput}, Input${typeArgsStr}>) => (${varShared(
|
|
1868
|
+
)}<${internalInput}, Marko.Directives & Input${typeArgsStr}>) => (${varShared(
|
|
1869
1869
|
"ReturnWithScope"
|
|
1870
1870
|
)}<${internalInput}, ${didReturn ? `typeof ${templateName + typeArgsStr} extends () => infer Return ? Return : never` : "void"}>)`;
|
|
1871
1871
|
const templateOverrideClass = `${templateBaseClass}<{${this.#runtimeTypes ? getRuntimeOverrides(this.#runtimeTypes, typeParamsStr, typeArgsStr) : ""}
|
|
@@ -2892,6 +2892,7 @@ function getTagLookup(dir) {
|
|
|
2892
2892
|
return getTagLookupForProject(getMeta(dir), dir);
|
|
2893
2893
|
}
|
|
2894
2894
|
function getTypeLibs(rootDir, ts, host) {
|
|
2895
|
+
var _a;
|
|
2895
2896
|
const config = getConfig(rootDir);
|
|
2896
2897
|
let typeLibs = config.cache.get(getTypeLibs);
|
|
2897
2898
|
if (typeLibs)
|
|
@@ -2904,12 +2905,12 @@ function getTypeLibs(rootDir, ts, host) {
|
|
|
2904
2905
|
".marko-run/routes.d.ts"
|
|
2905
2906
|
);
|
|
2906
2907
|
const resolveFromFile = path2.join(rootDir, "_.d.ts");
|
|
2907
|
-
const
|
|
2908
|
+
const internalTypesFile = defaultTypeLibs.internalTypesFile || ((_a = ts.resolveTypeReferenceDirective(
|
|
2908
2909
|
"@marko/language-tools/marko.internal.d.ts",
|
|
2909
2910
|
resolveFromFile,
|
|
2910
2911
|
resolveTypeCompilerOptions,
|
|
2911
2912
|
host
|
|
2912
|
-
);
|
|
2913
|
+
).resolvedTypeReferenceDirective) == null ? void 0 : _a.resolvedFileName);
|
|
2913
2914
|
const { resolvedTypeReferenceDirective: resolvedMarkoTypes } = ts.resolveTypeReferenceDirective(
|
|
2914
2915
|
config.translator.runtimeTypes || "marko",
|
|
2915
2916
|
resolveFromFile,
|
|
@@ -2922,7 +2923,6 @@ function getTypeLibs(rootDir, ts, host) {
|
|
|
2922
2923
|
resolveTypeCompilerOptions,
|
|
2923
2924
|
host
|
|
2924
2925
|
);
|
|
2925
|
-
const internalTypesFile = (resolvedInternalTypes == null ? void 0 : resolvedInternalTypes.resolvedFileName) || defaultTypeLibs.internalTypesFile;
|
|
2926
2926
|
const markoTypesFile = (resolvedMarkoTypes == null ? void 0 : resolvedMarkoTypes.resolvedFileName) || defaultTypeLibs.markoTypesFile;
|
|
2927
2927
|
const markoRunTypesFile = resolvedMarkoRunTypes == null ? void 0 : resolvedMarkoRunTypes.resolvedFileName;
|
|
2928
2928
|
if (!internalTypesFile || !markoTypesFile) {
|
package/marko.internal.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
// This is a typescript file which defines utilities used in the output of the typescript extractor.
|
|
2
2
|
declare global {
|
|
3
3
|
namespace Marko {
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
5
|
+
export interface Directives {}
|
|
6
|
+
|
|
4
7
|
// Extend the Body type to keep track of what is yielded (used for scope hoisted types).
|
|
5
8
|
export interface Body<
|
|
6
9
|
in Params extends readonly any[] = [],
|
|
@@ -323,8 +326,12 @@ declare global {
|
|
|
323
326
|
export interface NativeTagRenderer<Name extends string> {
|
|
324
327
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint
|
|
325
328
|
(): () => <__marko_internal_input extends unknown>(
|
|
326
|
-
input: Marko.
|
|
327
|
-
|
|
329
|
+
input: Marko.Directives &
|
|
330
|
+
Marko.NativeTags[Name]["input"] &
|
|
331
|
+
Relate<
|
|
332
|
+
__marko_internal_input,
|
|
333
|
+
Marko.Directives & Marko.NativeTags[Name]["input"]
|
|
334
|
+
>
|
|
328
335
|
) => ReturnAndScope<
|
|
329
336
|
Scopes<__marko_internal_input>,
|
|
330
337
|
Marko.NativeTags[Name]["return"]
|
|
@@ -334,10 +341,11 @@ declare global {
|
|
|
334
341
|
export interface BodyRenderer<Body extends AnyMarkoBody> {
|
|
335
342
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint
|
|
336
343
|
(): () => <__marko_internal_input extends unknown>(
|
|
337
|
-
input:
|
|
344
|
+
input: Marko.Directives &
|
|
345
|
+
RenderBodyInput<BodyParameters<Body>> &
|
|
338
346
|
Relate<
|
|
339
347
|
__marko_internal_input,
|
|
340
|
-
RenderBodyInput<BodyParameters<Body>>
|
|
348
|
+
Marko.Directives & RenderBodyInput<BodyParameters<Body>>
|
|
341
349
|
>
|
|
342
350
|
) => ReturnAndScope<
|
|
343
351
|
Scopes<__marko_internal_input>,
|
|
@@ -350,9 +358,11 @@ declare global {
|
|
|
350
358
|
Return = void
|
|
351
359
|
> {
|
|
352
360
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint
|
|
353
|
-
(): () => <
|
|
354
|
-
input:
|
|
355
|
-
|
|
361
|
+
(): () => <__marko_input_with_scope extends unknown>(
|
|
362
|
+
input: Marko.Directives &
|
|
363
|
+
Input &
|
|
364
|
+
Relate<__marko_input_with_scope, Marko.Directives & Input>
|
|
365
|
+
) => ReturnAndScope<Scopes<__marko_input_with_scope>, Return>;
|
|
356
366
|
}
|
|
357
367
|
|
|
358
368
|
export interface DefaultRenderer {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/language-tools",
|
|
3
3
|
"description": "Marko Language Tools",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.4",
|
|
5
5
|
"bugs": "https://github.com/marko-js/language-server/issues/new?template=Bug_report.md",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@babel/helper-validator-identifier": "^7.19.1",
|
|
8
8
|
"@babel/parser": "^7.21.4",
|
|
9
|
-
"@marko/compiler": "5.27.
|
|
10
|
-
"@marko/translator-default": "5.25.
|
|
9
|
+
"@marko/compiler": "5.27.7",
|
|
10
|
+
"@marko/translator-default": "5.25.7",
|
|
11
11
|
"htmljs-parser": "^5.4.3",
|
|
12
12
|
"relative-import-path": "^1.0.0"
|
|
13
13
|
},
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@types/babel__code-frame": "^7.0.3",
|
|
18
18
|
"@types/babel__helper-validator-identifier": "^7.15.0",
|
|
19
19
|
"@typescript/vfs": "^1.4.0",
|
|
20
|
-
"marko": "^5.25.
|
|
20
|
+
"marko": "^5.25.6",
|
|
21
21
|
"mitata": "^0.1.6",
|
|
22
22
|
"tsx": "^3.12.6"
|
|
23
23
|
},
|