ember-repl 3.0.0-beta.4 → 3.0.0-beta.6
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/declarations/browser/__PRIVATE__.d.ts +2 -0
- package/declarations/browser/__PRIVATE__.d.ts.map +1 -0
- package/declarations/browser/cjs/eval.d.ts +9 -0
- package/declarations/browser/cjs/eval.d.ts.map +1 -0
- package/declarations/browser/cjs/index.d.ts +7 -0
- package/declarations/browser/cjs/index.d.ts.map +1 -0
- package/declarations/browser/compile/formats.d.ts +18 -0
- package/declarations/browser/compile/formats.d.ts.map +1 -0
- package/declarations/browser/compile/index.d.ts +76 -0
- package/declarations/browser/compile/index.d.ts.map +1 -0
- package/declarations/browser/compile/markdown-to-ember.d.ts +21 -0
- package/declarations/browser/compile/markdown-to-ember.d.ts.map +1 -0
- package/declarations/browser/compile/types.d.ts +9 -0
- package/declarations/browser/compile/types.d.ts.map +1 -0
- package/declarations/browser/esm/index.d.ts +8 -0
- package/declarations/browser/esm/index.d.ts.map +1 -0
- package/{dist → declarations}/browser/eti/babel-plugin.d.ts +2 -2
- package/declarations/browser/eti/babel-plugin.d.ts.map +1 -0
- package/declarations/browser/eti/debug.d.ts +2 -0
- package/declarations/browser/eti/debug.d.ts.map +1 -0
- package/{dist → declarations}/browser/eti/parse-templates.d.ts +7 -7
- package/declarations/browser/eti/parse-templates.d.ts.map +1 -0
- package/{dist → declarations}/browser/eti/preprocess.d.ts +3 -2
- package/declarations/browser/eti/preprocess.d.ts.map +1 -0
- package/{dist → declarations}/browser/eti/template-tag-transform.d.ts +2 -2
- package/declarations/browser/eti/template-tag-transform.d.ts.map +1 -0
- package/declarations/browser/eti/util.d.ts +14 -0
- package/declarations/browser/eti/util.d.ts.map +1 -0
- package/declarations/browser/gjs.d.ts +4 -0
- package/declarations/browser/gjs.d.ts.map +1 -0
- package/{dist → declarations}/browser/hbs.d.ts +4 -3
- package/declarations/browser/hbs.d.ts.map +1 -0
- package/declarations/browser/index.d.ts +7 -0
- package/declarations/browser/index.d.ts.map +1 -0
- package/{dist → declarations}/browser/js.d.ts +3 -3
- package/declarations/browser/js.d.ts.map +1 -0
- package/{dist → declarations}/browser/known-modules.d.ts +6 -5
- package/declarations/browser/known-modules.d.ts.map +1 -0
- package/declarations/browser/types.d.ts +21 -0
- package/declarations/browser/types.d.ts.map +1 -0
- package/{dist → declarations}/browser/utils.d.ts +4 -4
- package/declarations/browser/utils.d.ts.map +1 -0
- package/declarations/test-support/index.d.ts +2 -0
- package/declarations/test-support/index.d.ts.map +1 -0
- package/dist/browser/__PRIVATE__.js +2 -0
- package/dist/browser/__PRIVATE__.js.map +1 -0
- package/dist/browser/cjs/eval.js.map +1 -1
- package/dist/browser/cjs/index.js.map +1 -1
- package/dist/browser/compile/formats.js +2 -1
- package/dist/browser/compile/formats.js.map +1 -1
- package/dist/browser/compile/index.js +28 -14
- package/dist/browser/compile/index.js.map +1 -1
- package/dist/browser/compile/markdown-to-ember.js +28 -10
- package/dist/browser/compile/markdown-to-ember.js.map +1 -1
- package/dist/browser/compile/types.js +1 -1
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/eti/babel-plugin.js.map +1 -1
- package/dist/browser/eti/parse-templates.js.map +1 -1
- package/dist/browser/eti/preprocess.js +2 -167
- package/dist/browser/eti/preprocess.js.map +1 -1
- package/dist/browser/eti/template-tag-transform.js.map +1 -1
- package/dist/browser/eti/util.js.map +1 -1
- package/dist/browser/gjs.js.map +1 -1
- package/dist/browser/hbs.js.map +1 -1
- package/dist/browser/js.js.map +1 -1
- package/dist/test-support/index.js.map +1 -1
- package/package.json +82 -58
- package/src/browser/__PRIVATE__.ts +1 -0
- package/src/browser/cjs/eval.ts +2 -2
- package/src/browser/cjs/index.ts +4 -4
- package/src/browser/compile/formats.ts +17 -11
- package/src/browser/compile/index.ts +64 -30
- package/src/browser/compile/markdown-to-ember.ts +96 -81
- package/src/browser/compile/types.ts +4 -0
- package/src/browser/esm/index.ts +4 -4
- package/src/browser/eti/babel-plugin.ts +2 -2
- package/src/browser/eti/parse-templates.ts +2 -2
- package/src/browser/eti/preprocess.ts +3 -3
- package/src/browser/eti/template-tag-transform.ts +1 -1
- package/src/browser/eti/util.ts +1 -1
- package/src/browser/gjs.ts +4 -4
- package/src/browser/hbs.ts +2 -2
- package/src/browser/index.ts +5 -5
- package/src/browser/js.ts +3 -3
- package/src/test-support/index.ts +1 -1
- package/dist/browser/cjs/eval.d.ts +0 -10
- package/dist/browser/cjs/eval.d.ts.map +0 -1
- package/dist/browser/cjs/index.d.ts +0 -7
- package/dist/browser/compile/formats.d.ts +0 -16
- package/dist/browser/compile/index.d.ts +0 -51
- package/dist/browser/compile/markdown-to-ember.d.ts +0 -18
- package/dist/browser/compile/types.d.ts +0 -7
- package/dist/browser/esm/index.d.ts +0 -8
- package/dist/browser/eti/debug.d.ts +0 -2
- package/dist/browser/eti/util.d.ts +0 -14
- package/dist/browser/gjs.d.ts +0 -4
- package/dist/browser/index.d.ts +0 -6
- package/dist/browser/types.d.ts +0 -21
- package/dist/test-support/index.d.ts +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"__PRIVATE__.d.ts","sourceRoot":"","sources":["../../src/browser/__PRIVATE__.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ExtraModules } from '../types.ts';
|
|
2
|
+
import type Component from '@glimmer/component';
|
|
3
|
+
export declare function evalSnippet(compiled: string, extraModules?: ExtraModules): {
|
|
4
|
+
default: Component;
|
|
5
|
+
services?: {
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=eval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval.d.ts","sourceRoot":"","sources":["../../../src/browser/cjs/eval.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAC;AAEhD,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,YAAY,GAAE,YAAiB,GAC9B;IACD,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACvC,CAmBA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/cjs/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG/D,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CAkBjG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CompileResult } from '../types.ts';
|
|
2
|
+
import type { UnifiedPlugin } from './types.ts';
|
|
3
|
+
import type { EvalImportMap, ScopeMap } from './types.ts';
|
|
4
|
+
export declare function compileGJS(gjsInput: string, importMap?: EvalImportMap): Promise<CompileResult>;
|
|
5
|
+
export declare function compileHBS(hbsInput: string, options?: {
|
|
6
|
+
moduleName?: string;
|
|
7
|
+
scope?: Record<string, unknown>;
|
|
8
|
+
}): Promise<CompileResult>;
|
|
9
|
+
export declare function compileMD(glimdownInput: string, options?: {
|
|
10
|
+
importMap?: EvalImportMap;
|
|
11
|
+
topLevelScope?: ScopeMap;
|
|
12
|
+
remarkPlugins?: UnifiedPlugin[];
|
|
13
|
+
CopyComponent?: string;
|
|
14
|
+
ShadowComponent?: string;
|
|
15
|
+
}): Promise<CompileResult & {
|
|
16
|
+
rootTemplate?: string;
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=formats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formats.d.ts","sourceRoot":"","sources":["../../../src/browser/compile/formats.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAY1D,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,aAAa,GACxB,OAAO,CAAC,aAAa,CAAC,CAQxB;AAED,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IACR,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC,GACA,OAAO,CAAC,aAAa,CAAC,CAQxB;AAwCD,wBAAsB,SAAS,CAC7B,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE;IACR,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,aAAa,CAAC,EAAE,QAAQ,CAAC;IACzB,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GACA,OAAO,CAAC,aAAa,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAkFpD"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { UnifiedPlugin } from './types.ts';
|
|
2
|
+
import type { EvalImportMap, ScopeMap } from './types.ts';
|
|
3
|
+
import type { ComponentLike } from '@glint/template';
|
|
4
|
+
type Format = 'glimdown' | 'gjs' | 'hbs';
|
|
5
|
+
export declare const CACHE: Map<string, ComponentLike>;
|
|
6
|
+
interface Events {
|
|
7
|
+
onSuccess: (component: ComponentLike) => Promise<unknown> | unknown;
|
|
8
|
+
onError: (error: string) => Promise<unknown> | unknown;
|
|
9
|
+
onCompileStart: () => Promise<unknown> | unknown;
|
|
10
|
+
}
|
|
11
|
+
interface Scope {
|
|
12
|
+
importMap?: EvalImportMap;
|
|
13
|
+
}
|
|
14
|
+
interface GlimdownOptions extends Scope, Events {
|
|
15
|
+
format: 'glimdown';
|
|
16
|
+
remarkPlugins?: UnifiedPlugin[];
|
|
17
|
+
CopyComponent?: string;
|
|
18
|
+
ShadowComponent?: string;
|
|
19
|
+
topLevelScope?: ScopeMap;
|
|
20
|
+
}
|
|
21
|
+
interface GJSOptions extends Scope, Events {
|
|
22
|
+
format: 'gjs';
|
|
23
|
+
}
|
|
24
|
+
interface HBSOptions extends Scope, Events {
|
|
25
|
+
format: 'hbs';
|
|
26
|
+
topLevelScope?: ScopeMap;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Compile GitHub-flavored Markdown with GJS support
|
|
30
|
+
* and optionally render gjs-snippets via a `live` meta tag
|
|
31
|
+
* on the code fences.
|
|
32
|
+
*/
|
|
33
|
+
export declare function compile(text: string, options: GlimdownOptions): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Compile GJS
|
|
36
|
+
*/
|
|
37
|
+
export declare function compile(text: string, options: GJSOptions): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Compile a stateless component using just the template
|
|
40
|
+
*/
|
|
41
|
+
export declare function compile(text: string, options: HBSOptions): Promise<void>;
|
|
42
|
+
type Input = string | undefined | null;
|
|
43
|
+
type ExtraOptions = {
|
|
44
|
+
format: 'glimdown';
|
|
45
|
+
remarkPlugins?: UnifiedPlugin[];
|
|
46
|
+
importMap?: EvalImportMap;
|
|
47
|
+
CopyComponent?: string;
|
|
48
|
+
ShadowComponent?: string;
|
|
49
|
+
topLevelScope?: ScopeMap;
|
|
50
|
+
} | {
|
|
51
|
+
format: 'hbs';
|
|
52
|
+
topLevelScope?: ScopeMap;
|
|
53
|
+
} | {
|
|
54
|
+
format: 'gjs';
|
|
55
|
+
importMap?: EvalImportMap;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
export interface Value {
|
|
61
|
+
isReady: boolean;
|
|
62
|
+
error: string | null;
|
|
63
|
+
component: ComponentLike;
|
|
64
|
+
}
|
|
65
|
+
export declare function buildCompiler(markdownText: Input | (() => Input)): Value;
|
|
66
|
+
export declare function buildCompiler(markdownText: Input | (() => Input), options?: Format): Value;
|
|
67
|
+
export declare function buildCompiler(markdownText: Input | (() => Input), options?: () => Format): Value;
|
|
68
|
+
export declare function buildCompiler(markdownText: Input | (() => Input), options?: ExtraOptions): Value;
|
|
69
|
+
export declare function buildCompiler(markdownText: Input | (() => Input), options?: () => ExtraOptions): Value;
|
|
70
|
+
/**
|
|
71
|
+
* By default, this compiles to `glimdown`. A Markdown format which
|
|
72
|
+
* extracts `live` tagged code snippets and compiles them to components.
|
|
73
|
+
*/
|
|
74
|
+
export declare const Compiled: typeof buildCompiler;
|
|
75
|
+
export {};
|
|
76
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/compile/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC;AAEzC,eAAO,MAAM,KAAK,4BAAmC,CAAC;AAEtD,UAAU,MAAM;IACd,SAAS,EAAE,CAAC,SAAS,EAAE,a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ang: string;
|
|
6
|
+
}
|
|
7
|
+
export interface LiveCodeExtraction {
|
|
8
|
+
templateOnlyGlimdown: string;
|
|
9
|
+
blocks: ExtractedCode[];
|
|
10
|
+
}
|
|
11
|
+
interface ParseMarkdownOptions {
|
|
12
|
+
CopyComponent?: string;
|
|
13
|
+
ShadowComponent?: string;
|
|
14
|
+
remarkPlugins?: UnifiedPlugin[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @internal not under semver
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseMarkdown(input: string, options?: ParseMarkdownOptions): Promise<LiveCodeExtraction>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=markdown-to-ember.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-to-ember.d.ts","sourceRoot":"","sources":["../../../src/browser/compile/markdown-to-ember.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAMhD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,aAAa,EAAE,CAAC;CACzB;AAiSD,UAAU,oBAAoB;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;CACjC;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,kBAAkB,CAAC,CAO7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/browser/compile/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,WAAW,aAAa;IAC5B,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,CAAC;CAChC;AAED,MAAM,WAAW,QAAQ;IACvB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;CAC9B;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CompileResult, ExtraModules } from '../types.ts';
|
|
2
|
+
export interface Info {
|
|
3
|
+
code: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function compileJS(code: string, extraModules?: ExtraModules): Promise<CompileResult>;
|
|
7
|
+
export declare function proxyToSkypack(code: string, extraModules?: ExtraModules): string;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/esm/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI/D,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CAoBjG;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,YAAY,UAavE"}
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
* setComponentTemplate(precompileTemplate(`D`, {...}), D);
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
export default function (babel: any): {
|
|
52
52
|
visitor: any;
|
|
53
53
|
};
|
|
54
|
-
|
|
54
|
+
//# sourceMappingURL=babel-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"babel-plugin.d.ts","sourceRoot":"","sources":["../../../src/browser/eti/babel-plugin.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,MAAM,CAAC,OAAO,WAAW,KAAK,EAAE,GAAG;;EA8ClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../src/browser/eti/debug.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,CAMzE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
type TemplateMatch = TemplateTagMatch;
|
|
2
|
-
interface TemplateTagMatch {
|
|
1
|
+
export type TemplateMatch = TemplateTagMatch;
|
|
2
|
+
export interface TemplateTagMatch {
|
|
3
3
|
type: 'template-tag';
|
|
4
4
|
tagName: string;
|
|
5
5
|
start: RegExpMatchArray;
|
|
@@ -9,7 +9,7 @@ interface TemplateTagMatch {
|
|
|
9
9
|
/**
|
|
10
10
|
* Represents a static import of a template literal.
|
|
11
11
|
*/
|
|
12
|
-
interface StaticImportConfig {
|
|
12
|
+
export interface StaticImportConfig {
|
|
13
13
|
/**
|
|
14
14
|
* The path to the package from which we want to import the template literal
|
|
15
15
|
* (e.g.: 'ember-cli-htmlbars')
|
|
@@ -26,11 +26,11 @@ interface StaticImportConfig {
|
|
|
26
26
|
*
|
|
27
27
|
* @param templateTag
|
|
28
28
|
*/
|
|
29
|
-
interface ParseTemplatesOptions {
|
|
29
|
+
export interface ParseTemplatesOptions {
|
|
30
30
|
/** Tag to use, if parsing template tags is enabled. */
|
|
31
31
|
templateTag?: string;
|
|
32
32
|
}
|
|
33
|
-
declare const DEFAULT_PARSE_TEMPLATES_OPTIONS: {
|
|
33
|
+
export declare const DEFAULT_PARSE_TEMPLATES_OPTIONS: {
|
|
34
34
|
templateTag: string;
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
@@ -52,5 +52,5 @@ declare const DEFAULT_PARSE_TEMPLATES_OPTIONS: {
|
|
|
52
52
|
* @param options optional configuration options for how to parse templates
|
|
53
53
|
* @returns
|
|
54
54
|
*/
|
|
55
|
-
declare function parseTemplates(template: string, relativePath: string, options?: ParseTemplatesOptions): TemplateMatch[];
|
|
56
|
-
|
|
55
|
+
export declare function parseTemplates(template: string, relativePath: string, options?: ParseTemplatesOptions): TemplateMatch[];
|
|
56
|
+
//# sourceMappingURL=parse-templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-templates.d.ts","sourceRoot":"","sources":["../../../src/browser/eti/parse-templates.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAE7C,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,gBAAgB,CAAC;IACxB,GAAG,EAAE,gBAAgB,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA8BD,eAAO,MAAM,+BAA+B;;CAE3C,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,qBAAuD,GAC/D,aAAa,EAAE,CA6LjB"}
|
|
@@ -53,5 +53,6 @@ interface Replacement {
|
|
|
53
53
|
*
|
|
54
54
|
* hbs(`<MyComponent/>`, { scope() { return {MyComponent}; } });
|
|
55
55
|
*/
|
|
56
|
-
declare function preprocessEmbeddedTemplates(template: string, options: PreprocessOptions): PreprocessedOutput;
|
|
57
|
-
export {
|
|
56
|
+
export declare function preprocessEmbeddedTemplates(template: string, options: PreprocessOptions): PreprocessedOutput;
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=preprocess.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preprocess.d.ts","sourceRoot":"","sources":["../../../src/browser/eti/preprocess.ts"],"names":[],"mappings":"AAcA,UAAU,sBAAsB;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAED,UAAU,qBAAqB;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAED,KAAK,iBAAiB,GAAG,qBAAqB,GAAG,sBAAsB,CAAC;AAExE,UAAU,kBAAkB;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B;AAED,UAAU,WAAW;IACnB,IAAI,EAAE,OAAO,GAAG,KAAK,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAoED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,iBAAiB,GACzB,kBAAkB,CAgCpB"}
|
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
* [GLIMMER_TEMPLATE('hello')];
|
|
12
12
|
* }
|
|
13
13
|
*/
|
|
14
|
-
declare const transformTemplateTag: (t: any, templatePath: any, state: any) => void;
|
|
15
|
-
|
|
14
|
+
export declare const transformTemplateTag: (t: any, templatePath: any, state: any) => void;
|
|
15
|
+
//# sourceMappingURL=template-tag-transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-tag-transform.d.ts","sourceRoot":"","sources":["../../../src/browser/eti/template-tag-transform.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,oBAAoB,MAAgB,GAAG,gBAAgB,GAAG,SAAS,GAAG,SAgFlF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TemplateMatch } from './parse-templates.ts';
|
|
2
|
+
import type { NodePath } from '@babel/traverse';
|
|
3
|
+
import type { CallExpression } from '@babel/types';
|
|
4
|
+
import type { ImportUtil } from 'babel-import-util';
|
|
5
|
+
export declare const TEMPLATE_TAG_NAME = "template";
|
|
6
|
+
export declare const TEMPLATE_TAG_PLACEHOLDER = "__GLIMMER_TEMPLATE";
|
|
7
|
+
export declare function isTemplateTag(callExpressionPath: NodePath<CallExpression>): boolean;
|
|
8
|
+
export declare function buildPrecompileTemplateCall(t: any, callExpressionPath: NodePath<CallExpression>, state: {
|
|
9
|
+
importUtil: ImportUtil;
|
|
10
|
+
}): CallExpression;
|
|
11
|
+
export declare function registerRefs(newPath: string | string[], getRefPaths: (path: string) => NodePath[]): void;
|
|
12
|
+
export declare function isSupportedScriptFileExtension(filePath: string): boolean;
|
|
13
|
+
export declare function isStrictMode(templateInfo: TemplateMatch): boolean;
|
|
14
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/browser/eti/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAC5C,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAE7D,wBAAgB,aAAa,CAAC,kBAAkB,EAAE,QAAQ,CAAC,cAAc,CAAC,WAMzE;AAED,wBAAgB,2BAA2B,CACzC,CAAC,EAAE,GAAG,EACN,kBAAkB,EAAE,QAAQ,CAAC,cAAc,CAAC,EAC5C,KAAK,EAAE;IACL,UAAU,EAAE,UAAU,CAAC;CACxB,GACA,cAAc,CAOhB;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,QAAQ,EAAE,QA2B1C;AAID,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,WAE9D;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,aAAa,GAAG,OAAO,CAEjE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Babel } from './types.ts';
|
|
2
|
+
export declare function preprocess(input: string, name: string): string;
|
|
3
|
+
export declare function transform(intermediate: string, name: string, options?: any): Promise<ReturnType<Babel['transform']>>;
|
|
4
|
+
//# sourceMappingURL=gjs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gjs.d.ts","sourceRoot":"","sources":["../../src/browser/gjs.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAIxC,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAUrD;AAED,wBAAsB,SAAS,CAC7B,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,GAAQ,GAChB,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CA6BzC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { CompileResult } from
|
|
1
|
+
import type { CompileResult } from './types.ts';
|
|
2
2
|
/**
|
|
3
3
|
* compile a template with an empty scope
|
|
4
4
|
* to use components, helpers, etc, you will need to compile with JS
|
|
5
5
|
*
|
|
6
6
|
* (templates alone do not have a way to import / define complex structures)
|
|
7
7
|
*/
|
|
8
|
-
declare function compileHBS(template: string, options?: CompileTemplateOptions): CompileResult;
|
|
8
|
+
export declare function compileHBS(template: string, options?: CompileTemplateOptions): CompileResult;
|
|
9
9
|
interface CompileTemplateOptions {
|
|
10
10
|
/**
|
|
11
11
|
* Used for debug viewing
|
|
@@ -13,4 +13,5 @@ interface CompileTemplateOptions {
|
|
|
13
13
|
moduleName?: string;
|
|
14
14
|
scope?: Record<string, unknown>;
|
|
15
15
|
}
|
|
16
|
-
export {
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=hbs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hbs.d.ts","sourceRoot":"","sources":["../../src/browser/hbs.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAQhD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B,GAAG,aAAa,CAehG;AAED,UAAU,sBAAsB;IAC9B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { compile, Compiled } from './compile/index.ts';
|
|
2
|
+
export { compileHBS } from './hbs.ts';
|
|
3
|
+
export { compileJS } from './js.ts';
|
|
4
|
+
export { modules as frameworkModules } from './known-modules.ts';
|
|
5
|
+
export { invocationName, invocationOf, nameFor } from './utils.ts';
|
|
6
|
+
export type { CompileResult } from './types';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGnE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CompileResult, ExtraModules, Options } from
|
|
1
|
+
import type { CompileResult, ExtraModules, Options } from './types.ts';
|
|
2
2
|
/**
|
|
3
3
|
* @public
|
|
4
4
|
* Transpiles GlimmerJS (*.gjs) formatted text into and evaluates as a JS Module.
|
|
@@ -16,5 +16,5 @@ import { CompileResult, ExtraModules, Options } from "./types.js";
|
|
|
16
16
|
* are not provided by extraModules will be searched on npm to see if a package
|
|
17
17
|
* needs to be downloaded before running the `code` / invoking the component
|
|
18
18
|
*/
|
|
19
|
-
declare function compileJS(code: string, extraModules?: ExtraModules, options?: Options): Promise<CompileResult>;
|
|
20
|
-
|
|
19
|
+
export declare function compileJS(code: string, extraModules?: ExtraModules, options?: Options): Promise<CompileResult>;
|
|
20
|
+
//# sourceMappingURL=js.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js.d.ts","sourceRoot":"","sources":["../../src/browser/js.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEvE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,YAAY,EAC3B,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,aAAa,CAAC,CAexB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="ember-source/types/stable/@ember/component/template-only" />
|
|
1
2
|
/**
|
|
2
3
|
* We need to import and hang on to these references so that they
|
|
3
4
|
* don't get optimized away during deploy
|
|
@@ -7,7 +8,6 @@ import * as _tracking from '@glimmer/tracking';
|
|
|
7
8
|
import * as _application from '@ember/application';
|
|
8
9
|
import * as _array from '@ember/array';
|
|
9
10
|
import * as _EmberComponent from '@ember/component';
|
|
10
|
-
import _TO from '@ember/component/template-only';
|
|
11
11
|
import * as _debug from '@ember/debug';
|
|
12
12
|
import * as _destroyable from '@ember/destroyable';
|
|
13
13
|
import * as _helpers from '@ember/helper';
|
|
@@ -15,12 +15,13 @@ import * as _modifier from '@ember/modifier';
|
|
|
15
15
|
import * as _object from '@ember/object';
|
|
16
16
|
import * as _runloop from '@ember/runloop';
|
|
17
17
|
import * as _service from '@ember/service';
|
|
18
|
+
import { createTemplateFactory } from '@ember/template-factory';
|
|
18
19
|
import * as _utils from '@ember/utils';
|
|
19
|
-
declare const modules: {
|
|
20
|
+
export declare const modules: {
|
|
20
21
|
'@ember/application': typeof _application;
|
|
21
22
|
'@ember/array': typeof _array;
|
|
22
23
|
'@ember/component': typeof _EmberComponent;
|
|
23
|
-
'@ember/component/template-only':
|
|
24
|
+
'@ember/component/template-only': <S>(moduleName?: string | undefined, name?: string | undefined) => import("@ember/component/template-only").TemplateOnlyComponent<S>;
|
|
24
25
|
'@ember/debug': typeof _debug;
|
|
25
26
|
'@ember/destroyable': typeof _destroyable;
|
|
26
27
|
'@ember/helper': typeof _helpers;
|
|
@@ -29,10 +30,10 @@ declare const modules: {
|
|
|
29
30
|
'@ember/runloop': typeof _runloop;
|
|
30
31
|
'@ember/service': typeof _service;
|
|
31
32
|
'@ember/template-factory': {
|
|
32
|
-
createTemplateFactory:
|
|
33
|
+
createTemplateFactory: typeof createTemplateFactory;
|
|
33
34
|
};
|
|
34
35
|
'@ember/utils': typeof _utils;
|
|
35
36
|
'@glimmer/component': typeof _GlimmerComponent;
|
|
36
37
|
'@glimmer/tracking': typeof _tracking;
|
|
37
38
|
};
|
|
38
|
-
|
|
39
|
+
//# sourceMappingURL=known-modules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"known-modules.d.ts","sourceRoot":"","sources":["../../src/browser/known-modules.ts"],"names":[],"mappings":";AAAA;;;GAGG;AACH,OAAO,iBAAiB,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,eAAe,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,OAAO,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAG3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AAGvC,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;CAkBnB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { availablePlugins, availablePresets, transform } from '@babel/standalone';
|
|
2
|
+
import type { ComponentLike } from '@glint/template';
|
|
3
|
+
export interface CompileResult {
|
|
4
|
+
component?: ComponentLike;
|
|
5
|
+
error?: Error;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export interface Babel {
|
|
9
|
+
availablePlugins: typeof availablePlugins;
|
|
10
|
+
availablePresets: typeof availablePresets;
|
|
11
|
+
transform: typeof transform;
|
|
12
|
+
}
|
|
13
|
+
export type Options = {
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
* @deprecated do not use - not under semver
|
|
17
|
+
*/
|
|
18
|
+
skypack?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type ExtraModules = Record<string, unknown>;
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/browser/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,KAAK;IACpB,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,SAAS,EAAE,OAAO,SAAS,CAAC;CAC7B;AAED,MAAM,MAAM,OAAO,GAAG;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
* This can help with cacheing previously compiled components,
|
|
5
5
|
* and generally allowing a consumer to derive "known references" to user-input
|
|
6
6
|
*/
|
|
7
|
-
declare function nameFor(code: string, prefix?: string): string;
|
|
7
|
+
export declare function nameFor(code: string, prefix?: string): string;
|
|
8
8
|
/**
|
|
9
9
|
* Returns the text for invoking a component with a given name.
|
|
10
10
|
* It is assumed the component takes no arguments, as would be the
|
|
11
11
|
* case in REPLs / Playgrounds for the "root" component.
|
|
12
12
|
*/
|
|
13
|
-
declare function invocationOf(name: string): string;
|
|
13
|
+
export declare function invocationOf(name: string): string;
|
|
14
14
|
/**
|
|
15
15
|
* Core team does not want to support changes to '@ember/string' (v2 addonification, specifically)
|
|
16
16
|
* inflection does not support hyphens
|
|
17
17
|
*/
|
|
18
|
-
declare function invocationName(name: string): string;
|
|
19
|
-
|
|
18
|
+
export declare function invocationName(name: string): string;
|
|
19
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/browser/utils.ts"],"names":[],"mappings":"AAaA;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,SAAiB,UAI5D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,UAWxC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,UAE1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-support/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,SAEhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"__PRIVATE__.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eval.js","sources":["../../../src/browser/cjs/eval.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { modules } from '../known-modules';\n\nimport type { ExtraModules } from '../types';\nimport type Component from '@glimmer/component';\n\nexport function evalSnippet(\n compiled: string,\n extraModules: ExtraModules = {}\n): {\n default: Component;\n services?: { [key: string]: unknown };\n} {\n const exports = {};\n\n function require(moduleName: keyof typeof modules): unknown {\n let preConfigured = modules[moduleName] || extraModules[moduleName];\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return preConfigured || window.require(moduleName);\n }\n\n // https://github.com/glimmerjs/glimmer-experimental/blob/master/packages/examples/playground/src/utils/eval-snippet.ts\n eval(compiled);\n\n return Object.assign(exports, { require }) as {\n default: Component;\n services?: { [key: string]: unknown };\n require: unknown;\n };\n}\n"],"names":["evalSnippet","compiled","extraModules","exports","require","moduleName","preConfigured","modules","window","eval","Object","assign"],"mappings":";;AAAA;AAMO,SAASA,WAAWA,CACzBC,QAAgB,EAChBC,YAA0B,GAAG,EAAE,EAI/B;EACA,MAAMC,OAAO,GAAG,EAAE,CAAA;EAElB,SAASC,OAAOA,CAACC,UAAgC,EAAW;IAC1D,IAAIC,aAAa,GAAGC,OAAO,CAACF,UAAU,CAAC,IAAIH,YAAY,CAACG,UAAU,CAAC,CAAA;;AAEnE;AACA;AACA,IAAA,OAAOC,aAAa,IAAIE,MAAM,CAACJ,OAAO,CAACC,UAAU,CAAC,CAAA;AACpD,GAAA;;AAEA;EACAI,IAAI,CAACR,QAAQ,CAAC,CAAA;AAEd,EAAA,OAAOS,MAAM,CAACC,MAAM,CAACR,OAAO,EAAE;AAAEC,IAAAA,OAAAA;AAAQ,GAAC,CAAC,CAAA;AAK5C;;;;"}
|
|
1
|
+
{"version":3,"file":"eval.js","sources":["../../../src/browser/cjs/eval.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { modules } from '../known-modules.ts';\n\nimport type { ExtraModules } from '../types.ts';\nimport type Component from '@glimmer/component';\n\nexport function evalSnippet(\n compiled: string,\n extraModules: ExtraModules = {}\n): {\n default: Component;\n services?: { [key: string]: unknown };\n} {\n const exports = {};\n\n function require(moduleName: keyof typeof modules): unknown {\n let preConfigured = modules[moduleName] || extraModules[moduleName];\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return preConfigured || window.require(moduleName);\n }\n\n // https://github.com/glimmerjs/glimmer-experimental/blob/master/packages/examples/playground/src/utils/eval-snippet.ts\n eval(compiled);\n\n return Object.assign(exports, { require }) as {\n default: Component;\n services?: { [key: string]: unknown };\n require: unknown;\n };\n}\n"],"names":["evalSnippet","compiled","extraModules","exports","require","moduleName","preConfigured","modules","window","eval","Object","assign"],"mappings":";;AAAA;AAMO,SAASA,WAAWA,CACzBC,QAAgB,EAChBC,YAA0B,GAAG,EAAE,EAI/B;EACA,MAAMC,OAAO,GAAG,EAAE,CAAA;EAElB,SAASC,OAAOA,CAACC,UAAgC,EAAW;IAC1D,IAAIC,aAAa,GAAGC,OAAO,CAACF,UAAU,CAAC,IAAIH,YAAY,CAACG,UAAU,CAAC,CAAA;;AAEnE;AACA;AACA,IAAA,OAAOC,aAAa,IAAIE,MAAM,CAACJ,OAAO,CAACC,UAAU,CAAC,CAAA;AACpD,GAAA;;AAEA;EACAI,IAAI,CAACR,QAAQ,CAAC,CAAA;AAEd,EAAA,OAAOS,MAAM,CAACC,MAAM,CAACR,OAAO,EAAE;AAAEC,IAAAA,OAAAA;AAAQ,GAAC,CAAC,CAAA;AAK5C;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/browser/cjs/index.ts"],"sourcesContent":["import { preprocess, transform } from '../gjs';\nimport { nameFor } from '../utils';\nimport { evalSnippet } from './eval';\n\nimport type { CompileResult, ExtraModules } from '../types';\nimport type { ComponentLike } from '@glint/template';\n\nexport interface Info {\n code: string;\n name: string;\n}\n\nexport async function compileJS(code: string, extraModules?: ExtraModules): Promise<CompileResult> {\n let name = nameFor(code);\n let component: undefined | ComponentLike;\n let error: undefined | Error;\n\n try {\n let compiled = await compileGJS({ code: code, name });\n\n if (!compiled) {\n throw new Error(`Compiled output is missing`);\n }\n\n component = evalSnippet(compiled, extraModules).default as unknown as ComponentLike;\n } catch (e) {\n error = e as Error | undefined;\n }\n\n return { name, component, error };\n}\n\nasync function compileGJS({ code: input, name }: Info) {\n let preprocessed = preprocess(input, name);\n let result = await transform(preprocessed, name);\n\n if (!result) {\n return;\n }\n\n let { code } = result;\n\n return code;\n}\n"],"names":["compileJS","code","extraModules","name","nameFor","component","error","compiled","compileGJS","Error","evalSnippet","default","e","input","preprocessed","preprocess","result","transform"],"mappings":";;;;AAYO,eAAeA,SAASA,CAACC,IAAY,EAAEC,YAA2B,EAA0B;AACjG,EAAA,IAAIC,IAAI,GAAGC,OAAO,CAACH,IAAI,CAAC,CAAA;AACxB,EAAA,IAAII,SAAoC,CAAA;AACxC,EAAA,IAAIC,KAAwB,CAAA;EAE5B,IAAI;AACF,IAAA,IAAIC,QAAQ,GAAG,MAAMC,UAAU,CAAC;AAAEP,MAAAA,IAAI,EAAEA,IAAI;AAAEE,MAAAA,IAAAA;AAAK,KAAC,CAAC,CAAA;IAErD,IAAI,CAACI,QAAQ,EAAE;AACb,MAAA,MAAM,IAAIE,KAAK,CAAE,CAAA,0BAAA,CAA2B,CAAC,CAAA;AAC/C,KAAA;IAEAJ,SAAS,GAAGK,WAAW,CAACH,QAAQ,EAAEL,YAAY,CAAC,CAACS,OAAmC,CAAA;GACpF,CAAC,OAAOC,CAAC,EAAE;AACVN,IAAAA,KAAK,GAAGM,CAAsB,CAAA;AAChC,GAAA;EAEA,OAAO;IAAET,IAAI;IAAEE,SAAS;AAAEC,IAAAA,KAAAA;GAAO,CAAA;AACnC,CAAA;AAEA,eAAeE,UAAUA,CAAC;AAAEP,EAAAA,IAAI,EAAEY,KAAK;AAAEV,EAAAA,IAAAA;AAAW,CAAC,EAAE;AACrD,EAAA,IAAIW,YAAY,GAAGC,UAAU,CAACF,KAAK,EAAEV,IAAI,CAAC,CAAA;EAC1C,IAAIa,MAAM,GAAG,MAAMC,SAAS,CAACH,YAAY,EAAEX,IAAI,CAAC,CAAA;EAEhD,IAAI,CAACa,MAAM,EAAE;AACX,IAAA,OAAA;AACF,GAAA;EAEA,IAAI;AAAEf,IAAAA,IAAAA;AAAK,GAAC,GAAGe,MAAM,CAAA;AAErB,EAAA,OAAOf,IAAI,CAAA;AACb;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/browser/cjs/index.ts"],"sourcesContent":["import { preprocess, transform } from '../gjs.ts';\nimport { nameFor } from '../utils.ts';\nimport { evalSnippet } from './eval.ts';\n\nimport type { CompileResult, ExtraModules } from '../types.ts';\nimport type { ComponentLike } from '@glint/template';\n\nexport interface Info {\n code: string;\n name: string;\n}\n\nexport async function compileJS(code: string, extraModules?: ExtraModules): Promise<CompileResult> {\n let name = nameFor(code);\n let component: undefined | ComponentLike;\n let error: undefined | Error;\n\n try {\n let compiled = await compileGJS({ code: code, name });\n\n if (!compiled) {\n throw new Error(`Compiled output is missing`);\n }\n\n component = evalSnippet(compiled, extraModules).default as unknown as ComponentLike;\n } catch (e) {\n error = e as Error | undefined;\n }\n\n return { name, component, error };\n}\n\nasync function compileGJS({ code: input, name }: Info) {\n let preprocessed = preprocess(input, name);\n let result = await transform(preprocessed, name);\n\n if (!result) {\n return;\n }\n\n let { code } = result;\n\n return code;\n}\n"],"names":["compileJS","code","extraModules","name","nameFor","component","error","compiled","compileGJS","Error","evalSnippet","default","e","input","preprocessed","preprocess","result","transform"],"mappings":";;;;AAYO,eAAeA,SAASA,CAACC,IAAY,EAAEC,YAA2B,EAA0B;AACjG,EAAA,IAAIC,IAAI,GAAGC,OAAO,CAACH,IAAI,CAAC,CAAA;AACxB,EAAA,IAAII,SAAoC,CAAA;AACxC,EAAA,IAAIC,KAAwB,CAAA;EAE5B,IAAI;AACF,IAAA,IAAIC,QAAQ,GAAG,MAAMC,UAAU,CAAC;AAAEP,MAAAA,IAAI,EAAEA,IAAI;AAAEE,MAAAA,IAAAA;AAAK,KAAC,CAAC,CAAA;IAErD,IAAI,CAACI,QAAQ,EAAE;AACb,MAAA,MAAM,IAAIE,KAAK,CAAE,CAAA,0BAAA,CAA2B,CAAC,CAAA;AAC/C,KAAA;IAEAJ,SAAS,GAAGK,WAAW,CAACH,QAAQ,EAAEL,YAAY,CAAC,CAACS,OAAmC,CAAA;GACpF,CAAC,OAAOC,CAAC,EAAE;AACVN,IAAAA,KAAK,GAAGM,CAAsB,CAAA;AAChC,GAAA;EAEA,OAAO;IAAET,IAAI;IAAEE,SAAS;AAAEC,IAAAA,KAAAA;GAAO,CAAA;AACnC,CAAA;AAEA,eAAeE,UAAUA,CAAC;AAAEP,EAAAA,IAAI,EAAEY,KAAK;AAAEV,EAAAA,IAAAA;AAAW,CAAC,EAAE;AACrD,EAAA,IAAIW,YAAY,GAAGC,UAAU,CAACF,KAAK,EAAEV,IAAI,CAAC,CAAA;EAC1C,IAAIa,MAAM,GAAG,MAAMC,SAAS,CAACH,YAAY,EAAEX,IAAI,CAAC,CAAA;EAEhD,IAAI,CAACa,MAAM,EAAE;AACX,IAAA,OAAA;AACF,GAAA;EAEA,IAAI;AAAEf,IAAAA,IAAAA;AAAK,GAAC,GAAGe,MAAM,CAAA;AAErB,EAAA,OAAOf,IAAI,CAAA;AACb;;;;"}
|
|
@@ -87,7 +87,8 @@ async function compileMD(glimdownInput, options) {
|
|
|
87
87
|
blocks
|
|
88
88
|
} = await parseMarkdown(glimdownInput, {
|
|
89
89
|
CopyComponent: options?.CopyComponent,
|
|
90
|
-
ShadowComponent: options?.ShadowComponent
|
|
90
|
+
ShadowComponent: options?.ShadowComponent,
|
|
91
|
+
remarkPlugins: options?.remarkPlugins
|
|
91
92
|
});
|
|
92
93
|
rootTemplate = templateOnlyGlimdown;
|
|
93
94
|
liveCode = blocks;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formats.js","sources":["../../../src/browser/compile/formats.ts"],"sourcesContent":["import { invocationName } from '../utils';\n\nimport type { CompileResult } from '../types';\nimport type { ExtractedCode } from './markdown-to-ember';\nimport type { EvalImportMap, ScopeMap } from './types';\n\nasync function compileAll(js: { code: string }[], importMap?: EvalImportMap) {\n let modules = await Promise.all(\n js.map(async ({ code }) => {\n return await compileGJS(code, importMap);\n })\n );\n\n return modules;\n}\n\nexport async function compileGJS(\n gjsInput: string,\n importMap?: EvalImportMap\n): Promise<CompileResult> {\n try {\n let { compileJS } = await import('../js');\n\n return await compileJS(gjsInput, importMap);\n } catch (error) {\n return { error: error as Error, name: 'unknown' };\n }\n}\n\nexport async function compileHBS(\n hbsInput: string,\n options?: {\n moduleName?: string;\n scope?: Record<string, unknown>;\n }\n): Promise<CompileResult> {\n try {\n let { compileHBS } = await import('../hbs');\n\n return compileHBS(hbsInput, options);\n } catch (error) {\n return { error: error as Error, name: 'unknown' };\n }\n}\n\nasync function extractScope(\n liveCode: ExtractedCode[],\n importMap?: EvalImportMap\n): Promise<CompileResult[]> {\n let scope: CompileResult[] = [];\n\n let hbs = liveCode.filter((code) => code.lang === 'hbs');\n let js = liveCode.filter((code) => ['js', 'gjs'].includes(code.lang));\n\n if (js.length > 0) {\n let compiled = await compileAll(js, importMap);\n\n await Promise.all(\n compiled.map(async (info) => {\n // using web worker + import maps is not available yet (need firefox support)\n // (and to somehow be able to point at npm)\n //\n // if ('importPath' in info) {\n // return scope.push({\n // moduleName: name,\n // component: await import(/* webpackIgnore: true */ info.importPath),\n // });\n // }\n\n return scope.push(info);\n })\n );\n }\n\n for (let { code } of hbs) {\n let compiled = await compileHBS(code);\n\n scope.push(compiled);\n }\n\n return scope;\n}\n\nexport async function compileMD(\n glimdownInput: string,\n options?: {\n importMap?: EvalImportMap;\n topLevelScope?: ScopeMap;\n CopyComponent?: string;\n ShadowComponent?: string;\n }\n): Promise<CompileResult & { rootTemplate?: string }> {\n let importMap = options?.importMap;\n let topLevelScope = options?.topLevelScope ?? {};\n let rootTemplate: string;\n let liveCode: ExtractedCode[];\n let scope: CompileResult[] = [];\n\n /**\n * Step 1: Convert Markdown To HTML (Ember).\n *\n * The remark plugin, remark-code-extra also extracts\n * and transforms the code blocks we care about.\n *\n * These blocks will be compiled through babel and eval'd so the\n * compiled rootTemplate can invoke them\n */\n try {\n let { parseMarkdown } = await import('./markdown-to-ember');\n let { templateOnlyGlimdown, blocks } = await parseMarkdown(glimdownInput, {\n CopyComponent: options?.CopyComponent,\n ShadowComponent: options?.ShadowComponent,\n });\n\n rootTemplate = templateOnlyGlimdown;\n liveCode = blocks;\n } catch (error) {\n return { error: error as Error, name: 'unknown' };\n }\n\n /**\n * Step 2: Compile the live code samples\n */\n if (liveCode.length > 0) {\n try {\n scope = await extractScope(liveCode, importMap);\n } catch (error) {\n console.info({ scope });\n console.error(error);\n\n return { error: error as Error, rootTemplate, name: 'unknown' };\n }\n }\n\n /**\n * Make sure non of our snippets errored\n *\n * TODO: for these errors, report them differently so that we\n * can render the 'Ember' and still highlight the correct line?\n * or maybe there is a way to highlight in the editor instead?\n */\n for (let { error, component } of scope) {\n if (!component) {\n if (error) {\n return { error, rootTemplate, name: 'unknown' };\n }\n }\n }\n\n /**\n * Step 4: Compile the Ember Template\n */\n try {\n let localScope = scope.reduce((accum, { component, name }) => {\n
|
|
1
|
+
{"version":3,"file":"formats.js","sources":["../../../src/browser/compile/formats.ts"],"sourcesContent":["import { invocationName } from '../utils.ts';\n\nimport type { CompileResult } from '../types.ts';\nimport type { ExtractedCode } from './markdown-to-ember.ts';\nimport type { UnifiedPlugin } from './types.ts';\nimport type { EvalImportMap, ScopeMap } from './types.ts';\n\nasync function compileAll(js: { code: string }[], importMap?: EvalImportMap) {\n let modules = await Promise.all(\n js.map(async ({ code }) => {\n return await compileGJS(code, importMap);\n })\n );\n\n return modules;\n}\n\nexport async function compileGJS(\n gjsInput: string,\n importMap?: EvalImportMap\n): Promise<CompileResult> {\n try {\n let { compileJS } = await import('../js.ts');\n\n return await compileJS(gjsInput, importMap);\n } catch (error) {\n return { error: error as Error, name: 'unknown' };\n }\n}\n\nexport async function compileHBS(\n hbsInput: string,\n options?: {\n moduleName?: string;\n scope?: Record<string, unknown>;\n }\n): Promise<CompileResult> {\n try {\n let { compileHBS } = await import('../hbs.ts');\n\n return compileHBS(hbsInput, options);\n } catch (error) {\n return { error: error as Error, name: 'unknown' };\n }\n}\n\nasync function extractScope(\n liveCode: ExtractedCode[],\n importMap?: EvalImportMap\n): Promise<CompileResult[]> {\n let scope: CompileResult[] = [];\n\n let hbs = liveCode.filter((code) => code.lang === 'hbs');\n let js = liveCode.filter((code) => ['js', 'gjs'].includes(code.lang));\n\n if (js.length > 0) {\n let compiled = await compileAll(js, importMap);\n\n await Promise.all(\n compiled.map(async (info) => {\n // using web worker + import maps is not available yet (need firefox support)\n // (and to somehow be able to point at npm)\n //\n // if ('importPath' in info) {\n // return scope.push({\n // moduleName: name,\n // component: await import(/* webpackIgnore: true */ info.importPath),\n // });\n // }\n\n return scope.push(info);\n })\n );\n }\n\n for (let { code } of hbs) {\n let compiled = await compileHBS(code);\n\n scope.push(compiled);\n }\n\n return scope;\n}\n\nexport async function compileMD(\n glimdownInput: string,\n options?: {\n importMap?: EvalImportMap;\n topLevelScope?: ScopeMap;\n remarkPlugins?: UnifiedPlugin[];\n CopyComponent?: string;\n ShadowComponent?: string;\n }\n): Promise<CompileResult & { rootTemplate?: string }> {\n let importMap = options?.importMap;\n let topLevelScope = options?.topLevelScope ?? {};\n let rootTemplate: string;\n let liveCode: ExtractedCode[];\n let scope: CompileResult[] = [];\n\n /**\n * Step 1: Convert Markdown To HTML (Ember).\n *\n * The remark plugin, remark-code-extra also extracts\n * and transforms the code blocks we care about.\n *\n * These blocks will be compiled through babel and eval'd so the\n * compiled rootTemplate can invoke them\n */\n try {\n let { parseMarkdown } = await import('./markdown-to-ember.ts');\n let { templateOnlyGlimdown, blocks } = await parseMarkdown(glimdownInput, {\n CopyComponent: options?.CopyComponent,\n ShadowComponent: options?.ShadowComponent,\n remarkPlugins: options?.remarkPlugins,\n });\n\n rootTemplate = templateOnlyGlimdown;\n liveCode = blocks;\n } catch (error) {\n return { error: error as Error, name: 'unknown' };\n }\n\n /**\n * Step 2: Compile the live code samples\n */\n if (liveCode.length > 0) {\n try {\n scope = await extractScope(liveCode, importMap);\n } catch (error) {\n console.info({ scope });\n console.error(error);\n\n return { error: error as Error, rootTemplate, name: 'unknown' };\n }\n }\n\n /**\n * Make sure non of our snippets errored\n *\n * TODO: for these errors, report them differently so that we\n * can render the 'Ember' and still highlight the correct line?\n * or maybe there is a way to highlight in the editor instead?\n */\n for (let { error, component } of scope) {\n if (!component) {\n if (error) {\n return { error, rootTemplate, name: 'unknown' };\n }\n }\n }\n\n /**\n * Step 4: Compile the Ember Template\n */\n try {\n let localScope = scope.reduce(\n (accum, { component, name }) => {\n accum[invocationName(name)] = component;\n\n return accum;\n },\n {} as Record<string, unknown>\n );\n\n return await compileHBS(rootTemplate, {\n moduleName: 'DynamicRootTemplate',\n scope: {\n ...topLevelScope,\n ...localScope,\n },\n });\n } catch (error) {\n return { error: error as Error, rootTemplate, name: 'unknown' };\n }\n}\n"],"names":["compileAll","js","importMap","modules","Promise","all","map","code","compileGJS","gjsInput","compileJS","error","name","compileHBS","hbsInput","options","extractScope","liveCode","scope","hbs","filter","lang","includes","length","compiled","info","push","compileMD","glimdownInput","topLevelScope","rootTemplate","parseMarkdown","templateOnlyGlimdown","blocks","CopyComponent","ShadowComponent","remarkPlugins","console","component","localScope","reduce","accum","invocationName","moduleName"],"mappings":";;A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