ember-repl 7.0.1 → 7.0.2

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 (33) hide show
  1. package/declarations/services/known-modules.d.ts.map +1 -1
  2. package/dist/{babel-8wMrbxkT.js → babel-DbH-RlNa.js} +62593 -66125
  3. package/dist/babel-DbH-RlNa.js.map +1 -0
  4. package/dist/compile/state.js.map +1 -1
  5. package/dist/{index-C4AyeeIa.js → index-Bm1Y84Cu.js} +2 -2
  6. package/dist/{index-C4AyeeIa.js.map → index-Bm1Y84Cu.js.map} +1 -1
  7. package/dist/{index-CCcIVEUK.js → index-Bo3xsMqx.js} +8 -7
  8. package/dist/index-Bo3xsMqx.js.map +1 -0
  9. package/dist/{index-DejgrVqh.js → index-C-twRw93.js} +16 -1327
  10. package/dist/index-C-twRw93.js.map +1 -0
  11. package/dist/{index-C8S2G0FH.js → index-CGDqu098.js} +111 -139
  12. package/dist/index-CGDqu098.js.map +1 -0
  13. package/dist/index-DIRpUv6Z.js +2 -0
  14. package/dist/index-DIRpUv6Z.js.map +1 -0
  15. package/dist/{index-DBBNT106.js → index-DMSCybEq.js} +7 -11
  16. package/dist/index-DMSCybEq.js.map +1 -0
  17. package/dist/{index-DxolpiGq.js → index-F3Sr0JFE.js} +57 -54
  18. package/dist/index-F3Sr0JFE.js.map +1 -0
  19. package/dist/services/compiler.js +2 -3
  20. package/dist/services/compiler.js.map +1 -1
  21. package/dist/services/known-modules.js +9 -11
  22. package/dist/services/known-modules.js.map +1 -1
  23. package/package.json +39 -39
  24. package/src/services/compiler.ts +1 -1
  25. package/src/services/known-modules.ts +5 -4
  26. package/dist/babel-8wMrbxkT.js.map +0 -1
  27. package/dist/index-C8S2G0FH.js.map +0 -1
  28. package/dist/index-CCcIVEUK.js.map +0 -1
  29. package/dist/index-D8szzCn3.js +0 -2
  30. package/dist/index-D8szzCn3.js.map +0 -1
  31. package/dist/index-DBBNT106.js.map +0 -1
  32. package/dist/index-DejgrVqh.js.map +0 -1
  33. package/dist/index-DxolpiGq.js.map +0 -1
@@ -14,11 +14,10 @@ import { Compiler } from 'repl-sdk';
14
14
  import { nameFor } from '../compile/utils.js';
15
15
  import { modules } from './known-modules.js';
16
16
  import { g, i, n } from 'decorator-transforms/runtime-esm';
17
- import { v as visit } from '../index-CCcIVEUK.js';
17
+ import { v as visit } from '../index-Bo3xsMqx.js';
18
18
 
19
19
  /* eslint-disable getter-return */
20
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
21
- // @ts-ignore
20
+
22
21
  function getCompiler(context) {
23
22
  const owner = getOwner(context) ?? context;
24
23
  assert(`Missing owner. Cannot use ember-repl's compiler without an owner.`, owner);
@@ -1 +1 @@
1
- {"version":3,"file":"compiler.js","sources":["../../src/services/compiler.ts"],"sourcesContent":["/* eslint-disable getter-return */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport { tracked } from '@glimmer/tracking';\nimport { setComponentTemplate } from '@ember/component';\nimport templateOnly from '@ember/component/template-only';\nimport { assert } from '@ember/debug';\nimport { registerDestructor } from '@ember/destroyable';\nimport { array, concat, fn, get, hash } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { getOwner } from '@ember/owner';\nimport { precompileTemplate } from '@ember/template-compilation';\nimport { waitFor } from '@ember/test-waiters';\n\nimport { createStore } from 'ember-primitives/store';\nimport { resource } from 'ember-resources';\nimport { Compiler } from 'repl-sdk';\nimport { visit } from 'unist-util-visit';\n\nimport { nameFor } from '../compile/utils.ts';\nimport { modules } from './known-modules.ts';\n\nimport type { CompileResult, ModuleMap } from '../compile/types.ts';\nimport type { ComponentLike } from '@glint/template';\nimport type { EditorView } from 'codemirror';\nimport type { ErrorMessage, InfoMessage, Message } from 'repl-sdk';\n\nexport function getCompiler(context: object) {\n const owner = getOwner(context) ?? context;\n\n assert(`Missing owner. Cannot use ember-repl's compiler without an owner.`, owner);\n\n return createStore(owner, CompilerService);\n}\n\n/**\n * Old way to make static components, because\n * https://github.com/emberjs/ember.js/issues/20913\n *\n * The runtime compiler doesn't allow you to catch compiler errors.\n * This particular component doesn't need to be runtime anyway.\n */\nfunction rendersElement(x: { element: Element; destroy: () => void }): ComponentLike {\n const render = resource(({ on }) => {\n on.cleanup(() => {\n x.destroy();\n });\n\n return x.element;\n });\n\n return setComponentTemplate(\n precompileTemplate(`{{render}}`, {\n strictMode: true,\n scope: () => ({ render }),\n }),\n templateOnly()\n ) as ComponentLike;\n}\n\ninterface CompilerOptions {\n hbs?: {\n scope?: Record<string, unknown>;\n };\n md?: {\n remarkPlugins?: unknown[];\n rehypePlugins?: unknown[];\n };\n gmd?: {\n scope?: Record<string, unknown>;\n remarkPlugins?: unknown[];\n rehypePlugins?: unknown[];\n };\n}\n\n/**\n * Standard for the REPL, not real apps.\n * HBS isn't used in real apps (that are fully up to date)\n */\nconst standardScope = {\n // These are only added here because it's convenient for hbs\n // to have them\n array,\n concat,\n fn,\n get,\n hash,\n on,\n // The default available scope for gjs:\n //\n // We don't use gjs transpilation here, because hbs transpilation\n // doesn't need to go through the babel infra, so it's faster this way,\n // even though it's more \"verbose\" and could get out of sync from the\n // implementations / source-of-truth.\n //\n // https://github.com/emberjs/babel-plugin-ember-template-compilation/blob/main/src/scope-locals.ts#L16\n //\n // ////////////////\n // namespaces\n // ////////////////\n // TC39\n globalThis,\n Atomics,\n JSON,\n Math,\n Reflect,\n // WHATWG\n localStorage,\n sessionStorage,\n URL,\n // ////////////////\n // functions / utilities\n // ////////////////\n // TC39\n isNaN,\n isFinite,\n parseInt,\n parseFloat,\n decodeURI,\n decodeURIComponent,\n encodeURI,\n encodeURIComponent,\n // WHATWG\n postMessage,\n structuredClone,\n // ////////////////\n // new-less Constructors (still functions)\n // ////////////////\n // TC39\n Array, // different behavior from (array)\n BigInt,\n Boolean,\n Date,\n Number,\n Object, // different behavior from (hash)\n String,\n // ////////////////\n // Values\n // ////////////////\n // TC39\n Infinity,\n NaN,\n // WHATWG\n isSecureContext,\n};\n\nexport default class CompilerService {\n #compiler: Compiler | undefined;\n\n constructor() {\n const global = getGlobal();\n\n global.REPL ||= {};\n\n if (global.REPL.compiler) {\n return global.REPL.compiler;\n }\n\n global.REPL.compiler = this;\n\n registerDestructor(this, () => {\n delete global.REPL?.compiler;\n });\n }\n\n @tracked messages: Message[] = [];\n\n get lastInfo(): InfoMessage | undefined {\n const m = this.messages;\n\n for (let i = m.length - 1; i >= 0; i--) {\n const current = m[i];\n\n if (current?.type === 'info') return current;\n }\n }\n\n get lastError(): ErrorMessage | undefined {\n const m = this.messages;\n\n for (let i = m.length - 1; i >= 0; i--) {\n const current = m[i];\n\n if (current?.type === 'error') return current;\n }\n }\n\n /**\n * @param {ModuleMap} [ extraModules ]: map of import paths to modules.\n * These modules are useful if you need to document a library or a any design system or a styleguide or\n * if there are additional modules that could be imported in the passed `code`.\n * @param {object} [options] optional compiler options for each format/flavor\n *\n * Later on, imports that are not present by default (ember/glimmer) or that\n * are not provided by extraModules will be searched on npm to see if a package\n * needs to be downloaded before running the `code` / invoking the component\n */\n setup = (extraModules: ModuleMap = {}, options: CompilerOptions = {}) => {\n const localModules = modules(extraModules);\n\n this.#compiler = new Compiler({\n logging: location.search.includes('debug'),\n resolve: {\n ...localModules,\n },\n on: {\n log: (type: Message['type'], message: string) => {\n this.messages.push({ type, message });\n // Waiting on better array primitive\n // eslint-disable-next-line no-self-assign\n this.messages = this.messages;\n },\n },\n options: {\n ...options,\n gjs: {\n // owner: getOwner(this),\n owner: {\n lookup: () => {},\n resolveRegistration: () => {},\n },\n },\n gmd: {\n ...(options.gmd ?? {}),\n scope: {\n ...standardScope,\n ...(options.gmd?.scope ?? {}),\n },\n remarkPlugins: [\n function defaultHbsToEmber() {\n return function transformer(tree: any) {\n visit(tree, 'code', (node) => {\n if (node.lang === 'hbs') {\n if (!node.meta) {\n node.meta = 'ember';\n } else {\n node.meta += ' ember';\n }\n\n return node;\n }\n });\n\n return tree;\n };\n },\n ...(options.gmd?.remarkPlugins ?? []),\n ],\n },\n hbs: {\n ember: {\n ...(options.hbs ?? {}),\n scope: {\n ...standardScope,\n ...(options.hbs?.scope ?? {}),\n },\n },\n },\n },\n });\n };\n\n get compiler(): Compiler {\n /**\n * This is useful for our own testing.\n * not sure if this would be a footgun for consumers' usage\n */\n if (!this.#compiler) {\n this.setup();\n }\n\n assert(\n `Expected a compiled to be setup on the compiler service. Use \\`compiler.setup()\\` first.`,\n this.#compiler\n );\n\n return this.#compiler;\n }\n\n async createEditor(\n element: HTMLElement,\n options: {\n text: string | null | undefined;\n format: string;\n handleUpdate: (text: string) => void;\n extensions?: unknown[];\n }\n ): Promise<{\n view: EditorView;\n setText: (text: string, format: string) => Promise<void>;\n setFormat: (format: string) => Promise<void>;\n }> {\n return this.compiler.createEditor(element, options);\n }\n\n async #compile(ext: string, text: string, options?: Record<string, unknown>) {\n /**\n * Protect from accidental backtracking-render assertions\n * (infinite loop protection)\n *\n * This function doesn't ready any tracked data, so we don't need to\n * worry about invalidation or anything.\n */\n await Promise.resolve();\n\n this.messages = [];\n\n return this.compiler.compile(ext, text, options ?? {});\n }\n\n /**\n * @public\n *\n * Defers to the underlying repl-SDK and gives us a component we can render.\n *\n * @param {string} ext the ext/format to be compiled\n * @param {string} text the code to be compiled using the configured compiler for the ext\n */\n @waitFor\n async compile(ext: string, text: string, options?: Record<string, unknown>) {\n const name = nameFor(text);\n let component: undefined | ComponentLike;\n let error: undefined | Error;\n\n try {\n if (ext === 'hbs') {\n /**\n * Are there other hbs-using frameworks?\n */\n options ||= {};\n options.flavor = 'ember';\n }\n\n const result = await this.#compile(ext, text, options);\n\n component = rendersElement(result);\n } catch (e) {\n // Put a breakpoint here to debug\n // debugger;\n console.error(e);\n error = e as Error | undefined;\n }\n\n return { name, component, error };\n }\n\n /**\n * @public\n *\n * Transpiles GlimmerJS (*.gjs) formatted text into and evaluates as a JS Module.\n * The returned component can be invoked explicitly in the consuming project.\n *\n * @param {string} code the code to be compiled\n */\n compileGJS(code: string): Promise<CompileResult> {\n return this.compile('gjs', code);\n }\n\n /**\n * compile a template with an empty scope\n * to use components, helpers, etc, you will need to compile with JS\n *\n * (templates alone do not have a way to import / define complex structures)\n */\n @waitFor\n async compileHBS(\n source: string,\n options: {\n /**\n * Used for debug viewing\n */\n moduleName?: string;\n /**\n * Additional values to include in hbs scope.\n * This is a _strict mode_ hbs component.\n */\n scope?: Record<string, unknown>;\n } = {}\n ): Promise<CompileResult> {\n return this.compile('hbs', source, options);\n }\n\n @waitFor\n compileMD(\n source: string,\n options?: {\n remarkPlugins?: unknown[];\n rehypePlugins?: unknown[];\n }\n ): Promise<CompileResult> {\n return this.compile('md', source, options);\n }\n}\n\nfunction getGlobal() {\n return globalThis as {\n REPL?: {\n compiler?: CompilerService;\n };\n };\n}\n"],"names":["getCompiler","context","owner","getOwner","assert","createStore","CompilerService","rendersElement","x","render","resource","on","cleanup","destroy","element","setComponentTemplate","precompileTemplate","strictMode","scope","templateOnly","standardScope","array","concat","fn","get","hash","globalThis","Atomics","JSON","Math","Reflect","localStorage","sessionStorage","URL","isNaN","isFinite","parseInt","parseFloat","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","postMessage","structuredClone","Array","BigInt","Boolean","Date","Number","Object","String","Infinity","NaN","isSecureContext","constructor","global","getGlobal","REPL","compiler","registerDestructor","g","prototype","tracked","i","void 0","lastInfo","m","messages","length","current","type","lastError","setup","extraModules","options","localModules","modules","Compiler","logging","location","search","includes","resolve","log","message","push","gjs","lookup","resolveRegistration","gmd","remarkPlugins","defaultHbsToEmber","transformer","tree","visit","node","lang","meta","hbs","ember","createEditor","#compile","ext","text","Promise","compile","name","nameFor","component","error","flavor","result","e","console","n","waitFor","compileGJS","code","compileHBS","source","compileMD"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAyBO,SAASA,WAAWA,CAACC,OAAe,EAAE;AAC3C,EAAA,MAAMC,KAAK,GAAGC,QAAQ,CAACF,OAAO,CAAC,IAAIA,OAAO;AAE1CG,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Y,EAA0B;AAC/C,IAAA,OAAO,IAAI,CAACZ,OAAO,CAAC,KAAK,EAAEY,IAAI,CAAC;AAClC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;EACE,MACMC,UAAUA,CACdC,MAAc,EACd7C,OAUC,GAAG,EAAE,EACkB;IACxB,OAAO,IAAI,CAAC+B,OAAO,CAAC,KAAK,EAAEc,MAAM,EAAE7C,OAAO,CAAC;AAC7C,EAAA;AAAC,EAAA;IAAAwC,CAAA,CAAA,IAAA,CAAArD,SAAA,EAAA,YAAA,EAAA,CAhBAsD,OAAO,CAAA,CAAA;AAAA;AAmBRK,EAAAA,SAASA,CACPD,MAAc,EACd7C,OAGC,EACuB;IACxB,OAAO,IAAI,CAAC+B,OAAO,CAAC,IAAI,EAAEc,MAAM,EAAE7C,OAAO,CAAC;AAC5C,EAAA;AAAC,EAAA;IAAAwC,CAAA,CAAA,IAAA,CAAArD,SAAA,EAAA,WAAA,EAAA,CATAsD,OAAO,CAAA,CAAA;AAAA;AAUV;AAEA,SAAS3D,SAASA,GAAG;AACnB,EAAA,OAAO9B,UAAU;AAKnB;;;;"}
1
+ {"version":3,"file":"compiler.js","sources":["../../src/services/compiler.ts"],"sourcesContent":["/* eslint-disable getter-return */\n \n// @ts-ignore\nimport { tracked } from '@glimmer/tracking';\nimport { setComponentTemplate } from '@ember/component';\nimport templateOnly from '@ember/component/template-only';\nimport { assert } from '@ember/debug';\nimport { registerDestructor } from '@ember/destroyable';\nimport { array, concat, fn, get, hash } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport { getOwner } from '@ember/owner';\nimport { precompileTemplate } from '@ember/template-compilation';\nimport { waitFor } from '@ember/test-waiters';\n\nimport { createStore } from 'ember-primitives/store';\nimport { resource } from 'ember-resources';\nimport { Compiler } from 'repl-sdk';\nimport { visit } from 'unist-util-visit';\n\nimport { nameFor } from '../compile/utils.ts';\nimport { modules } from './known-modules.ts';\n\nimport type { CompileResult, ModuleMap } from '../compile/types.ts';\nimport type { ComponentLike } from '@glint/template';\nimport type { EditorView } from 'codemirror';\nimport type { ErrorMessage, InfoMessage, Message } from 'repl-sdk';\n\nexport function getCompiler(context: object) {\n const owner = getOwner(context) ?? context;\n\n assert(`Missing owner. Cannot use ember-repl's compiler without an owner.`, owner);\n\n return createStore(owner, CompilerService);\n}\n\n/**\n * Old way to make static components, because\n * https://github.com/emberjs/ember.js/issues/20913\n *\n * The runtime compiler doesn't allow you to catch compiler errors.\n * This particular component doesn't need to be runtime anyway.\n */\nfunction rendersElement(x: { element: Element; destroy: () => void }): ComponentLike {\n const render = resource(({ on }) => {\n on.cleanup(() => {\n x.destroy();\n });\n\n return x.element;\n });\n\n return setComponentTemplate(\n precompileTemplate(`{{render}}`, {\n strictMode: true,\n scope: () => ({ render }),\n }),\n templateOnly()\n ) as ComponentLike;\n}\n\ninterface CompilerOptions {\n hbs?: {\n scope?: Record<string, unknown>;\n };\n md?: {\n remarkPlugins?: unknown[];\n rehypePlugins?: unknown[];\n };\n gmd?: {\n scope?: Record<string, unknown>;\n remarkPlugins?: unknown[];\n rehypePlugins?: unknown[];\n };\n}\n\n/**\n * Standard for the REPL, not real apps.\n * HBS isn't used in real apps (that are fully up to date)\n */\nconst standardScope = {\n // These are only added here because it's convenient for hbs\n // to have them\n array,\n concat,\n fn,\n get,\n hash,\n on,\n // The default available scope for gjs:\n //\n // We don't use gjs transpilation here, because hbs transpilation\n // doesn't need to go through the babel infra, so it's faster this way,\n // even though it's more \"verbose\" and could get out of sync from the\n // implementations / source-of-truth.\n //\n // https://github.com/emberjs/babel-plugin-ember-template-compilation/blob/main/src/scope-locals.ts#L16\n //\n // ////////////////\n // namespaces\n // ////////////////\n // TC39\n globalThis,\n Atomics,\n JSON,\n Math,\n Reflect,\n // WHATWG\n localStorage,\n sessionStorage,\n URL,\n // ////////////////\n // functions / utilities\n // ////////////////\n // TC39\n isNaN,\n isFinite,\n parseInt,\n parseFloat,\n decodeURI,\n decodeURIComponent,\n encodeURI,\n encodeURIComponent,\n // WHATWG\n postMessage,\n structuredClone,\n // ////////////////\n // new-less Constructors (still functions)\n // ////////////////\n // TC39\n Array, // different behavior from (array)\n BigInt,\n Boolean,\n Date,\n Number,\n Object, // different behavior from (hash)\n String,\n // ////////////////\n // Values\n // ////////////////\n // TC39\n Infinity,\n NaN,\n // WHATWG\n isSecureContext,\n};\n\nexport default class CompilerService {\n #compiler: Compiler | undefined;\n\n constructor() {\n const global = getGlobal();\n\n global.REPL ||= {};\n\n if (global.REPL.compiler) {\n return global.REPL.compiler;\n }\n\n global.REPL.compiler = this;\n\n registerDestructor(this, () => {\n delete global.REPL?.compiler;\n });\n }\n\n @tracked messages: Message[] = [];\n\n get lastInfo(): InfoMessage | undefined {\n const m = this.messages;\n\n for (let i = m.length - 1; i >= 0; i--) {\n const current = m[i];\n\n if (current?.type === 'info') return current;\n }\n }\n\n get lastError(): ErrorMessage | undefined {\n const m = this.messages;\n\n for (let i = m.length - 1; i >= 0; i--) {\n const current = m[i];\n\n if (current?.type === 'error') return current;\n }\n }\n\n /**\n * @param {ModuleMap} [ extraModules ]: map of import paths to modules.\n * These modules are useful if you need to document a library or a any design system or a styleguide or\n * if there are additional modules that could be imported in the passed `code`.\n * @param {object} [options] optional compiler options for each format/flavor\n *\n * Later on, imports that are not present by default (ember/glimmer) or that\n * are not provided by extraModules will be searched on npm to see if a package\n * needs to be downloaded before running the `code` / invoking the component\n */\n setup = (extraModules: ModuleMap = {}, options: CompilerOptions = {}) => {\n const localModules = modules(extraModules);\n\n this.#compiler = new Compiler({\n logging: location.search.includes('debug'),\n resolve: {\n ...localModules,\n },\n on: {\n log: (type: Message['type'], message: string) => {\n this.messages.push({ type, message });\n // Waiting on better array primitive\n // eslint-disable-next-line no-self-assign\n this.messages = this.messages;\n },\n },\n options: {\n ...options,\n gjs: {\n // owner: getOwner(this),\n owner: {\n lookup: () => {},\n resolveRegistration: () => {},\n },\n },\n gmd: {\n ...(options.gmd ?? {}),\n scope: {\n ...standardScope,\n ...(options.gmd?.scope ?? {}),\n },\n remarkPlugins: [\n function defaultHbsToEmber() {\n return function transformer(tree: any) {\n visit(tree, 'code', (node) => {\n if (node.lang === 'hbs') {\n if (!node.meta) {\n node.meta = 'ember';\n } else {\n node.meta += ' ember';\n }\n\n return node;\n }\n });\n\n return tree;\n };\n },\n ...(options.gmd?.remarkPlugins ?? []),\n ],\n },\n hbs: {\n ember: {\n ...(options.hbs ?? {}),\n scope: {\n ...standardScope,\n ...(options.hbs?.scope ?? {}),\n },\n },\n },\n },\n });\n };\n\n get compiler(): Compiler {\n /**\n * This is useful for our own testing.\n * not sure if this would be a footgun for consumers' usage\n */\n if (!this.#compiler) {\n this.setup();\n }\n\n assert(\n `Expected a compiled to be setup on the compiler service. Use \\`compiler.setup()\\` first.`,\n this.#compiler\n );\n\n return this.#compiler;\n }\n\n async createEditor(\n element: HTMLElement,\n options: {\n text: string | null | undefined;\n format: string;\n handleUpdate: (text: string) => void;\n extensions?: unknown[];\n }\n ): Promise<{\n view: EditorView;\n setText: (text: string, format: string) => Promise<void>;\n setFormat: (format: string) => Promise<void>;\n }> {\n return this.compiler.createEditor(element, options);\n }\n\n async #compile(ext: string, text: string, options?: Record<string, unknown>) {\n /**\n * Protect from accidental backtracking-render assertions\n * (infinite loop protection)\n *\n * This function doesn't ready any tracked data, so we don't need to\n * worry about invalidation or anything.\n */\n await Promise.resolve();\n\n this.messages = [];\n\n return this.compiler.compile(ext, text, options ?? {});\n }\n\n /**\n * @public\n *\n * Defers to the underlying repl-SDK and gives us a component we can render.\n *\n * @param {string} ext the ext/format to be compiled\n * @param {string} text the code to be compiled using the configured compiler for the ext\n */\n @waitFor\n async compile(ext: string, text: string, options?: Record<string, unknown>) {\n const name = nameFor(text);\n let component: undefined | ComponentLike;\n let error: undefined | Error;\n\n try {\n if (ext === 'hbs') {\n /**\n * Are there other hbs-using frameworks?\n */\n options ||= {};\n options.flavor = 'ember';\n }\n\n const result = await this.#compile(ext, text, options);\n\n component = rendersElement(result);\n } catch (e) {\n // Put a breakpoint here to debug\n // debugger;\n console.error(e);\n error = e as Error | undefined;\n }\n\n return { name, component, error };\n }\n\n /**\n * @public\n *\n * Transpiles GlimmerJS (*.gjs) formatted text into and evaluates as a JS Module.\n * The returned component can be invoked explicitly in the consuming project.\n *\n * @param {string} code the code to be compiled\n */\n compileGJS(code: string): Promise<CompileResult> {\n return this.compile('gjs', code);\n }\n\n /**\n * compile a template with an empty scope\n * to use components, helpers, etc, you will need to compile with JS\n *\n * (templates alone do not have a way to import / define complex structures)\n */\n @waitFor\n async compileHBS(\n source: string,\n options: {\n /**\n * Used for debug viewing\n */\n moduleName?: string;\n /**\n * Additional values to include in hbs scope.\n * This is a _strict mode_ hbs component.\n */\n scope?: Record<string, unknown>;\n } = {}\n ): Promise<CompileResult> {\n return this.compile('hbs', source, options);\n }\n\n @waitFor\n compileMD(\n source: string,\n options?: {\n remarkPlugins?: unknown[];\n rehypePlugins?: unknown[];\n }\n ): Promise<CompileResult> {\n return this.compile('md', source, options);\n }\n}\n\nfunction getGlobal() {\n return globalThis as {\n REPL?: {\n compiler?: CompilerService;\n };\n };\n}\n"],"names":["getCompiler","context","owner","getOwner","assert","createStore","CompilerService","rendersElement","x","render","resource","on","cleanup","destroy","element","setComponentTemplate","precompileTemplate","strictMode","scope","templateOnly","standardScope","array","concat","fn","get","hash","globalThis","Atomics","JSON","Math","Reflect","localStorage","sessionStorage","URL","isNaN","isFinite","parseInt","parseFloat","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","postMessage","structuredClone","Array","BigInt","Boolean","Date","Number","Object","String","Infinity","NaN","isSecureContext","constructor","global","getGlobal","REPL","compiler","registerDestructor","g","prototype","tracked","i","lastInfo","m","messages","length","current","type","lastError","setup","extraModules","options","localModules","modules","Compiler","logging","location","search","includes","resolve","log","message","push","gjs","lookup","resolveRegistration","gmd","remarkPlugins","defaultHbsToEmber","transformer","tree","visit","node","lang","meta","hbs","ember","createEditor","#compile","ext","text","Promise","compile","name","nameFor","component","error","flavor","result","e","console","n","waitFor","compileGJS","code","compileHBS","source","compileMD"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AA2BO,SAASA,WAAWA,CAACC,OAAe,EAAE;AAC3C,EAAA,MAAMC,KAAK,GAAGC,QAAQ,CAACF,OAAO,CAAC,IAAIA,OAAO;AAE1CG,EAAAA,MAAM,CAAC,CAAA,iEAAA,CAAmE,EAAEF,KAAK,CAAC;AAElF,EAAA,OAAOG,WAAW,CAACH,KAAK,EAAEI,eAAe,CAAC;AAC5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,cAAcA,CAACC,CAA4C,EAAiB;AACnF,EAAA,MAAMC,MAAM,GAAGC,QAAQ,CAAC,CAAC;AAAEC,IAAAA;AAAG,GAAC,KAAK;IAClCA,EAAE,CAACC,OAAO,CAAC,MAAM;MACfJ,CAAC,CAACK,OAAO,EAAE;AACb,IAAA,CAAC,CAAC;IAEF,OAAOL,CAAC,CAACM,OAAO;AAClB,EAAA,CAAC,CAAC;AAEF,EAAA,OAAOC,oBAAoB,CACzBC,kBAAkB,CAAC,YAAY,EAAE;AAC/BC,IAAAA,UAAU,EAAE,IAAI;IAChBC,KAAK,EAAEA,OAAO;AAAET,MAAAA;KAAQ;AAC1B,GAAC,CAAC,EACFU,YAAY,EACd,CAAC;AACH;AAiBA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAG;AACpB;AACA;EACAC,KAAK;EACLC,MAAM;EACNC,EAAE;EACFC,GAAG;EACHC,IAAI;EACJd,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACAe,UAAU;EACVC,OAAO;EACPC,IAAI;EACJC,IAAI;EACJC,OAAO;AACP;EACAC,YAAY;EACZC,cAAc;EACdC,GAAG;AACH;AACA;AACA;AACA;EACAC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,UAAU;EACVC,SAAS;EACTC,kBAAkB;EAClBC,SAAS;EACTC,kBAAk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MAAAA;KAAO;AACnC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AAPE,EAAA;IAAAK,CAAA,CAAA,IAAA,CAAApD,SAAA,EAAA,SAAA,EAAA,CA5BCqD,OAAO,CAAA,CAAA;AAAA;EAoCRC,UAAUA,CAACC,IAAY,EAA0B;AAC/C,IAAA,OAAO,IAAI,CAACZ,OAAO,CAAC,KAAK,EAAEY,IAAI,CAAC;AAClC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;EACE,MACMC,UAAUA,CACdC,MAAc,EACd7C,OAUC,GAAG,EAAE,EACkB;IACxB,OAAO,IAAI,CAAC+B,OAAO,CAAC,KAAK,EAAEc,MAAM,EAAE7C,OAAO,CAAC;AAC7C,EAAA;AAAC,EAAA;IAAAwC,CAAA,CAAA,IAAA,CAAApD,SAAA,EAAA,YAAA,EAAA,CAhBAqD,OAAO,CAAA,CAAA;AAAA;AAmBRK,EAAAA,SAASA,CACPD,MAAc,EACd7C,OAGC,EACuB;IACxB,OAAO,IAAI,CAAC+B,OAAO,CAAC,IAAI,EAAEc,MAAM,EAAE7C,OAAO,CAAC;AAC5C,EAAA;AAAC,EAAA;IAAAwC,CAAA,CAAA,IAAA,CAAApD,SAAA,EAAA,WAAA,EAAA,CATAqD,OAAO,CAAA,CAAA;AAAA;AAUV;AAEA,SAAS1D,SAASA,GAAG;AACnB,EAAA,OAAO9B,UAAU;AAKnB;;;;"}
@@ -10,6 +10,7 @@ const frameworkModules = {
10
10
  '@ember/helper': () => import('@ember/helper'),
11
11
  '@ember/modifier': () => import('@ember/modifier'),
12
12
  '@ember/object': () => import('@ember/object'),
13
+ '@ember/object/observers': () => import('@ember/object/observers'),
13
14
  '@ember/owner': () => import('@ember/owner'),
14
15
  '@ember/reactive': () => import('@ember/reactive'),
15
16
  '@ember/reactive/collections': () => import('@ember/reactive/collections'),
@@ -41,24 +42,21 @@ const emberCompilationModules = {
41
42
  '@ember/template-compiler/runtime': () => import('@ember/template-compiler/runtime'),
42
43
  '@ember/template-compiler': () => import('@ember/template-compiler/runtime'),
43
44
  'ember-source/dist/ember-template-compiler': () => import(
44
- // eslint-disable-next-line
45
45
  // @ts-ignore
46
46
  'ember-source/dist/ember-template-compiler.js'),
47
47
  'ember-source/dist/ember-template-compiler.js': () => import(
48
- // eslint-disable-next-line
49
48
  // @ts-ignore
50
49
  'ember-source/dist/ember-template-compiler.js'),
51
50
  // Direct Dependencies
52
- '@babel/standalone': () => import('../babel-8wMrbxkT.js').then(function (n) { return n.b; }),
51
+ '@babel/standalone': () => import('../babel-DbH-RlNa.js').then(function (n) { return n.b; }),
53
52
  'content-tag': () => import('content-tag'),
54
53
  'decorator-transforms': () => import('decorator-transforms'),
55
54
  'decorator-transforms/runtime': () => import('decorator-transforms/runtime'),
56
55
  'babel-plugin-ember-template-compilation': () => import('babel-plugin-ember-template-compilation'),
57
56
  // Dependencies of the above
58
57
  'babel-import-util': () => import('../index-BTx1k6gT.js').then(function (n) { return n.i; }),
59
- // eslint-disable-next-line
60
58
  // @ts-ignore
61
- 'babel-plugin-debug-macros': () => import('../index-DxolpiGq.js').then(function (n) { return n.i; }),
59
+ 'babel-plugin-debug-macros': () => import('../index-F3Sr0JFE.js').then(function (n) { return n.i; }),
62
60
  '@embroider/macros': () => ({
63
61
  // passthrough, we are not doing dead-code-elimination
64
62
  macroCondition: x => x,
@@ -91,20 +89,20 @@ const emberCompilationModules = {
91
89
  }
92
90
  }),
93
91
  // Private
94
- // eslint-disable-next-line
92
+
95
93
  // @ts-ignore
96
94
  importSync: x => window[Symbol.for('__repl-sdk__compiler__')].resolves[x],
97
95
  moduleExists: () => false
98
96
  })
99
97
  };
100
98
  const markdownCompilationModules = {
101
- 'rehype-raw': () => import('../index-DejgrVqh.js'),
99
+ 'rehype-raw': () => import('../index-C-twRw93.js'),
102
100
  'rehype-stringify': () => import('../index-C371bO_b.js'),
103
- 'remark-gfm': () => import('../index-C4AyeeIa.js'),
101
+ 'remark-gfm': () => import('../index-Bm1Y84Cu.js'),
104
102
  'remark-parse': () => import('../index-CDSIcg03.js'),
105
- 'remark-rehype': () => import('../index-C8S2G0FH.js'),
106
- unified: () => import('../index-DBBNT106.js'),
107
- 'unist-util-visit': () => import('../index-D8szzCn3.js')
103
+ 'remark-rehype': () => import('../index-CGDqu098.js'),
104
+ unified: () => import('../index-DMSCybEq.js'),
105
+ 'unist-util-visit': () => import('../index-DIRpUv6Z.js')
108
106
  };
109
107
 
110
108
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"known-modules.js","sources":["../../src/services/known-modules.ts"],"sourcesContent":["import type { ModuleMap } from '../compile/types.ts';\n\nconst frameworkModules = {\n '@ember/application': () => import('@ember/application'),\n '@ember/application/instance': () => import('@ember/application/instance'),\n '@ember/array': () => import('@ember/array'),\n '@ember/component': () => import('@ember/component'),\n '@ember/component/helper': () => import('@ember/component/helper'),\n '@ember/component/template-only': () => import('@ember/component/template-only'),\n '@ember/debug': () => import('@ember/debug'),\n '@ember/destroyable': () => import('@ember/destroyable'),\n '@ember/helper': () => import('@ember/helper'),\n '@ember/modifier': () => import('@ember/modifier'),\n '@ember/object': () => import('@ember/object'),\n '@ember/owner': () => import('@ember/owner'),\n '@ember/reactive': () => import('@ember/reactive'),\n '@ember/reactive/collections': () => import('@ember/reactive/collections'),\n '@ember/renderer': () => import('@ember/renderer'),\n '@ember/routing': () => import('@ember/routing'),\n '@ember/routing/route': () => import('@ember/routing/route'),\n '@ember/routing/router': () => import('@ember/routing/router'),\n '@ember/runloop': () => import('@ember/runloop'),\n '@ember/service': () => import('@ember/service'),\n '@ember/template': () => import('@ember/template'),\n '@ember/template-compilation': () => import('@ember/template-compilation'),\n '@ember/template-factory': () => import('@ember/template-factory'),\n '@ember/test-helpers': () => import('@ember/test-helpers'),\n '@ember/test-waiters': () => import('@ember/test-waiters'),\n '@ember/test': () => import('@ember/test'),\n '@ember/utils': () => import('@ember/utils'),\n '@ember/version': () => import('@ember/version'),\n '@glimmer/component': () => import('@glimmer/component'),\n '@glimmer/tracking': () => import('@glimmer/tracking'),\n '@glimmer/tracking/primitives/cache': () => import('@glimmer/tracking/primitives/cache'),\n};\n\nconst coreLibraries = {\n 'ember-resolver': () => import('ember-resolver'),\n 'ember-resources': () => import('ember-resources'),\n 'ember-primitives': () => import('ember-primitives'),\n 'repl-sdk': () => import('repl-sdk'),\n};\n\nconst emberCompilationModules = {\n '@ember/template-compiler/runtime': () => import('@ember/template-compiler/runtime'),\n '@ember/template-compiler': () => import('@ember/template-compiler/runtime'),\n 'ember-source/dist/ember-template-compiler': () =>\n import(\n // eslint-disable-next-line\n // @ts-ignore\n 'ember-source/dist/ember-template-compiler.js'\n ),\n 'ember-source/dist/ember-template-compiler.js': () =>\n import(\n // eslint-disable-next-line\n // @ts-ignore\n 'ember-source/dist/ember-template-compiler.js'\n ),\n // Direct Dependencies\n '@babel/standalone': () => import('@babel/standalone'),\n 'content-tag': () => import('content-tag'),\n 'decorator-transforms': () => import('decorator-transforms'),\n 'decorator-transforms/runtime': () => import('decorator-transforms/runtime'),\n 'babel-plugin-ember-template-compilation': () =>\n import('babel-plugin-ember-template-compilation'),\n // Dependencies of the above\n 'babel-import-util': () => import('babel-import-util'),\n // eslint-disable-next-line\n // @ts-ignore\n 'babel-plugin-debug-macros': () => import('babel-plugin-debug-macros'),\n '@embroider/macros': () => ({\n // passthrough, we are not doing dead-code-elimination\n macroCondition: (x: boolean) => x,\n // I *could* actually implement this\n dependencySatisfies: () => true,\n isDevelopingApp: () => true,\n // Trying to use warp-drive in a REPL environment may be impossible, since they\n // encourage choosing your own adventure without a buildless recommended path.\n // The use of nested configs (specifically env) is also problematic for\n // \"falling back to false\" as what all other macros-using libraries use.\n // (many of us have seen \"Cannot access DEBUG on undefined\" in build errors)\n // Even with this config, I have not successfully been able to use warp-drive\n // in any of my REPL-based projects.\n //\n // (Its also perfectly fine for warp-drive to decide they don't care about the same things I do)\n getGlobalConfig: () => ({\n WarpDrive: {\n debug: false,\n env: {\n DEBUG: false,\n TESTING: false,\n PRODUCTION: true,\n },\n activeLogging: false,\n compatWith: '99.0',\n features: {},\n deprecations: {},\n polyfillUUID: false,\n includeDataAdapter: false,\n },\n }),\n // Private\n // eslint-disable-next-line\n // @ts-ignore\n importSync: (x: string) => window[Symbol.for('__repl-sdk__compiler__')].resolves[x],\n moduleExists: () => false,\n }),\n};\n\nconst markdownCompilationModules = {\n 'rehype-raw': () => import('rehype-raw'),\n 'rehype-stringify': () => import('rehype-stringify'),\n 'remark-gfm': () => import('remark-gfm'),\n 'remark-parse': () => import('remark-parse'),\n 'remark-rehype': () => import('remark-rehype'),\n unified: () => import('unified'),\n 'unist-util-visit': () => import('unist-util-visit'),\n};\n\n/**\n * If any real packages are defined here, they would fallback to fetching from NPM\n * instead of loading from this pre-made bundle.\n */\nexport const modules = (extraModules: ModuleMap): ModuleMap => ({\n ...coreLibraries,\n ...frameworkModules,\n ...extraModules,\n ...emberCompilationModules,\n ...markdownCompilationModules,\n});\n"],"names":["frameworkModules","@ember/application","@ember/application/instance","@ember/array","@ember/component","@ember/component/helper","@ember/component/template-only","@ember/debug","@ember/destroyable","@ember/helper","@ember/modifier","@ember/object","@ember/owner","@ember/reactive","@ember/reactive/collections","@ember/renderer","@ember/routing","@ember/routing/route","@ember/routing/router","@ember/runloop","@ember/service","@ember/template","@ember/template-compilation","@ember/template-factory","@ember/test-helpers","@ember/test-waiters","@ember/test","@ember/utils","@ember/version","@glimmer/component","@glimmer/tracking","@glimmer/tracking/primitives/cache","coreLibraries","ember-resolver","ember-resources","ember-primitives","repl-sdk","emberCompilationModules","@ember/template-compiler/runtime","@ember/template-compiler","ember-source/dist/ember-template-compiler","ember-source/dist/ember-template-compiler.js","@babel/standalone","content-tag","decorator-transforms","decorator-transforms/runtime","babel-plugin-ember-template-compilation","babel-import-util","babel-plugin-debug-macros","@embroider/macros","macroCondition","x","dependencySatisfies","isDevelopingApp","getGlobalConfig","WarpDrive","debug","env","DEBUG","TESTING","PRODUCTION","activeLogging","compatWith","features","deprecations","polyfillUUID","includeDataAdapter","importSync","window","Symbol","for","resolves","moduleExists","markdownCompilationModules","rehype-raw","rehype-stringify","remark-gfm","remark-parse","remark-rehype","unified","unist-util-visit","modules","extraModules"],"mappings":"AAEA,MAAMA,gBAAgB,GAAG;AACvB,EAAA,oBAAoB,EAAEC,MAAM,OAAO,oBAAoB,CAAC;AACxD,EAAA,6BAA6B,EAAEC,MAAM,OAAO,6BAA6B,CAAC;AAC1E,EAAA,cAAc,EAAEC,MAAM,OAAO,cAAc,CAAC;AAC5C,EAAA,kBAAkB,EAAEC,MAAM,OAAO,kBAAkB,CAAC;AACpD,EAAA,yBAAyB,EAAEC,MAAM,OAAO,yBAAyB,CAAC;AAClE,EAAA,gCAAgC,EAAEC,MAAM,OAAO,gCAAgC,CAAC;AAChF,EAAA,cAAc,EAAEC,MAAM,OAAO,cAAc,CAAC;AAC5C,EAAA,oBAAoB,EAAEC,MAAM,OAAO,oBAAoB,CAAC;AACxD,EAAA,eAAe,EAAEC,MAAM,OAAO,eAAe,CAAC;AAC9C,EAAA,iBAAiB,EAAEC,MAAM,OAAO,iBAAiB,CAAC;AAClD,EAAA,eAAe,EAAEC,MAAM,OAAO,eAAe,CAAC;AAC9C,EAAA,cAAc,EAAEC,MAAM,OAAO,cAAc,CAAC;AAC5C,EAAA,iBAAiB,EAAEC,MAAM,OAAO,iBAAiB,CAAC;AAClD,EAAA,6BAA6B,EAAEC,MAAM,OAAO,6BAA6B,CAAC;AAC1E,EAAA,iBAAiB,EAAEC,MAAM,OAAO,iBAAiB,CAAC;AAClD,EAAA,gBAAgB,EAAEC,MAAM,OAAO,gBAAgB,CAAC;AAChD,EAAA,sBAAsB,EAAEC,MAAM,OAAO,sBAAsB,CAAC;AAC5D,EAAA,uBAAuB,EAAEC,MAAM,OAAO,uBAAuB,CAAC;AAC9D,EAAA,gBAAgB,EAAEC,MAAM,OAAO,gBAAgB,CAAC;AAChD,EAAA,gBAAgB,EAAEC,MAAM,OAAO,gBAAgB,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AC;AACxC,EAAA,cAAc,EAAEC,MAAM,OAAO,sBAAc,CAAC;AAC5C,EAAA,eAAe,EAAEC,MAAM,OAAO,sBAAe,CAAC;AAC9CC,EAAAA,OAAO,EAAEA,MAAM,OAAO,sBAAS,CAAC;AAChC,EAAA,kBAAkB,EAAEC,MAAM,OAAO,sBAAkB;AACrD,CAAC;;AAED;AACA;AACA;AACA;AACO,MAAMC,OAAO,GAAIC,YAAuB,KAAiB;AAC9D,EAAA,GAAGlD,aAAa;AAChB,EAAA,GAAGhC,gBAAgB;AACnB,EAAA,GAAGkF,YAAY;AACf,EAAA,GAAG7C,uBAAuB;EAC1B,GAAGoC;AACL,CAAC;;;;"}
1
+ {"version":3,"file":"known-modules.js","sources":["../../src/services/known-modules.ts"],"sourcesContent":["import type { ModuleMap } from '../compile/types.ts';\n\nconst frameworkModules = {\n '@ember/application': () => import('@ember/application'),\n '@ember/application/instance': () => import('@ember/application/instance'),\n '@ember/array': () => import('@ember/array'),\n '@ember/component': () => import('@ember/component'),\n '@ember/component/helper': () => import('@ember/component/helper'),\n '@ember/component/template-only': () => import('@ember/component/template-only'),\n '@ember/debug': () => import('@ember/debug'),\n '@ember/destroyable': () => import('@ember/destroyable'),\n '@ember/helper': () => import('@ember/helper'),\n '@ember/modifier': () => import('@ember/modifier'),\n '@ember/object': () => import('@ember/object'),\n '@ember/object/observers': () => import('@ember/object/observers'),\n '@ember/owner': () => import('@ember/owner'),\n '@ember/reactive': () => import('@ember/reactive'),\n '@ember/reactive/collections': () => import('@ember/reactive/collections'),\n '@ember/renderer': () => import('@ember/renderer'),\n '@ember/routing': () => import('@ember/routing'),\n '@ember/routing/route': () => import('@ember/routing/route'),\n '@ember/routing/router': () => import('@ember/routing/router'),\n '@ember/runloop': () => import('@ember/runloop'),\n '@ember/service': () => import('@ember/service'),\n '@ember/template': () => import('@ember/template'),\n '@ember/template-compilation': () => import('@ember/template-compilation'),\n '@ember/template-factory': () => import('@ember/template-factory'),\n '@ember/test-helpers': () => import('@ember/test-helpers'),\n '@ember/test-waiters': () => import('@ember/test-waiters'),\n '@ember/test': () => import('@ember/test'),\n '@ember/utils': () => import('@ember/utils'),\n '@ember/version': () => import('@ember/version'),\n '@glimmer/component': () => import('@glimmer/component'),\n '@glimmer/tracking': () => import('@glimmer/tracking'),\n '@glimmer/tracking/primitives/cache': () => import('@glimmer/tracking/primitives/cache'),\n};\n\nconst coreLibraries = {\n 'ember-resolver': () => import('ember-resolver'),\n 'ember-resources': () => import('ember-resources'),\n 'ember-primitives': () => import('ember-primitives'),\n 'repl-sdk': () => import('repl-sdk'),\n};\n\nconst emberCompilationModules = {\n '@ember/template-compiler/runtime': () => import('@ember/template-compiler/runtime'),\n '@ember/template-compiler': () => import('@ember/template-compiler/runtime'),\n 'ember-source/dist/ember-template-compiler': () =>\n import(\n \n // @ts-ignore\n 'ember-source/dist/ember-template-compiler.js'\n ),\n 'ember-source/dist/ember-template-compiler.js': () =>\n import(\n \n // @ts-ignore\n 'ember-source/dist/ember-template-compiler.js'\n ),\n // Direct Dependencies\n '@babel/standalone': () => import('@babel/standalone'),\n 'content-tag': () => import('content-tag'),\n 'decorator-transforms': () => import('decorator-transforms'),\n 'decorator-transforms/runtime': () => import('decorator-transforms/runtime'),\n 'babel-plugin-ember-template-compilation': () =>\n import('babel-plugin-ember-template-compilation'),\n // Dependencies of the above\n 'babel-import-util': () => import('babel-import-util'),\n \n // @ts-ignore\n 'babel-plugin-debug-macros': () => import('babel-plugin-debug-macros'),\n '@embroider/macros': () => ({\n // passthrough, we are not doing dead-code-elimination\n macroCondition: (x: boolean) => x,\n // I *could* actually implement this\n dependencySatisfies: () => true,\n isDevelopingApp: () => true,\n // Trying to use warp-drive in a REPL environment may be impossible, since they\n // encourage choosing your own adventure without a buildless recommended path.\n // The use of nested configs (specifically env) is also problematic for\n // \"falling back to false\" as what all other macros-using libraries use.\n // (many of us have seen \"Cannot access DEBUG on undefined\" in build errors)\n // Even with this config, I have not successfully been able to use warp-drive\n // in any of my REPL-based projects.\n //\n // (Its also perfectly fine for warp-drive to decide they don't care about the same things I do)\n getGlobalConfig: () => ({\n WarpDrive: {\n debug: false,\n env: {\n DEBUG: false,\n TESTING: false,\n PRODUCTION: true,\n },\n activeLogging: false,\n compatWith: '99.0',\n features: {},\n deprecations: {},\n polyfillUUID: false,\n includeDataAdapter: false,\n },\n }),\n // Private\n \n // @ts-ignore\n importSync: (x: string) => window[Symbol.for('__repl-sdk__compiler__')].resolves[x],\n moduleExists: () => false,\n }),\n};\n\nconst markdownCompilationModules = {\n 'rehype-raw': () => import('rehype-raw'),\n 'rehype-stringify': () => import('rehype-stringify'),\n 'remark-gfm': () => import('remark-gfm'),\n 'remark-parse': () => import('remark-parse'),\n 'remark-rehype': () => import('remark-rehype'),\n unified: () => import('unified'),\n 'unist-util-visit': () => import('unist-util-visit'),\n};\n\n/**\n * If any real packages are defined here, they would fallback to fetching from NPM\n * instead of loading from this pre-made bundle.\n */\nexport const modules = (extraModules: ModuleMap): ModuleMap => ({\n ...coreLibraries,\n ...frameworkModules,\n ...extraModules,\n ...emberCompilationModules,\n ...markdownCompilationModules,\n});\n"],"names":["frameworkModules","@ember/application","@ember/application/instance","@ember/array","@ember/component","@ember/component/helper","@ember/component/template-only","@ember/debug","@ember/destroyable","@ember/helper","@ember/modifier","@ember/object","@ember/object/observers","@ember/owner","@ember/reactive","@ember/reactive/collections","@ember/renderer","@ember/routing","@ember/routing/route","@ember/routing/router","@ember/runloop","@ember/service","@ember/template","@ember/template-compilation","@ember/template-factory","@ember/test-helpers","@ember/test-waiters","@ember/test","@ember/utils","@ember/version","@glimmer/component","@glimmer/tracking","@glimmer/tracking/primitives/cache","coreLibraries","ember-resolver","ember-resources","ember-primitives","repl-sdk","emberCompilationModules","@ember/template-compiler/runtime","@ember/template-compiler","ember-source/dist/ember-template-compiler","ember-source/dist/ember-template-compiler.js","@babel/standalone","content-tag","decorator-transforms","decorator-transforms/runtime","babel-plugin-ember-template-compilation","babel-import-util","babel-plugin-debug-macros","@embroider/macros","macroCondition","x","dependencySatisfies","isDevelopingApp","getGlobalConfig","WarpDrive","debug","env","DEBUG","TESTING","PRODUCTION","activeLogging","compatWith","features","deprecations","polyfillUUID","includeDataAdapter","importSync","window","Symbol","for","resolves","moduleExists","markdownCompilationModules","rehype-raw","rehype-stringify","remark-gfm","remark-parse","remark-rehype","unified","unist-util-visit","modules","extraModules"],"mappings":"AAEA,MAAMA,gBAAgB,GAAG;AACvB,EAAA,oBAAoB,EAAEC,MAAM,OAAO,oBAAoB,CAAC;AACxD,EAAA,6BAA6B,EAAEC,MAAM,OAAO,6BAA6B,CAAC;AAC1E,EAAA,cAAc,EAAEC,MAAM,OAAO,cAAc,CAAC;AAC5C,EAAA,kBAAkB,EAAEC,MAAM,OAAO,kBAAkB,CAAC;AACpD,EAAA,yBAAyB,EAAEC,MAAM,OAAO,yBAAyB,CAAC;AAClE,EAAA,gCAAgC,EAAEC,MAAM,OAAO,gCAAgC,CAAC;AAChF,EAAA,cAAc,EAAEC,MAAM,OAAO,cAAc,CAAC;AAC5C,EAAA,oBAAoB,EAAEC,MAAM,OAAO,oBAAoB,CAAC;AACxD,EAAA,eAAe,EAAEC,MAAM,OAAO,eAAe,CAAC;AAC9C,EAAA,iBAAiB,EAAEC,MAAM,OAAO,iBAAiB,CAAC;AAClD,EAAA,eAAe,EAAEC,MAAM,OAAO,eAAe,CAAC;AAC9C,EAAA,yBAAyB,EAAEC,MAAM,OAAO,yBAAyB,CAAC;AAClE,EAAA,cAAc,EAAEC,MAAM,OAAO,cAAc,CAAC;AAC5C,EAAA,iBAAiB,EAAEC,MAAM,OAAO,iBAAiB,CAAC;AAClD,EAAA,6BAA6B,EAAEC,MAAM,OAAO,6BAA6B,CAAC;AAC1E,EAAA,iBAAiB,EAAEC,MAAM,OAAO,iBAAiB,CAAC;AAClD,EAAA,gBAAgB,EAAEC,MAAM,OAAO,gBAAgB,CAAC;AAChD,EAAA,sBAAsB,EAAEC,MAAM,OAAO,sBAAsB,CA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jC,EAAA,YAAY,EAAEC,MAAM,OAAO,sBAAY,CAAC;AACxC,EAAA,kBAAkB,EAAEC,MAAM,OAAO,sBAAkB,CAAC;AACpD,EAAA,YAAY,EAAEC,MAAM,OAAO,sBAAY,CAAC;AACxC,EAAA,cAAc,EAAEC,MAAM,OAAO,sBAAc,CAAC;AAC5C,EAAA,eAAe,EAAEC,MAAM,OAAO,sBAAe,CAAC;AAC9CC,EAAAA,OAAO,EAAEA,MAAM,OAAO,sBAAS,CAAC;AAChC,EAAA,kBAAkB,EAAEC,MAAM,OAAO,sBAAkB;AACrD,CAAC;;AAED;AACA;AACA;AACA;AACO,MAAMC,OAAO,GAAIC,YAAuB,KAAiB;AAC9D,EAAA,GAAGlD,aAAa;AAChB,EAAA,GAAGjC,gBAAgB;AACnB,EAAA,GAAGmF,YAAY;AACf,EAAA,GAAG7C,uBAAuB;EAC1B,GAAGoC;AACL,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-repl",
3
- "version": "7.0.1",
3
+ "version": "7.0.2",
4
4
  "type": "module",
5
5
  "description": "Library for enabling REPL and Playground creation with Ember/Glimmer",
6
6
  "keywords": [
@@ -21,81 +21,81 @@
21
21
  "config"
22
22
  ],
23
23
  "dependencies": {
24
- "@ember/test-helpers": "^5.1.0",
24
+ "@ember/test-helpers": "^5.4.1",
25
25
  "@ember/test-waiters": "^4.1.0",
26
- "@embroider/addon-shim": "^1.8.9",
27
- "babel-plugin-ember-template-compilation": "^2.4.1",
26
+ "@embroider/addon-shim": "^1.10.2",
27
+ "babel-plugin-ember-template-compilation": "^3.0.1",
28
28
  "codemirror": "^6.0.2",
29
29
  "content-tag": "^3.0.0",
30
30
  "decorator-transforms": "^2.3.0",
31
- "ember-primitives": "^0.40.0",
31
+ "ember-primitives": "^0.48.1",
32
32
  "ember-resolver": "^13.1.0",
33
33
  "ember-resources": "^7.0.7",
34
- "repl-sdk": "1.0.0"
34
+ "repl-sdk": "1.0.1"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@arethetypeswrong/cli": "^0.18.2",
38
- "@babel/core": "^7.28.3",
39
- "@babel/eslint-parser": "^7.28.0",
40
- "@babel/plugin-transform-typescript": "^7.28.0",
38
+ "@babel/core": "^7.28.5",
39
+ "@babel/eslint-parser": "^7.28.5",
40
+ "@babel/plugin-transform-typescript": "^7.28.5",
41
41
  "@babel/runtime": "^7.28.3",
42
- "@babel/standalone": "^7.28.3",
43
- "@ember/app-tsconfig": "^1.0.0",
44
- "@ember/library-tsconfig": "^1.0.0",
42
+ "@babel/standalone": "file:../../babel-standalone.tgz",
43
+ "@ember/app-tsconfig": "^2.0.0",
44
+ "@ember/library-tsconfig": "^2.0.0",
45
45
  "@ember/test-helpers": "^5.2.1",
46
46
  "@embroider/addon-dev": "^8.1.0",
47
- "@embroider/compat": "^4.1.3",
48
- "@embroider/core": "^4.1.3",
49
- "@embroider/macros": "^1.18.1",
50
- "@embroider/vite": "^1.2.0",
51
- "@eslint/js": "^9.31.0",
47
+ "@embroider/compat": "^4.1.11",
48
+ "@embroider/core": "^4.4.0",
49
+ "@embroider/macros": "^1.19.5",
50
+ "@embroider/vite": "^1.4.4",
51
+ "@eslint/js": "^9.39.1",
52
52
  "@glimmer/component": "^2.0.0",
53
- "@glint/ember-tsc": "^1.0.3",
53
+ "@glint/ember-tsc": "^1.0.8",
54
54
  "@glint/template": "^1.6.1",
55
- "@glint/tsserver-plugin": "^2.0.3",
56
- "@rollup/plugin-babel": "^6.0.4",
57
- "@rollup/plugin-commonjs": "^28.0.6",
58
- "@rollup/plugin-node-resolve": "^16.0.1",
55
+ "@glint/tsserver-plugin": "^2.0.8",
56
+ "@rollup/plugin-babel": "^6.1.0",
57
+ "@rollup/plugin-commonjs": "^29.0.0",
58
+ "@rollup/plugin-node-resolve": "^16.0.3",
59
59
  "@types/babel__standalone": "^7.1.9",
60
60
  "@types/common-tags": "^1.8.4",
61
61
  "@types/mdast": "^4.0.4",
62
62
  "@types/qunit": "^2.19.12",
63
63
  "@types/unist": "^3.0.3",
64
64
  "babel-import-util": "^3.0.1",
65
- "babel-plugin-debug-macros": "^1.0.2",
65
+ "babel-plugin-debug-macros": "^2.0.0",
66
66
  "babel-plugin-ember-template-compilation": "^2.4.1",
67
67
  "change-case": "^5.4.4",
68
68
  "common-tags": "^1.8.2",
69
69
  "concurrently": "^9.2.1",
70
- "ember-qunit": "^9.0.2",
70
+ "ember-qunit": "^9.0.4",
71
71
  "ember-resolver": "^13.1.0",
72
- "ember-source": ">= 6.8.0-alpha.7",
73
- "eslint": "^9.34.0",
74
- "eslint-config-prettier": "^10.1.5",
75
- "eslint-plugin-ember": "^12.6.0",
72
+ "ember-source": "^6.9.0",
73
+ "eslint": "^9.39.1",
74
+ "eslint-config-prettier": "^10.1.8",
75
+ "eslint-plugin-ember": "^12.7.5",
76
76
  "eslint-plugin-import": "^2.31.0",
77
- "eslint-plugin-n": "^17.21.0",
78
- "globals": "^16.3.0",
79
- "prettier": "^3.4.2",
80
- "prettier-plugin-ember-template-tag": "^2.1.0",
81
- "publint": "^0.3.12",
82
- "qunit": "^2.24.1",
77
+ "eslint-plugin-n": "^17.23.1",
78
+ "globals": "^16.5.0",
79
+ "prettier": "^3.7.4",
80
+ "prettier-plugin-ember-template-tag": "^2.1.2",
81
+ "publint": "^0.3.16",
82
+ "qunit": "^2.24.3",
83
83
  "qunit-dom": "^3.5.0",
84
84
  "rehype-raw": "^7.0.0",
85
85
  "rehype-stringify": "^10.0.1",
86
86
  "remark-gfm": "^4.0.1",
87
87
  "remark-parse": "^11.0.0",
88
88
  "remark-rehype": "^11.1.2",
89
- "rollup": "^4.50.0",
89
+ "rollup": "^4.53.3",
90
90
  "rollup-plugin-node-polyfills": "^0.2.1",
91
91
  "testem": "^3.16.0",
92
- "typescript": "~5.8.3",
93
- "typescript-eslint": "^8.36.0",
92
+ "typescript": "~5.9.3",
93
+ "typescript-eslint": "^8.49.0",
94
94
  "unified": "^11.0.5",
95
95
  "unist-util-visit": "^5.0.0",
96
96
  "uuid": "^11.1.0",
97
- "vite": "^6.2.4",
98
- "vite-plugin-mkcert": "^1.17.8"
97
+ "vite": "^7.2.7",
98
+ "vite-plugin-mkcert": "^1.17.9"
99
99
  },
100
100
  "peerDependencies": {
101
101
  "@glint/template": ">= 1.5.2 || ^1.6.0-alpha.1"
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable getter-return */
2
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
+
3
3
  // @ts-ignore
4
4
  import { tracked } from '@glimmer/tracking';
5
5
  import { setComponentTemplate } from '@ember/component';
@@ -12,6 +12,7 @@ const frameworkModules = {
12
12
  '@ember/helper': () => import('@ember/helper'),
13
13
  '@ember/modifier': () => import('@ember/modifier'),
14
14
  '@ember/object': () => import('@ember/object'),
15
+ '@ember/object/observers': () => import('@ember/object/observers'),
15
16
  '@ember/owner': () => import('@ember/owner'),
16
17
  '@ember/reactive': () => import('@ember/reactive'),
17
18
  '@ember/reactive/collections': () => import('@ember/reactive/collections'),
@@ -46,13 +47,13 @@ const emberCompilationModules = {
46
47
  '@ember/template-compiler': () => import('@ember/template-compiler/runtime'),
47
48
  'ember-source/dist/ember-template-compiler': () =>
48
49
  import(
49
- // eslint-disable-next-line
50
+
50
51
  // @ts-ignore
51
52
  'ember-source/dist/ember-template-compiler.js'
52
53
  ),
53
54
  'ember-source/dist/ember-template-compiler.js': () =>
54
55
  import(
55
- // eslint-disable-next-line
56
+
56
57
  // @ts-ignore
57
58
  'ember-source/dist/ember-template-compiler.js'
58
59
  ),
@@ -65,7 +66,7 @@ const emberCompilationModules = {
65
66
  import('babel-plugin-ember-template-compilation'),
66
67
  // Dependencies of the above
67
68
  'babel-import-util': () => import('babel-import-util'),
68
- // eslint-disable-next-line
69
+
69
70
  // @ts-ignore
70
71
  'babel-plugin-debug-macros': () => import('babel-plugin-debug-macros'),
71
72
  '@embroider/macros': () => ({
@@ -100,7 +101,7 @@ const emberCompilationModules = {
100
101
  },
101
102
  }),
102
103
  // Private
103
- // eslint-disable-next-line
104
+
104
105
  // @ts-ignore
105
106
  importSync: (x: string) => window[Symbol.for('__repl-sdk__compiler__')].resolves[x],
106
107
  moduleExists: () => false,