ember-repl 3.0.0-beta.1 → 3.0.0-beta.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.
@@ -9,6 +9,7 @@ declare function compileMD(glimdownInput: string, options?: {
9
9
  importMap?: EvalImportMap;
10
10
  topLevelScope?: ScopeMap;
11
11
  CopyComponent?: string;
12
+ ShadowComponent?: string;
12
13
  }): Promise<CompileResult & {
13
14
  rootTemplate?: string;
14
15
  }>;
@@ -86,7 +86,8 @@ async function compileMD(glimdownInput, options) {
86
86
  templateOnlyGlimdown,
87
87
  blocks
88
88
  } = await parseMarkdown(glimdownInput, {
89
- CopyComponent: options?.CopyComponent
89
+ CopyComponent: options?.CopyComponent,
90
+ ShadowComponent: options?.ShadowComponent
90
91
  });
91
92
  rootTemplate = templateOnlyGlimdown;
92
93
  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 }\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 });\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 accum[invocationName(name)] = component;\n\n return accum;\n }, {} as Record<string, unknown>);\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","console","component","localScope","reduce","accum","invocationName","moduleName"],"mappings":";;AAMA,eAAeA,UAAUA,CAACC,EAAsB,EAAEC,SAAyB,EAAE;EAC3E,IAAIC,OAAO,GAAG,MAAMC,OAAO,CAACC,GAAG,CAC7BJ,EAAE,CAACK,GAAG,CAAC,OAAO;AAAEC,IAAAA,IAAAA;AAAK,GAAC,KAAK;AACzB,IAAA,OAAO,MAAMC,UAAU,CAACD,IAAI,EAAEL,SAAS,CAAC,CAAA;AAC1C,GAAC,CACH,CAAC,CAAA;AAED,EAAA,OAAOC,OAAO,CAAA;AAChB,CAAA;AAEO,eAAeK,UAAUA,CAC9BC,QAAgB,EAChBP,SAAyB,EACD;EACxB,IAAI;IACF,IAAI;AAAEQ,MAAAA,SAAAA;AAAU,KAAC,GAAG,MAAM,OAAO,UAAO,CAAC,CAAA;AAEzC,IAAA,OAAO,MAAMA,SAAS,CAACD,QAAQ,EAAEP,SAAS,CAAC,CAAA;GAC5C,CAAC,OAAOS,KAAK,EAAE;IACd,OAAO;AAAEA,MAAAA,KAAK,EAAEA,KAAc;AAAEC,MAAAA,IAAI,EAAE,SAAA;KAAW,CAAA;AACnD,GAAA;AACF,CAAA;AAEO,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,KAAK,CAAC,CAAA;MAEpB,OAAO;AAAEA,QAAAA,KAAK,EAAEA,KAAc;QAAEmB,YAAY;AAAElB,QAAAA,IAAI,EAAE,SAAA;OAAW,CAAA;AACjE,KAAA;AACF,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACE,EAAA,KAAK,IAAI;IAAED,KAAK;AAAEyB,IAAAA,SAAAA;GAAW,IAAIlB,KAAK,EAAE;IACtC,IAAI,CAACkB,SAAS,EAAE;AACd,MAAA,IAAIzB,KAAK,EAAE;QACT,OAAO;UAAEA,KAAK;UAAEmB,YAAY;AAAElB,UAAAA,IAAI,EAAE,SAAA;SAAW,CAAA;AACjD,OAAA;AACF,KAAA;AACF,GAAA;;AAEA;AACF;AACA;EACE,IAAI;IACF,IAAIyB,UAAU,GAAGnB,KAAK,CAACoB,MAAM,CAAC,CAACC,KAAK,EAAE;MAAEH,SAAS;AAAExB,MAAAA,IAAAA;AAAK,KAAC,KAAK;AAC5D2B,MAAAA,KAAK,CAACC,cAAc,CAAC5B,IAAI,CAAC,CAAC,GAAGwB,SAAS,CAAA;AAEvC,MAAA,OAAOG,KAAK,CAAA;KACb,EAAE,EAA6B,CAAC,CAAA;AAEjC,IAAA,OAAO,MAAM1B,UAAU,CAACiB,YAAY,EAAE;AACpCW,MAAAA,UAAU,EAAE,qBAAqB;AACjCvB,MAAAA,KAAK,EAAE;AACL,QAAA,GAAGW,aAAa;QAChB,GAAGQ,UAAAA;AACL,OAAA;AACF,KAAC,CAAC,CAAA;GACH,CAAC,OAAO1B,KAAK,EAAE;IACd,OAAO;AAAEA,MAAAA,KAAK,EAAEA,KAAc;MAAEmB,YAAY;AAAElB,MAAAA,IAAI,EAAE,SAAA;KAAW,CAAA;AACjE,GAAA;AACF;;;;"}
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 accum[invocationName(name)] = component;\n\n return accum;\n }, {} as Record<string, unknown>);\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","console","component","localScope","reduce","accum","invocationName","moduleName"],"mappings":";;AAMA,eAAeA,UAAUA,CAACC,EAAsB,EAAEC,SAAyB,EAAE;EAC3E,IAAIC,OAAO,GAAG,MAAMC,OAAO,CAACC,GAAG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AAC5D4B,MAAAA,KAAK,CAACC,cAAc,CAAC7B,IAAI,CAAC,CAAC,GAAGyB,SAAS,CAAA;AAEvC,MAAA,OAAOG,KAAK,CAAA;KACb,EAAE,EAA6B,CAAC,CAAA;AAEjC,IAAA,OAAO,MAAM3B,UAAU,CAACiB,YAAY,EAAE;AACpCY,MAAAA,UAAU,EAAE,qBAAqB;AACjCxB,MAAAA,KAAK,EAAE;AACL,QAAA,GAAGW,aAAa;QAChB,GAAGS,UAAAA;AACL,OAAA;AACF,KAAC,CAAC,CAAA;GACH,CAAC,OAAO3B,KAAK,EAAE;IACd,OAAO;AAAEA,MAAAA,KAAK,EAAEA,KAAc;MAAEmB,YAAY;AAAElB,MAAAA,IAAI,EAAE,SAAA;KAAW,CAAA;AACjE,GAAA;AACF;;;;"}
@@ -13,6 +13,7 @@ declare function compile(text: string, { format, onSuccess, onError, onCompileSt
13
13
  onCompileStart: () => Promise<unknown> | unknown;
14
14
  importMap?: EvalImportMap;
15
15
  CopyComponent?: string;
16
+ ShadowComponent?: string;
16
17
  topLevelScope?: ScopeMap;
17
18
  }): Promise<void>;
18
19
  type Input = string | undefined | null;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/browser/compile/index.ts"],"sourcesContent":["import { cell, resource, resourceFactory } from 'ember-resources';\n\nimport { nameFor } from '../utils';\nimport {\n compileGJS as processGJS,\n compileHBS as processHBS,\n compileMD as processMD,\n} from './formats';\n\nimport type { CompileResult } from '../types';\nimport type { EvalImportMap, ScopeMap } from './types';\nimport type { ComponentLike } from '@glint/template';\ntype Format = 'glimdown' | 'gjs' | 'hbs';\n\nexport const CACHE = new Map<string, ComponentLike>();\n\nconst SUPPORTED_FORMATS = ['glimdown', 'gjs', 'hbs'];\n\n/**\n * This compileMD is a more robust version of the raw compiling used in \"formats\".\n * This function manages cache, and has events for folks building UIs to hook in to\n */\nexport async function compile(\n text: string,\n {\n format,\n onSuccess,\n onError,\n onCompileStart,\n ...options\n }: {\n format: Format;\n onSuccess: (component: ComponentLike) => Promise<unknown> | unknown;\n onError: (error: string) => Promise<unknown> | unknown;\n onCompileStart: () => Promise<unknown> | unknown;\n importMap?: EvalImportMap;\n CopyComponent?: string;\n topLevelScope?: ScopeMap;\n }\n) {\n let id = nameFor(text);\n\n let existing = CACHE.get(id);\n\n if (existing) {\n onSuccess(existing);\n\n return;\n }\n\n if (!SUPPORTED_FORMATS.includes(format)) {\n await onError(`Unsupported format: ${format}. Supported formats: ${SUPPORTED_FORMATS}`);\n\n return;\n }\n\n await onCompileStart();\n\n if (!text) {\n await onError('No Input Document yet');\n\n return;\n }\n\n let result: CompileResult;\n\n if (format === 'glimdown') {\n result = await processMD(text, options);\n } else if (format === 'gjs') {\n result = await processGJS(text, options.importMap);\n } else if (format === 'hbs') {\n result = await processHBS(text, {\n scope: options.topLevelScope,\n });\n } else {\n await onError(`Unsupported format: ${format}. Supported formats: ${SUPPORTED_FORMATS}`);\n\n return;\n }\n\n if (result.error) {\n await onError(result.error.message || `${result.error}`);\n\n return;\n }\n\n CACHE.set(id, result.component as ComponentLike);\n\n await onSuccess(result.component as ComponentLike);\n}\n\ntype Input = string | undefined | null;\n\n/**\n * By default, this compiles to `glimdown`. A Markdown format which\n * extracts `live` tagged code snippets and compiles them to components.\n */\nexport const Compiled = resourceFactory(\n (markdownText: Input | (() => Input), format?: Format | (() => Format)) => {\n return resource(() => {\n let _format: Format = (typeof format === 'function' ? format() : format) || 'glimdown';\n let input = typeof markdownText === 'function' ? markdownText() : markdownText;\n let ready = cell(false);\n let error = cell();\n let result = cell<ComponentLike>();\n\n if (input) {\n compile(input, {\n format: _format,\n onSuccess: async (component) => {\n result.current = component;\n ready.set(true);\n error.set(null);\n },\n onError: async (e) => {\n error.set(e);\n },\n onCompileStart: async () => {\n ready.set(false);\n },\n });\n }\n\n return () => ({\n isReady: ready.current,\n error: error.current,\n component: result.current,\n });\n });\n }\n);\n"],"names":["CACHE","Map","SUPPORTED_FORMATS","compile","text","format","onSuccess","onError","onCompileStart","options","id","nameFor","existing","get","includes","result","processMD","processGJS","importMap","processHBS","scope","topLevelScope","error","message","set","component","Compiled","resourceFactory","markdownText","resource","_format","input","ready","cell","current","e","isReady"],"mappings":";;;;MAcaA,KAAK,GAAG,IAAIC,GAAG,GAAyB;AAErD,MAAMC,iBAAiB,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;;AAEpD;AACA;AACA;AACA;AACO,eAAeC,OAAOA,CAC3BC,IAAY,EACZ;EACEC,MAAM;EACNC,SAAS;EACTC,OAAO;EACPC,cAAc;EACd,GAAGC,OAAAA;AASL,CAAC,EACD;AACA,EAAA,IAAIC,EAAE,GAAGC,OAAO,CAACP,IAAI,CAAC,CAAA;AAEtB,EAAA,IAAIQ,QAAQ,GAAGZ,KAAK,CAACa,GAAG,CAACH,EAAE,CAAC,CAAA;AAE5B,EAAA,IAAIE,QAAQ,EAAE;IACZN,SAAS,CAACM,QAAQ,CAAC,CAAA;AAEnB,IAAA,OAAA;AACF,GAAA;AAEA,EAAA,IAAI,CAACV,iBAAiB,CAACY,QAAQ,CAACT,MAAM,CAAC,EAAE;AACvC,IAAA,MAAME,OAAO,CAAE,CAAA,oBAAA,EAAsBF,MAAO,CAAuBH,qBAAAA,EAAAA,iBAAkB,EAAC,CAAC,CAAA;AAEvF,IAAA,OAAA;AACF,GAAA;EAEA,MAAMM,cAAc,EAAE,CAAA;EAEtB,IAAI,CAACJ,IAAI,EAAE;IACT,MAAMG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AAEtC,IAAA,OAAA;AACF,GAAA;AAEA,EAAA,IAAIQ,MAAqB,CAAA;EAEzB,IAAIV,MAAM,KAAK,UAAU,EAAE;AACzBU,IAAAA,MAAM,GAAG,MAAMC,SAAS,CAACZ,IAAI,EAAEK,OAAO,CAAC,CAAA;AACzC,GAAC,MAAM,IAAIJ,MAAM,KAAK,KAAK,EAAE;IAC3BU,MAAM,GAAG,MAAME,UAAU,CAACb,IAAI,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EAAE;MACT5B,OAAO,CAAC4B,KAAK,EAAE;AACb1B,QAAAA,MAAM,EAAEyB,OAAO;QACfxB,SAAS,EAAE,MAAOmB,SAAS,IAAK;UAC9BV,MAAM,CAACmB,OAAO,GAAGT,SAAS,CAAA;AAC1BO,UAAAA,KAAK,CAACR,GAAG,CAAC,IAAI,CAAC,CAAA;AACfF,UAAAA,KAAK,CAACE,GAAG,CAAC,IAAI,CAAC,CAAA;SAChB;QACDjB,OAAO,EAAE,MAAO4B,CAAC,IAAK;AACpBb,UAAAA,KAAK,CAACE,GAAG,CAACW,CAAC,CAAC,CAAA;SACb;QACD3B,cAAc,EAAE,YAAY;AAC1BwB,UAAAA,KAAK,CAACR,GAAG,CAAC,KAAK,CAAC,CAAA;AAClB,SAAA;AACF,OAAC,CAAC,CAAA;AACJ,KAAA;AAEA,IAAA,OAAO,OAAO;MACZY,OAAO,EAAEJ,KAAK,CAACE,OAAO;MACtBZ,KAAK,EAAEA,KAAK,CAACY,OAAO;MACpBT,SAAS,EAAEV,MAAM,CAACmB,OAAAA;AACpB,KAAC,CAAC,CAAA;AACJ,GAAC,CAAC,CAAA;AACJ,CACF;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/browser/compile/index.ts"],"sourcesContent":["import { cell, resource, resourceFactory } from 'ember-resources';\n\nimport { nameFor } from '../utils';\nimport {\n compileGJS as processGJS,\n compileHBS as processHBS,\n compileMD as processMD,\n} from './formats';\n\nimport type { CompileResult } from '../types';\nimport type { EvalImportMap, ScopeMap } from './types';\nimport type { ComponentLike } from '@glint/template';\ntype Format = 'glimdown' | 'gjs' | 'hbs';\n\nexport const CACHE = new Map<string, ComponentLike>();\n\nconst SUPPORTED_FORMATS = ['glimdown', 'gjs', 'hbs'];\n\n/**\n * This compileMD is a more robust version of the raw compiling used in \"formats\".\n * This function manages cache, and has events for folks building UIs to hook in to\n */\nexport async function compile(\n text: string,\n {\n format,\n onSuccess,\n onError,\n onCompileStart,\n ...options\n }: {\n format: Format;\n onSuccess: (component: ComponentLike) => Promise<unknown> | unknown;\n onError: (error: string) => Promise<unknown> | unknown;\n onCompileStart: () => Promise<unknown> | unknown;\n importMap?: EvalImportMap;\n CopyComponent?: string;\n ShadowComponent?: string;\n topLevelScope?: ScopeMap;\n }\n) {\n let id = nameFor(text);\n\n let existing = CACHE.get(id);\n\n if (existing) {\n onSuccess(existing);\n\n return;\n }\n\n if (!SUPPORTED_FORMATS.includes(format)) {\n await onError(`Unsupported format: ${format}. Supported formats: ${SUPPORTED_FORMATS}`);\n\n return;\n }\n\n await onCompileStart();\n\n if (!text) {\n await onError('No Input Document yet');\n\n return;\n }\n\n let result: CompileResult;\n\n if (format === 'glimdown') {\n result = await processMD(text, options);\n } else if (format === 'gjs') {\n result = await processGJS(text, options.importMap);\n } else if (format === 'hbs') {\n result = await processHBS(text, {\n scope: options.topLevelScope,\n });\n } else {\n await onError(`Unsupported format: ${format}. Supported formats: ${SUPPORTED_FORMATS}`);\n\n return;\n }\n\n if (result.error) {\n await onError(result.error.message || `${result.error}`);\n\n return;\n }\n\n CACHE.set(id, result.component as ComponentLike);\n\n await onSuccess(result.component as ComponentLike);\n}\n\ntype Input = string | undefined | null;\n\n/**\n * By default, this compiles to `glimdown`. A Markdown format which\n * extracts `live` tagged code snippets and compiles them to components.\n */\nexport const Compiled = resourceFactory(\n (markdownText: Input | (() => Input), format?: Format | (() => Format)) => {\n return resource(() => {\n let _format: Format = (typeof format === 'function' ? format() : format) || 'glimdown';\n let input = typeof markdownText === 'function' ? markdownText() : markdownText;\n let ready = cell(false);\n let error = cell();\n let result = cell<ComponentLike>();\n\n if (input) {\n compile(input, {\n format: _format,\n onSuccess: async (component) => {\n result.current = component;\n ready.set(true);\n error.set(null);\n },\n onError: async (e) => {\n error.set(e);\n },\n onCompileStart: async () => {\n ready.set(false);\n },\n });\n }\n\n return () => ({\n isReady: ready.current,\n error: error.current,\n component: result.current,\n });\n });\n }\n);\n"],"names":["CACHE","Map","SUPPORTED_FORMATS","compile","text","format","onSuccess","onError","onCompileStart","options","id","nameFor","existing","get","includes","result","processMD","processGJS","importMap","processHBS","scope","topLevelScope","error","message","set","component","Compiled","resourceFactory","markdownText","resource","_format","input","ready","cell","current","e","isReady"],"mappings":";;;;MAcaA,KAAK,GAAG,IAAIC,GAAG,GAAyB;AAErD,MAAMC,iBAAiB,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;;AAEpD;AACA;AACA;AACA;AACO,eAAeC,OAAOA,CAC3BC,IAAY,EACZ;EACEC,MAAM;EACNC,SAAS;EACTC,OAAO;EACPC,cAAc;EACd,GAAGC,OAAAA;AAUL,CAAC,EACD;AACA,EAAA,IAAIC,EAAE,GAAGC,OAAO,CAACP,IAAI,CAAC,CAAA;AAEtB,EAAA,IAAIQ,QAAQ,GAAGZ,KAAK,CAACa,GAAG,CAACH,EAAE,CAAC,CAAA;AAE5B,EAAA,IAAIE,QAAQ,EAAE;IACZN,SAAS,CAACM,QAAQ,CAAC,CAAA;AAEnB,IAAA,OAAA;AACF,GAAA;AAEA,EAAA,IAAI,CAACV,iBAAiB,CAACY,QAAQ,CAACT,MAAM,CAAC,EAAE;AACvC,IAAA,MAAME,OAAO,CAAE,CAAA,oBAAA,EAAsBF,MAAO,CAAuBH,qBAAAA,EAAAA,iBAAkB,EAAC,CAAC,CAAA;AAEvF,IAAA,OAAA;AACF,GAAA;EAEA,MAAMM,cAAc,EAAE,CAAA;EAEtB,IAAI,CAACJ,IAAI,EAAE;IACT,MAAMG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AAEtC,IAAA,OAAA;AACF,GAAA;AAEA,EAAA,IAAIQ,MAAqB,CAAA;EAEzB,IAAIV,MAAM,KAAK,UAAU,EAAE;AACzBU,IAAAA,MAAM,GAAG,MAAMC,SAAS,CAACZ,IAAI,EAAEK,OAAO,CAAC,CAAA;AACzC,GAAC,MAAM,IAAIJ,MAAM,KAAK,KAAK,EAAE;IAC3BU,MAAM,GAAG,MAAME,UAA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,IAAIF,KAAK,EAAE;MACT5B,OAAO,CAAC4B,KAAK,EAAE;AACb1B,QAAAA,MAAM,EAAEyB,OAAO;QACfxB,SAAS,EAAE,MAAOmB,SAAS,IAAK;UAC9BV,MAAM,CAACmB,OAAO,GAAGT,SAAS,CAAA;AAC1BO,UAAAA,KAAK,CAACR,GAAG,CAAC,IAAI,CAAC,CAAA;AACfF,UAAAA,KAAK,CAACE,GAAG,CAAC,IAAI,CAAC,CAAA;SAChB;QACDjB,OAAO,EAAE,MAAO4B,CAAC,IAAK;AACpBb,UAAAA,KAAK,CAACE,GAAG,CAACW,CAAC,CAAC,CAAA;SACb;QACD3B,cAAc,EAAE,YAAY;AAC1BwB,UAAAA,KAAK,CAACR,GAAG,CAAC,KAAK,CAAC,CAAA;AAClB,SAAA;AACF,OAAC,CAAC,CAAA;AACJ,KAAA;AAEA,IAAA,OAAO,OAAO;MACZY,OAAO,EAAEJ,KAAK,CAACE,OAAO;MACtBZ,KAAK,EAAEA,KAAK,CAACY,OAAO;MACpBT,SAAS,EAAEV,MAAM,CAACmB,OAAAA;AACpB,KAAC,CAAC,CAAA;AACJ,GAAC,CAAC,CAAA;AACJ,CACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-repl",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.2",
4
4
  "description": "Addon for enabling REPL and Playground creation with Ember/Glimmer",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -87,6 +87,7 @@ export async function compileMD(
87
87
  importMap?: EvalImportMap;
88
88
  topLevelScope?: ScopeMap;
89
89
  CopyComponent?: string;
90
+ ShadowComponent?: string;
90
91
  }
91
92
  ): Promise<CompileResult & { rootTemplate?: string }> {
92
93
  let importMap = options?.importMap;
@@ -108,6 +109,7 @@ export async function compileMD(
108
109
  let { parseMarkdown } = await import('./markdown-to-ember');
109
110
  let { templateOnlyGlimdown, blocks } = await parseMarkdown(glimdownInput, {
110
111
  CopyComponent: options?.CopyComponent,
112
+ ShadowComponent: options?.ShadowComponent,
111
113
  });
112
114
 
113
115
  rootTemplate = templateOnlyGlimdown;
@@ -35,6 +35,7 @@ export async function compile(
35
35
  onCompileStart: () => Promise<unknown> | unknown;
36
36
  importMap?: EvalImportMap;
37
37
  CopyComponent?: string;
38
+ ShadowComponent?: string;
38
39
  topLevelScope?: ScopeMap;
39
40
  }
40
41
  ) {