ember-repl 5.0.1 → 7.0.0

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.
Files changed (147) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +2 -404
  3. package/config/.try.mjs +87 -0
  4. package/config/addon-main.cjs +7 -0
  5. package/config/attw.json +7 -0
  6. package/config/babel.publish.config.cjs +29 -0
  7. package/config/ember-cli-update.json +21 -0
  8. package/config/rollup.config.mjs +44 -0
  9. package/config/testem.cjs +35 -0
  10. package/config/tsconfig.publish.json +18 -0
  11. package/config/vite.config.mjs +36 -0
  12. package/declarations/compile/Compiled.d.ts +7 -0
  13. package/declarations/compile/Compiled.d.ts.map +1 -0
  14. package/declarations/compile/compile.d.ts +17 -0
  15. package/declarations/compile/compile.d.ts.map +1 -0
  16. package/declarations/compile/state.d.ts +43 -0
  17. package/declarations/compile/state.d.ts.map +1 -0
  18. package/declarations/compile/types.d.ts +5 -12
  19. package/declarations/compile/types.d.ts.map +1 -1
  20. package/declarations/index.d.ts +6 -2
  21. package/declarations/index.d.ts.map +1 -1
  22. package/declarations/services/compiler.d.ts +94 -0
  23. package/declarations/services/compiler.d.ts.map +1 -0
  24. package/declarations/services/known-modules.d.ts +7 -0
  25. package/declarations/services/known-modules.d.ts.map +1 -0
  26. package/declarations/setup.d.ts +7 -0
  27. package/declarations/setup.d.ts.map +1 -0
  28. package/declarations/test-support.d.ts +20 -0
  29. package/declarations/test-support.d.ts.map +1 -0
  30. package/dist/_commonjsHelpers-BAGoDD49.js +37 -0
  31. package/dist/_commonjsHelpers-BAGoDD49.js.map +1 -0
  32. package/dist/babel-8wMrbxkT.js +110427 -0
  33. package/dist/babel-8wMrbxkT.js.map +1 -0
  34. package/dist/blank-line-Bzg2Qt4K.js +482 -0
  35. package/dist/blank-line-Bzg2Qt4K.js.map +1 -0
  36. package/dist/compile/Compiled.js +26 -0
  37. package/dist/compile/Compiled.js.map +1 -0
  38. package/dist/compile/compile.js +62 -0
  39. package/dist/compile/compile.js.map +1 -0
  40. package/dist/compile/state.js +75 -0
  41. package/dist/compile/state.js.map +1 -0
  42. package/dist/compile/utils.js +214 -3
  43. package/dist/compile/utils.js.map +1 -1
  44. package/dist/default-CoqAuVeH.js +4 -0
  45. package/dist/default-CoqAuVeH.js.map +1 -0
  46. package/dist/index-BTx1k6gT.js +323 -0
  47. package/dist/index-BTx1k6gT.js.map +1 -0
  48. package/dist/index-Bxzjtr16.js +87 -0
  49. package/dist/index-Bxzjtr16.js.map +1 -0
  50. package/dist/index-C371bO_b.js +1553 -0
  51. package/dist/index-C371bO_b.js.map +1 -0
  52. package/dist/index-C4AyeeIa.js +5721 -0
  53. package/dist/index-C4AyeeIa.js.map +1 -0
  54. package/dist/index-C8S2G0FH.js +1953 -0
  55. package/dist/index-C8S2G0FH.js.map +1 -0
  56. package/dist/index-CCcIVEUK.js +409 -0
  57. package/dist/index-CCcIVEUK.js.map +1 -0
  58. package/dist/index-CDSIcg03.js +9070 -0
  59. package/dist/index-CDSIcg03.js.map +1 -0
  60. package/dist/index-D8szzCn3.js +2 -0
  61. package/dist/index-D8szzCn3.js.map +1 -0
  62. package/dist/index-DBBNT106.js +2644 -0
  63. package/dist/index-DBBNT106.js.map +1 -0
  64. package/dist/index-DP_Su7Zc.js +362 -0
  65. package/dist/index-DP_Su7Zc.js.map +1 -0
  66. package/dist/index-DejgrVqh.js +11299 -0
  67. package/dist/index-DejgrVqh.js.map +1 -0
  68. package/dist/index-Dr5iYoKt.js +1551 -0
  69. package/dist/index-Dr5iYoKt.js.map +1 -0
  70. package/dist/index-DxolpiGq.js +3336 -0
  71. package/dist/index-DxolpiGq.js.map +1 -0
  72. package/dist/index-ZyJlPFQY.js +249 -0
  73. package/dist/index-ZyJlPFQY.js.map +1 -0
  74. package/dist/index-k6CfLgeq.js +26 -0
  75. package/dist/index-k6CfLgeq.js.map +1 -0
  76. package/dist/index.js +4 -1
  77. package/dist/index.js.map +1 -1
  78. package/dist/services/compiler.js +329 -0
  79. package/dist/services/compiler.js.map +1 -0
  80. package/dist/services/known-modules.js +123 -0
  81. package/dist/services/known-modules.js.map +1 -0
  82. package/dist/setup.js +15 -0
  83. package/dist/setup.js.map +1 -0
  84. package/dist/test-support.js +33 -0
  85. package/dist/test-support.js.map +1 -0
  86. package/package.json +118 -147
  87. package/src/compile/Compiled.ts +45 -0
  88. package/src/compile/compile.ts +89 -0
  89. package/src/compile/state.ts +88 -0
  90. package/src/compile/types.ts +14 -13
  91. package/src/compile/utils.ts +1 -1
  92. package/src/index.ts +6 -2
  93. package/src/services/compiler.ts +401 -0
  94. package/src/services/known-modules.ts +130 -0
  95. package/src/setup.ts +26 -0
  96. package/src/test-support.ts +64 -0
  97. package/addon-main.cjs +0 -5
  98. package/declarations/__PRIVATE__.d.ts +0 -2
  99. package/declarations/__PRIVATE__.d.ts.map +0 -1
  100. package/declarations/compile/formats/gjs/babel.d.ts +0 -7
  101. package/declarations/compile/formats/gjs/babel.d.ts.map +0 -1
  102. package/declarations/compile/formats/gjs/eval.d.ts +0 -8
  103. package/declarations/compile/formats/gjs/eval.d.ts.map +0 -1
  104. package/declarations/compile/formats/gjs/index.d.ts +0 -24
  105. package/declarations/compile/formats/gjs/index.d.ts.map +0 -1
  106. package/declarations/compile/formats/gjs/known-modules.d.ts +0 -46
  107. package/declarations/compile/formats/gjs/known-modules.d.ts.map +0 -1
  108. package/declarations/compile/formats/hbs.d.ts +0 -17
  109. package/declarations/compile/formats/hbs.d.ts.map +0 -1
  110. package/declarations/compile/formats/markdown.d.ts +0 -22
  111. package/declarations/compile/formats/markdown.d.ts.map +0 -1
  112. package/declarations/compile/formats.d.ts +0 -18
  113. package/declarations/compile/formats.d.ts.map +0 -1
  114. package/declarations/compile/index.d.ts +0 -81
  115. package/declarations/compile/index.d.ts.map +0 -1
  116. package/declarations/test-support/index.d.ts +0 -2
  117. package/declarations/test-support/index.d.ts.map +0 -1
  118. package/dist/__PRIVATE__.js +0 -2
  119. package/dist/__PRIVATE__.js.map +0 -1
  120. package/dist/compile/formats/gjs/babel.js +0 -2
  121. package/dist/compile/formats/gjs/babel.js.map +0 -1
  122. package/dist/compile/formats/gjs/eval.js +0 -20
  123. package/dist/compile/formats/gjs/eval.js.map +0 -1
  124. package/dist/compile/formats/gjs/index.js +0 -120
  125. package/dist/compile/formats/gjs/index.js.map +0 -1
  126. package/dist/compile/formats/gjs/known-modules.js +0 -50
  127. package/dist/compile/formats/gjs/known-modules.js.map +0 -1
  128. package/dist/compile/formats/hbs.js +0 -94
  129. package/dist/compile/formats/hbs.js.map +0 -1
  130. package/dist/compile/formats/markdown.js +0 -264
  131. package/dist/compile/formats/markdown.js.map +0 -1
  132. package/dist/compile/formats.js +0 -173
  133. package/dist/compile/formats.js.map +0 -1
  134. package/dist/compile/index.js +0 -113
  135. package/dist/compile/index.js.map +0 -1
  136. package/dist/test-support/index.js +0 -8
  137. package/dist/test-support/index.js.map +0 -1
  138. package/src/__PRIVATE__.ts +0 -1
  139. package/src/compile/formats/gjs/babel.ts +0 -7
  140. package/src/compile/formats/gjs/eval.ts +0 -30
  141. package/src/compile/formats/gjs/index.ts +0 -151
  142. package/src/compile/formats/gjs/known-modules.ts +0 -49
  143. package/src/compile/formats/hbs.ts +0 -101
  144. package/src/compile/formats/markdown.ts +0 -344
  145. package/src/compile/formats.ts +0 -179
  146. package/src/compile/index.ts +0 -219
  147. package/src/test-support/index.ts +0 -5
@@ -0,0 +1,130 @@
1
+ import type { ModuleMap } from '../compile/types.ts';
2
+
3
+ const frameworkModules = {
4
+ '@ember/application': () => import('@ember/application'),
5
+ '@ember/application/instance': () => import('@ember/application/instance'),
6
+ '@ember/array': () => import('@ember/array'),
7
+ '@ember/component': () => import('@ember/component'),
8
+ '@ember/component/helper': () => import('@ember/component/helper'),
9
+ '@ember/component/template-only': () => import('@ember/component/template-only'),
10
+ '@ember/debug': () => import('@ember/debug'),
11
+ '@ember/destroyable': () => import('@ember/destroyable'),
12
+ '@ember/helper': () => import('@ember/helper'),
13
+ '@ember/modifier': () => import('@ember/modifier'),
14
+ '@ember/object': () => import('@ember/object'),
15
+ '@ember/owner': () => import('@ember/owner'),
16
+ '@ember/reactive': () => import('@ember/reactive'),
17
+ '@ember/reactive/collections': () => import('@ember/reactive/collections'),
18
+ '@ember/renderer': () => import('@ember/renderer'),
19
+ '@ember/routing': () => import('@ember/routing'),
20
+ '@ember/routing/route': () => import('@ember/routing/route'),
21
+ '@ember/routing/router': () => import('@ember/routing/router'),
22
+ '@ember/runloop': () => import('@ember/runloop'),
23
+ '@ember/service': () => import('@ember/service'),
24
+ '@ember/template': () => import('@ember/template'),
25
+ '@ember/template-compilation': () => import('@ember/template-compilation'),
26
+ '@ember/template-factory': () => import('@ember/template-factory'),
27
+ '@ember/test-helpers': () => import('@ember/test-helpers'),
28
+ '@ember/test-waiters': () => import('@ember/test-waiters'),
29
+ '@ember/test': () => import('@ember/test'),
30
+ '@ember/utils': () => import('@ember/utils'),
31
+ '@ember/version': () => import('@ember/version'),
32
+ '@glimmer/component': () => import('@glimmer/component'),
33
+ '@glimmer/tracking': () => import('@glimmer/tracking'),
34
+ '@glimmer/tracking/primitives/cache': () => import('@glimmer/tracking/primitives/cache'),
35
+ };
36
+
37
+ const coreLibraries = {
38
+ 'ember-resolver': () => import('ember-resolver'),
39
+ 'ember-resources': () => import('ember-resources'),
40
+ 'ember-primitives': () => import('ember-primitives'),
41
+ 'repl-sdk': () => import('repl-sdk'),
42
+ };
43
+
44
+ const emberCompilationModules = {
45
+ '@ember/template-compiler/runtime': () => import('@ember/template-compiler/runtime'),
46
+ '@ember/template-compiler': () => import('@ember/template-compiler/runtime'),
47
+ 'ember-source/dist/ember-template-compiler': () =>
48
+ import(
49
+ // eslint-disable-next-line
50
+ // @ts-ignore
51
+ 'ember-source/dist/ember-template-compiler.js'
52
+ ),
53
+ 'ember-source/dist/ember-template-compiler.js': () =>
54
+ import(
55
+ // eslint-disable-next-line
56
+ // @ts-ignore
57
+ 'ember-source/dist/ember-template-compiler.js'
58
+ ),
59
+ // Direct Dependencies
60
+ '@babel/standalone': () => import('@babel/standalone'),
61
+ 'content-tag': () => import('content-tag'),
62
+ 'decorator-transforms': () => import('decorator-transforms'),
63
+ 'decorator-transforms/runtime': () => import('decorator-transforms/runtime'),
64
+ 'babel-plugin-ember-template-compilation': () =>
65
+ import('babel-plugin-ember-template-compilation'),
66
+ // Dependencies of the above
67
+ 'babel-import-util': () => import('babel-import-util'),
68
+ // eslint-disable-next-line
69
+ // @ts-ignore
70
+ 'babel-plugin-debug-macros': () => import('babel-plugin-debug-macros'),
71
+ '@embroider/macros': () => ({
72
+ // passthrough, we are not doing dead-code-elimination
73
+ macroCondition: (x: boolean) => x,
74
+ // I *could* actually implement this
75
+ dependencySatisfies: () => true,
76
+ isDevelopingApp: () => true,
77
+ // Trying to use warp-drive in a REPL environment may be impossible, since they
78
+ // encourage choosing your own adventure without a buildless recommended path.
79
+ // The use of nested configs (specifically env) is also problematic for
80
+ // "falling back to false" as what all other macros-using libraries use.
81
+ // (many of us have seen "Cannot access DEBUG on undefined" in build errors)
82
+ // Even with this config, I have not successfully been able to use warp-drive
83
+ // in any of my REPL-based projects.
84
+ //
85
+ // (Its also perfectly fine for warp-drive to decide they don't care about the same things I do)
86
+ getGlobalConfig: () => ({
87
+ WarpDrive: {
88
+ debug: false,
89
+ env: {
90
+ DEBUG: false,
91
+ TESTING: false,
92
+ PRODUCTION: true,
93
+ },
94
+ activeLogging: false,
95
+ compatWith: '99.0',
96
+ features: {},
97
+ deprecations: {},
98
+ polyfillUUID: false,
99
+ includeDataAdapter: false,
100
+ },
101
+ }),
102
+ // Private
103
+ // eslint-disable-next-line
104
+ // @ts-ignore
105
+ importSync: (x: string) => window[Symbol.for('__repl-sdk__compiler__')].resolves[x],
106
+ moduleExists: () => false,
107
+ }),
108
+ };
109
+
110
+ const markdownCompilationModules = {
111
+ 'rehype-raw': () => import('rehype-raw'),
112
+ 'rehype-stringify': () => import('rehype-stringify'),
113
+ 'remark-gfm': () => import('remark-gfm'),
114
+ 'remark-parse': () => import('remark-parse'),
115
+ 'remark-rehype': () => import('remark-rehype'),
116
+ unified: () => import('unified'),
117
+ 'unist-util-visit': () => import('unist-util-visit'),
118
+ };
119
+
120
+ /**
121
+ * If any real packages are defined here, they would fallback to fetching from NPM
122
+ * instead of loading from this pre-made bundle.
123
+ */
124
+ export const modules = (extraModules: ModuleMap): ModuleMap => ({
125
+ ...coreLibraries,
126
+ ...frameworkModules,
127
+ ...extraModules,
128
+ ...emberCompilationModules,
129
+ ...markdownCompilationModules,
130
+ });
package/src/setup.ts ADDED
@@ -0,0 +1,26 @@
1
+ import { assert } from '@ember/debug';
2
+
3
+ import { getCompiler } from './services/compiler.ts';
4
+
5
+ import type { ModuleMap } from './compile/types.ts';
6
+ import type CompilerService from './services/compiler.ts';
7
+
8
+ const NO_MODULES = Symbol.for('no custom modules configured');
9
+
10
+ export function setup(
11
+ context: object,
12
+ options?: { modules?: ModuleMap; options?: object }
13
+ ): CompilerService {
14
+ const compiler = getCompiler(context);
15
+
16
+ assert(`Could not find the compiler service.`, compiler);
17
+
18
+ compiler.setup(
19
+ options?.modules ?? {
20
+ [NO_MODULES]: true,
21
+ },
22
+ options?.options
23
+ );
24
+
25
+ return compiler;
26
+ }
@@ -0,0 +1,64 @@
1
+ import { Compiler } from 'repl-sdk';
2
+
3
+ import { CACHE } from './compile/compile.ts';
4
+ import { setup } from './setup.ts';
5
+
6
+ import type { ModuleMap } from './compile/types.ts';
7
+ import type { TestContext } from '@ember/test-helpers';
8
+ import type { Options } from 'repl-sdk';
9
+
10
+ export function clearCompileCache() {
11
+ CACHE.clear();
12
+ }
13
+
14
+ type Hooks = {
15
+ beforeEach: (
16
+ this: object,
17
+ callback: (...args: unknown[]) => void | Promise<void>
18
+ ) => void | Promise<void>;
19
+ afterEach: (
20
+ this: object,
21
+ callback: (...args: unknown[]) => void | Promise<void>
22
+ ) => void | Promise<void>;
23
+ };
24
+
25
+ export function clearCache(hooks: Hooks) {
26
+ hooks.beforeEach(function (this: TestContext) {
27
+ Compiler.clearCache();
28
+ });
29
+ hooks.afterEach(function (this: TestContext) {
30
+ Compiler.clearCache();
31
+ });
32
+ }
33
+
34
+ export function setupCompiler(
35
+ hooks: Hooks,
36
+ options?: {
37
+ modules?: ModuleMap;
38
+ /**
39
+ * Clear all the compile caches between tests.
40
+ * This is false by default, so that tests run faster, and
41
+ * we thrash the network less.
42
+ */
43
+ clearCache?: true;
44
+ options?: Options['options'];
45
+ }
46
+ ) {
47
+ hooks.beforeEach(function (this: TestContext) {
48
+ Compiler.clearCache();
49
+
50
+ if (options?.clearCache) {
51
+ clearCompileCache();
52
+ }
53
+
54
+ setup(this, options);
55
+ });
56
+
57
+ hooks.afterEach(function (this: TestContext) {
58
+ Compiler.clearCache();
59
+
60
+ if (options?.clearCache) {
61
+ clearCompileCache();
62
+ }
63
+ });
64
+ }
package/addon-main.cjs DELETED
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- const { addonV1Shim } = require('@embroider/addon-shim');
4
-
5
- module.exports = addonV1Shim(__dirname);
@@ -1,2 +0,0 @@
1
- export { CACHE } from './compile/index.ts';
2
- //# sourceMappingURL=__PRIVATE__.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"__PRIVATE__.d.ts","sourceRoot":"","sources":["../src/__PRIVATE__.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { availablePlugins, availablePresets, transform } from '@babel/standalone';
2
- export interface Babel {
3
- availablePlugins: typeof availablePlugins;
4
- availablePresets: typeof availablePresets;
5
- transform: typeof transform;
6
- }
7
- //# sourceMappingURL=babel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"babel.d.ts","sourceRoot":"","sources":["../../../../src/compile/formats/gjs/babel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEvF,MAAM,WAAW,KAAK;IACpB,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,SAAS,EAAE,OAAO,SAAS,CAAC;CAC7B"}
@@ -1,8 +0,0 @@
1
- import type Component from '@glimmer/component';
2
- export declare function evalSnippet(compiled: string, extraModules?: Record<string, unknown>): {
3
- default: Component;
4
- services?: {
5
- [key: string]: unknown;
6
- };
7
- };
8
- //# sourceMappingURL=eval.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eval.d.ts","sourceRoot":"","sources":["../../../../src/compile/formats/gjs/eval.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAC;AAEhD,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,YAAY,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAA4B,GAC/D;IACD,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACvC,CAkBA"}
@@ -1,24 +0,0 @@
1
- import type { CompileResult } from '../../types.ts';
2
- export interface Info {
3
- code: string;
4
- name: string;
5
- }
6
- /**
7
- * @public
8
- * Transpiles GlimmerJS (*.gjs) formatted text into and evaluates as a JS Module.
9
- * The returned component can be invoked explicitly in the consuming project.
10
- *
11
- * SEE: README for example usage
12
- *
13
- * @param {string} code: the code to be compiled
14
- * @param {Object} extraModules: map of import paths to modules. This isn't needed
15
- * for classic ember projects, but for strict static ember projects, extraModules
16
- * will need to be pasesd if compileJS is intended to be used in a styleguide or
17
- * if there are additional modules that could be imported in the passed `code`.
18
- *
19
- * Later on, imports that are not present by default (ember/glimmer) or that
20
- * are not provided by extraModules will be searched on npm to see if a package
21
- * needs to be downloaded before running the `code` / invoking the component
22
- */
23
- export declare function compileJS(code: string, extraModules?: Record<string, unknown>): Promise<CompileResult>;
24
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/compile/formats/gjs/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpD,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,OAAO,CAAC,aAAa,CAAC,CAkBxB"}
@@ -1,46 +0,0 @@
1
- /**
2
- * We need to import and hang on to these references so that they
3
- * don't get optimized away during deploy
4
- */
5
- import _GlimmerComponent from '@glimmer/component';
6
- import * as _tracking from '@glimmer/tracking';
7
- import * as _application from '@ember/application';
8
- import * as _array from '@ember/array';
9
- import * as _EmberComponent from '@ember/component';
10
- import * as _EmberComponentHelper from '@ember/component/helper';
11
- import * as _debug from '@ember/debug';
12
- import * as _destroyable from '@ember/destroyable';
13
- import * as _helpers from '@ember/helper';
14
- import * as _modifier from '@ember/modifier';
15
- import * as _object from '@ember/object';
16
- import * as _owner from '@ember/owner';
17
- import * as _runloop from '@ember/runloop';
18
- import * as _service from '@ember/service';
19
- import * as _template from '@ember/template';
20
- import { createTemplateFactory } from '@ember/template-factory';
21
- import * as _utils from '@ember/utils';
22
- import * as _decoratorsRuntime from 'decorator-transforms/runtime';
23
- export declare const modules: {
24
- '@ember/application': typeof _application;
25
- '@ember/array': typeof _array;
26
- '@ember/component': typeof _EmberComponent;
27
- '@ember/component/helper': typeof _EmberComponentHelper;
28
- '@ember/component/template-only': <S>(moduleName?: string, name?: string) => import("@ember/component/template-only").TemplateOnlyComponent<S>;
29
- '@ember/debug': typeof _debug;
30
- '@ember/destroyable': typeof _destroyable;
31
- '@ember/helper': typeof _helpers;
32
- '@ember/modifier': typeof _modifier;
33
- '@ember/object': typeof _object;
34
- '@ember/runloop': typeof _runloop;
35
- '@ember/service': typeof _service;
36
- '@ember/template-factory': {
37
- createTemplateFactory: typeof createTemplateFactory;
38
- };
39
- '@ember/utils': typeof _utils;
40
- '@ember/template': typeof _template;
41
- '@ember/owner': typeof _owner;
42
- '@glimmer/component': typeof _GlimmerComponent;
43
- '@glimmer/tracking': typeof _tracking;
44
- 'decorator-transforms/runtime': typeof _decoratorsRuntime;
45
- };
46
- //# sourceMappingURL=known-modules.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"known-modules.d.ts","sourceRoot":"","sources":["../../../../src/compile/formats/gjs/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;AACpD,OAAO,KAAK,qBAAqB,MAAM,yBAAyB,CAAC;AAEjE,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,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAG7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AAEvC,OAAO,KAAK,kBAAkB,MAAM,8BAA8B,CAAC;AAEnE,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;CAqBnB,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { CompileResult } from '../types.ts';
2
- /**
3
- * compile a template with an empty scope
4
- * to use components, helpers, etc, you will need to compile with JS
5
- *
6
- * (templates alone do not have a way to import / define complex structures)
7
- */
8
- export declare function compileHBS(template: string, options?: CompileTemplateOptions): CompileResult;
9
- interface CompileTemplateOptions {
10
- /**
11
- * Used for debug viewing
12
- */
13
- moduleName?: string;
14
- scope?: Record<string, unknown>;
15
- }
16
- export {};
17
- //# sourceMappingURL=hbs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hbs.d.ts","sourceRoot":"","sources":["../../../src/compile/formats/hbs.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD;;;;;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"}
@@ -1,22 +0,0 @@
1
- import type { UnifiedPlugin } from '../types.ts';
2
- export interface ExtractedCode {
3
- name: string;
4
- code: string;
5
- lang: 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
- rehypePlugins?: UnifiedPlugin[];
16
- }
17
- /**
18
- * @internal not under semver
19
- */
20
- export declare function parseMarkdown(input: string, options?: ParseMarkdownOptions): Promise<LiveCodeExtraction>;
21
- export {};
22
- //# sourceMappingURL=markdown.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../src/compile/formats/markdown.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD,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;AA0SD,UAAU,oBAAoB;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,aAAa,EAAE,CAAC;IAChC,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"}
@@ -1,18 +0,0 @@
1
- import type { CompileResult, UnifiedPlugin } from './types.ts';
2
- import type { EvalImportMap, ScopeMap } from './types.ts';
3
- export declare function compileGJS(gjsInput: string, importMap?: EvalImportMap): Promise<CompileResult>;
4
- export declare function compileHBS(hbsInput: string, options?: {
5
- moduleName?: string;
6
- scope?: Record<string, unknown>;
7
- }): Promise<CompileResult>;
8
- export declare function compileMD(glimdownInput: string, options?: {
9
- importMap?: EvalImportMap;
10
- topLevelScope?: ScopeMap;
11
- remarkPlugins?: UnifiedPlugin[];
12
- rehypePlugins?: UnifiedPlugin[];
13
- CopyComponent?: string;
14
- ShadowComponent?: string;
15
- }): Promise<CompileResult & {
16
- rootTemplate?: string;
17
- }>;
18
- //# sourceMappingURL=formats.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formats.d.ts","sourceRoot":"","sources":["../../src/compile/formats.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC/D,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;AA2CD,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,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"}
@@ -1,81 +0,0 @@
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
- rehypePlugins?: UnifiedPlugin[];
18
- CopyComponent?: string;
19
- ShadowComponent?: string;
20
- topLevelScope?: ScopeMap;
21
- }
22
- interface GJSOptions extends Scope, Events {
23
- format: 'gjs';
24
- remarkPlugins?: never;
25
- rehypePlugins?: never;
26
- CopyComponent?: never;
27
- ShadowComponent?: never;
28
- }
29
- interface HBSOptions extends Scope, Events {
30
- format: 'hbs';
31
- topLevelScope?: ScopeMap;
32
- remarkPlugins?: never;
33
- rehypePlugins?: never;
34
- CopyComponent?: never;
35
- ShadowComponent?: never;
36
- }
37
- /**
38
- * Compile GitHub-flavored Markdown with GJS support
39
- * and optionally render gjs-snippets via a `live` meta tag
40
- * on the code fences.
41
- */
42
- export declare function compile(text: string, options: GlimdownOptions): Promise<void>;
43
- /**
44
- * Compile GJS
45
- */
46
- export declare function compile(text: string, options: GJSOptions): Promise<void>;
47
- /**
48
- * Compile a stateless component using just the template
49
- */
50
- export declare function compile(text: string, options: HBSOptions): Promise<void>;
51
- type Input = string | undefined | null;
52
- type ExtraOptions = {
53
- format: 'glimdown';
54
- remarkPlugins?: UnifiedPlugin[];
55
- rehypePlugins?: UnifiedPlugin[];
56
- importMap?: EvalImportMap;
57
- CopyComponent?: string;
58
- ShadowComponent?: string;
59
- topLevelScope?: ScopeMap;
60
- } | {
61
- format: 'hbs';
62
- topLevelScope?: ScopeMap;
63
- } | {
64
- format: 'gjs';
65
- importMap?: EvalImportMap;
66
- };
67
- /**
68
- * @internal
69
- */
70
- export interface Value {
71
- isReady: boolean;
72
- error: string | null;
73
- component: ComponentLike;
74
- }
75
- export declare function Compiled(markdownText: Input | (() => Input)): Value;
76
- export declare function Compiled(markdownText: Input | (() => Input), options?: Format): Value;
77
- export declare function Compiled(markdownText: Input | (() => Input), options?: () => Format): Value;
78
- export declare function Compiled(markdownText: Input | (() => Input), options?: ExtraOptions): Value;
79
- export declare function Compiled(markdownText: Input | (() => Input), options?: () => ExtraOptions): Value;
80
- export {};
81
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/compile/index.ts"],"names":[],"mappings":"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"}
@@ -1,2 +0,0 @@
1
- export declare function clearCompileCache(): void;
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-support/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,SAEhC"}
@@ -1,2 +0,0 @@
1
- export { CACHE } from './compile/index.js';
2
- //# sourceMappingURL=__PRIVATE__.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"__PRIVATE__.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=babel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"babel.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,20 +0,0 @@
1
- import { modules } from './known-modules.js';
2
-
3
- /* eslint-disable @typescript-eslint/no-unused-vars */
4
- function evalSnippet(compiled, extraModules = {}) {
5
- const exports = {};
6
- function require(moduleName) {
7
- let preConfigured = modules[moduleName] || extraModules[moduleName];
8
-
9
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
10
- // @ts-ignore
11
- return preConfigured || window.require(moduleName);
12
- }
13
- eval(compiled);
14
- return Object.assign(exports, {
15
- require
16
- });
17
- }
18
-
19
- export { evalSnippet };
20
- //# sourceMappingURL=eval.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"eval.js","sources":["../../../../src/compile/formats/gjs/eval.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { modules } from './known-modules.ts';\n\nimport type Component from '@glimmer/component';\n\nexport function evalSnippet(\n compiled: string,\n extraModules: Record<string, unknown /* imported module */> = {}\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 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;AAKO,SAASA,WAAWA,CACzBC,QAAgB,EAChBC,YAA2D,GAAG,EAAE,EAIhE;EACA,MAAMC,OAAO,GAAG,EAAE;EAElB,SAASC,OAAOA,CAACC,UAAgC,EAAW;IAC1D,IAAIC,aAAa,GAAGC,OAAO,CAACF,UAAU,CAAC,IAAIH,YAAY,CAACG,UAAU,CAAC;;AAEnE;AACA;AACA,IAAA,OAAOC,aAAa,IAAIE,MAAM,CAACJ,OAAO,CAACC,UAAU,CAAC;AACpD;EAEAI,IAAI,CAACR,QAAQ,CAAC;AAEd,EAAA,OAAOS,MAAM,CAACC,MAAM,CAACR,OAAO,EAAE;AAAEC,IAAAA;AAAQ,GAAC,CAAC;AAK5C;;;;"}