repl-sdk 0.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apl-fqmucPXA.js +141 -0
- package/dist/apl-fqmucPXA.js.map +1 -0
- package/dist/asciiarmor-DucZyvP0.js +57 -0
- package/dist/asciiarmor-DucZyvP0.js.map +1 -0
- package/dist/asn1-BnOEsgAm.js +145 -0
- package/dist/asn1-BnOEsgAm.js.map +1 -0
- package/dist/assets/tar-worker-CxTcoQcr.js +593 -0
- package/dist/assets/tar-worker-CxTcoQcr.js.map +1 -0
- package/dist/asterisk-QAlztEwS.js +346 -0
- package/dist/asterisk-QAlztEwS.js.map +1 -0
- package/dist/brainfuck-DZVCuF_t.js +54 -0
- package/dist/brainfuck-DZVCuF_t.js.map +1 -0
- package/dist/clike-CTYGlS6x.js +800 -0
- package/dist/clike-CTYGlS6x.js.map +1 -0
- package/dist/clojure-BhXMqnxz.js +850 -0
- package/dist/clojure-BhXMqnxz.js.map +1 -0
- package/dist/cmake-BGaNd9E7.js +72 -0
- package/dist/cmake-BGaNd9E7.js.map +1 -0
- package/dist/cobol-4yqQntpt.js +121 -0
- package/dist/cobol-4yqQntpt.js.map +1 -0
- package/dist/codemirror-De3S70Np.js +2912 -0
- package/dist/codemirror-De3S70Np.js.map +1 -0
- package/dist/coffeescript-D2dXvhEc.js +309 -0
- package/dist/coffeescript-D2dXvhEc.js.map +1 -0
- package/dist/commonlisp-CF_VNHQR.js +131 -0
- package/dist/commonlisp-CF_VNHQR.js.map +1 -0
- package/dist/crystal-DyuLTqLs.js +399 -0
- package/dist/crystal-DyuLTqLs.js.map +1 -0
- package/dist/css-DkSyTW67.js +1773 -0
- package/dist/css-DkSyTW67.js.map +1 -0
- package/dist/cypher-Dlu_3r4V.js +122 -0
- package/dist/cypher-Dlu_3r4V.js.map +1 -0
- package/dist/d-UURgV0Ux.js +180 -0
- package/dist/d-UURgV0Ux.js.map +1 -0
- package/dist/diff-B_Bi2Crb.js +26 -0
- package/dist/diff-B_Bi2Crb.js.map +1 -0
- package/dist/dockerfile-Bvk733Ga.js +202 -0
- package/dist/dockerfile-Bvk733Ga.js.map +1 -0
- package/dist/dtd-Dy74G54E.js +115 -0
- package/dist/dtd-Dy74G54E.js.map +1 -0
- package/dist/dylan-TSb-Nfix.js +315 -0
- package/dist/dylan-TSb-Nfix.js.map +1 -0
- package/dist/ebnf-4fKAGW3a.js +141 -0
- package/dist/ebnf-4fKAGW3a.js.map +1 -0
- package/dist/ecl-B59qGGVg.js +179 -0
- package/dist/ecl-B59qGGVg.js.map +1 -0
- package/dist/eiffel-Dze7nlu3.js +135 -0
- package/dist/eiffel-Dze7nlu3.js.map +1 -0
- package/dist/elm-DG7jkhNZ.js +177 -0
- package/dist/elm-DG7jkhNZ.js.map +1 -0
- package/dist/erlang-BO6gOnGA.js +675 -0
- package/dist/erlang-BO6gOnGA.js.map +1 -0
- package/dist/factor-CMxFHDqz.js +66 -0
- package/dist/factor-CMxFHDqz.js.map +1 -0
- package/dist/fcl-CDDUNjTj.js +142 -0
- package/dist/fcl-CDDUNjTj.js.map +1 -0
- package/dist/forth-B9D2JCeE.js +117 -0
- package/dist/forth-B9D2JCeE.js.map +1 -0
- package/dist/fortran-CAG2BFbe.js +468 -0
- package/dist/fortran-CAG2BFbe.js.map +1 -0
- package/dist/gas-0Aw8zDr5.js +294 -0
- package/dist/gas-0Aw8zDr5.js.map +1 -0
- package/dist/gherkin-DhZlEZiy.js +116 -0
- package/dist/gherkin-DhZlEZiy.js.map +1 -0
- package/dist/gjs-DfguZDLq.js +173 -0
- package/dist/gjs-DfguZDLq.js.map +1 -0
- package/dist/gmd-Yas-Oo8k.js +163 -0
- package/dist/gmd-Yas-Oo8k.js.map +1 -0
- package/dist/groovy-CpwJiBl7.js +224 -0
- package/dist/groovy-CpwJiBl7.js.map +1 -0
- package/dist/haskell-ySd-OUo8.js +460 -0
- package/dist/haskell-ySd-OUo8.js.map +1 -0
- package/dist/haxe-7MlzfeYV.js +515 -0
- package/dist/haxe-7MlzfeYV.js.map +1 -0
- package/dist/hbs-CxcmWxSJ.js +62 -0
- package/dist/hbs-CxcmWxSJ.js.map +1 -0
- package/dist/http-BqypyemW.js +80 -0
- package/dist/http-BqypyemW.js.map +1 -0
- package/dist/idl-4HIGJlDI.js +986 -0
- package/dist/idl-4HIGJlDI.js.map +1 -0
- package/dist/index-B3Meoznj.js +118 -0
- package/dist/index-B3Meoznj.js.map +1 -0
- package/dist/index-BQyfDUUx.js +692 -0
- package/dist/index-BQyfDUUx.js.map +1 -0
- package/dist/index-BRDroAD8.js +305 -0
- package/dist/index-BRDroAD8.js.map +1 -0
- package/dist/index-BRMAzRyM.js +179 -0
- package/dist/index-BRMAzRyM.js.map +1 -0
- package/dist/index-Bb8uYQgv.js +927 -0
- package/dist/index-Bb8uYQgv.js.map +1 -0
- package/dist/index-BlOjO66K.js +17618 -0
- package/dist/index-BlOjO66K.js.map +1 -0
- package/dist/index-BoGWnSNL.js +706 -0
- package/dist/index-BoGWnSNL.js.map +1 -0
- package/dist/index-BsRrEiOu.js +98 -0
- package/dist/index-BsRrEiOu.js.map +1 -0
- package/dist/index-C2sFZMth.js +391 -0
- package/dist/index-C2sFZMth.js.map +1 -0
- package/dist/index-C7xwOjmS.js +291 -0
- package/dist/index-C7xwOjmS.js.map +1 -0
- package/dist/index-CA3lFUx6.js +315 -0
- package/dist/index-CA3lFUx6.js.map +1 -0
- package/dist/index-CB-pPTIf.js +98 -0
- package/dist/index-CB-pPTIf.js.map +1 -0
- package/dist/index-CCa6x1FE.js +386 -0
- package/dist/index-CCa6x1FE.js.map +1 -0
- package/dist/index-CD4DINI1.js +158 -0
- package/dist/index-CD4DINI1.js.map +1 -0
- package/dist/index-CE0B_fcG.js +328 -0
- package/dist/index-CE0B_fcG.js.map +1 -0
- package/dist/index-CVGAEPMV.js +2139 -0
- package/dist/index-CVGAEPMV.js.map +1 -0
- package/dist/index-CmaT2afn.js +332 -0
- package/dist/index-CmaT2afn.js.map +1 -0
- package/dist/index-D8sUxXp5.js +83 -0
- package/dist/index-D8sUxXp5.js.map +1 -0
- package/dist/index-DIz8Vpn-.js +737 -0
- package/dist/index-DIz8Vpn-.js.map +1 -0
- package/dist/index-DNP1xT-S.js +408 -0
- package/dist/index-DNP1xT-S.js.map +1 -0
- package/dist/index-DOAqdvnQ.js +862 -0
- package/dist/index-DOAqdvnQ.js.map +1 -0
- package/dist/index-DVUMFbgi.js +152 -0
- package/dist/index-DVUMFbgi.js.map +1 -0
- package/dist/index-VeTBKRVd.js +83 -0
- package/dist/index-VeTBKRVd.js.map +1 -0
- package/dist/index-dXZeR7Bx.js +1767 -0
- package/dist/index-dXZeR7Bx.js.map +1 -0
- package/dist/index-gtqbIb6T.js +62 -0
- package/dist/index-gtqbIb6T.js.map +1 -0
- package/dist/index-pN_pUAQ7.js +2426 -0
- package/dist/index-pN_pUAQ7.js.map +1 -0
- package/dist/index-wasu5VX0.js +1150 -0
- package/dist/index-wasu5VX0.js.map +1 -0
- package/dist/javascript-Bt8B7yTi.js +993 -0
- package/dist/javascript-Bt8B7yTi.js.map +1 -0
- package/dist/julia-Bs6JJhYG.js +408 -0
- package/dist/julia-Bs6JJhYG.js.map +1 -0
- package/dist/livescript-DmzgM3Yt.js +297 -0
- package/dist/livescript-DmzgM3Yt.js.map +1 -0
- package/dist/lua-8cJgIlqe.js +257 -0
- package/dist/lua-8cJgIlqe.js.map +1 -0
- package/dist/mathematica-DNLOL9PQ.js +111 -0
- package/dist/mathematica-DNLOL9PQ.js.map +1 -0
- package/dist/mbox-Ga7d4MMN.js +118 -0
- package/dist/mbox-Ga7d4MMN.js.map +1 -0
- package/dist/mirc-Dma3B8rS.js +108 -0
- package/dist/mirc-Dma3B8rS.js.map +1 -0
- package/dist/mllike-DHn7xckP.js +335 -0
- package/dist/mllike-DHn7xckP.js.map +1 -0
- package/dist/modelica-0d55jYY0.js +148 -0
- package/dist/modelica-0d55jYY0.js.map +1 -0
- package/dist/mscgen-DdqZYINH.js +136 -0
- package/dist/mscgen-DdqZYINH.js.map +1 -0
- package/dist/mumps-Btr8VblO.js +94 -0
- package/dist/mumps-Btr8VblO.js.map +1 -0
- package/dist/nginx-DTDtBDVN.js +142 -0
- package/dist/nginx-DTDtBDVN.js.map +1 -0
- package/dist/nsis-3zG7tgur.js +63 -0
- package/dist/nsis-3zG7tgur.js.map +1 -0
- package/dist/ntriples-CvgOYMpL.js +154 -0
- package/dist/ntriples-CvgOYMpL.js.map +1 -0
- package/dist/octave-DYBj3-tl.js +201 -0
- package/dist/octave-DYBj3-tl.js.map +1 -0
- package/dist/oz-R_e8WMIi.js +232 -0
- package/dist/oz-R_e8WMIi.js.map +1 -0
- package/dist/parse-CAqQaKsh.js +21685 -0
- package/dist/parse-CAqQaKsh.js.map +1 -0
- package/dist/pascal-GD8iposT.js +106 -0
- package/dist/pascal-GD8iposT.js.map +1 -0
- package/dist/perl-DL9mHpoi.js +1106 -0
- package/dist/perl-DL9mHpoi.js.map +1 -0
- package/dist/pig-C_4T4YIV.js +102 -0
- package/dist/pig-C_4T4YIV.js.map +1 -0
- package/dist/powershell-B0suO7Vd.js +329 -0
- package/dist/powershell-B0suO7Vd.js.map +1 -0
- package/dist/properties-BR-vP1aU.js +59 -0
- package/dist/properties-BR-vP1aU.js.map +1 -0
- package/dist/protobuf-BxgpyhoW.js +78 -0
- package/dist/protobuf-BxgpyhoW.js.map +1 -0
- package/dist/pug-vHnWR0UE.js +406 -0
- package/dist/pug-vHnWR0UE.js.map +1 -0
- package/dist/puppet-Bdao66PW.js +138 -0
- package/dist/puppet-Bdao66PW.js.map +1 -0
- package/dist/python-BFGRmuZ9.js +427 -0
- package/dist/python-BFGRmuZ9.js.map +1 -0
- package/dist/q-CrbCVq4a.js +132 -0
- package/dist/q-CrbCVq4a.js.map +1 -0
- package/dist/r-V7nswm59.js +171 -0
- package/dist/r-V7nswm59.js.map +1 -0
- package/dist/render-app-island-B-i8rvGi.js +61 -0
- package/dist/render-app-island-B-i8rvGi.js.map +1 -0
- package/dist/repl-sdk.js +7 -0
- package/dist/repl-sdk.js.map +1 -0
- package/dist/rpm-C-DLY-If.js +110 -0
- package/dist/rpm-C-DLY-If.js.map +1 -0
- package/dist/ruby-JDKLJNK0.js +331 -0
- package/dist/ruby-JDKLJNK0.js.map +1 -0
- package/dist/sas-D2UG-yhZ.js +208 -0
- package/dist/sas-D2UG-yhZ.js.map +1 -0
- package/dist/scheme-BKzrkGJD.js +223 -0
- package/dist/scheme-BKzrkGJD.js.map +1 -0
- package/dist/shell-BlsXDxCn.js +223 -0
- package/dist/shell-BlsXDxCn.js.map +1 -0
- package/dist/sieve-CjwBwOY5.js +136 -0
- package/dist/sieve-CjwBwOY5.js.map +1 -0
- package/dist/simple-mode-DMneyfDu.js +131 -0
- package/dist/simple-mode-DMneyfDu.js.map +1 -0
- package/dist/smalltalk-BOIGQuhN.js +122 -0
- package/dist/smalltalk-BOIGQuhN.js.map +1 -0
- package/dist/solr-CwD7U71z.js +70 -0
- package/dist/solr-CwD7U71z.js.map +1 -0
- package/dist/sparql-DYskk2vE.js +250 -0
- package/dist/sparql-DYskk2vE.js.map +1 -0
- package/dist/spreadsheet-Bgtt3oLP.js +88 -0
- package/dist/spreadsheet-Bgtt3oLP.js.map +1 -0
- package/dist/sql-Cei9CMfk.js +343 -0
- package/dist/sql-Cei9CMfk.js.map +1 -0
- package/dist/stex-C1nZSzAw.js +231 -0
- package/dist/stex-C1nZSzAw.js.map +1 -0
- package/dist/stylus-BkS-boTH.js +566 -0
- package/dist/stylus-BkS-boTH.js.map +1 -0
- package/dist/swift-FRZi1uvB.js +292 -0
- package/dist/swift-FRZi1uvB.js.map +1 -0
- package/dist/tcl-CUcaCdmq.js +115 -0
- package/dist/tcl-CUcaCdmq.js.map +1 -0
- package/dist/textile-BnFpjsrl.js +415 -0
- package/dist/textile-BnFpjsrl.js.map +1 -0
- package/dist/tiddlywiki-CjprD-Qp.js +219 -0
- package/dist/tiddlywiki-CjprD-Qp.js.map +1 -0
- package/dist/tiki-DK9DOeWn.js +269 -0
- package/dist/tiki-DK9DOeWn.js.map +1 -0
- package/dist/toml-BOuWGMcf.js +77 -0
- package/dist/toml-BOuWGMcf.js.map +1 -0
- package/dist/troff-E1bJ0PPL.js +62 -0
- package/dist/troff-E1bJ0PPL.js.map +1 -0
- package/dist/ttcn-cfg-Dc39-fIP.js +134 -0
- package/dist/ttcn-cfg-Dc39-fIP.js.map +1 -0
- package/dist/ttcn-tKd4HLu4.js +193 -0
- package/dist/ttcn-tKd4HLu4.js.map +1 -0
- package/dist/turtle-Dq7-1WAf.js +125 -0
- package/dist/turtle-Dq7-1WAf.js.map +1 -0
- package/dist/vb-Dp90gtsv.js +197 -0
- package/dist/vb-Dp90gtsv.js.map +1 -0
- package/dist/vbscript-Bfn8O8I7.js +479 -0
- package/dist/vbscript-Bfn8O8I7.js.map +1 -0
- package/dist/velocity-BwIZK1TH.js +150 -0
- package/dist/velocity-BwIZK1TH.js.map +1 -0
- package/dist/verilog-CnT9bMk0.js +430 -0
- package/dist/verilog-CnT9bMk0.js.map +1 -0
- package/dist/vhdl-DCkMIyT9.js +159 -0
- package/dist/vhdl-DCkMIyT9.js.map +1 -0
- package/dist/webidl-BTLTThCm.js +205 -0
- package/dist/webidl-BTLTThCm.js.map +1 -0
- package/dist/xquery-BrBUuxMR.js +526 -0
- package/dist/xquery-BrBUuxMR.js.map +1 -0
- package/dist/yacas-b5lAVEIl.js +131 -0
- package/dist/yacas-b5lAVEIl.js.map +1 -0
- package/dist/z80-ClgwfNdB.js +93 -0
- package/dist/z80-ClgwfNdB.js.map +1 -0
- package/package.json +81 -9
- package/src/cache.js +138 -0
- package/src/cdn.js +93 -0
- package/src/codemirror.js +161 -0
- package/src/compilers/ember/gjs.js +212 -0
- package/src/compilers/ember/gmd.js +190 -0
- package/src/compilers/ember/hbs.js +98 -0
- package/src/compilers/ember/render-app-island.js +83 -0
- package/src/compilers/ember.js +166 -0
- package/src/compilers/js.js +32 -0
- package/src/compilers/markdown/build-compiler.js +151 -0
- package/src/compilers/markdown/const.js +2 -0
- package/src/compilers/markdown/heading-id.js +75 -0
- package/src/compilers/markdown/live-code-extraction.js +198 -0
- package/src/compilers/markdown/parse.js +22 -0
- package/src/compilers/markdown/parse.test.ts +363 -0
- package/src/compilers/markdown/sanitize-for-glimmer.js +26 -0
- package/src/compilers/markdown/types.ts +21 -0
- package/src/compilers/markdown/utils.js +78 -0
- package/src/compilers/markdown.js +125 -0
- package/src/compilers/mermaid.js +35 -0
- package/src/compilers/react.js +59 -0
- package/src/compilers/svelte.js +116 -0
- package/src/compilers/vue.js +58 -0
- package/src/compilers.js +108 -0
- package/src/es-module-shim.js +53 -0
- package/src/index.d.ts +53 -4
- package/src/index.js +744 -89
- package/src/npm.js +58 -0
- package/src/request.Request.test.ts +59 -0
- package/src/request.js +140 -0
- package/src/resolve.fromImports.test.ts +35 -0
- package/src/resolve.fromInternalImport.test.ts +69 -0
- package/src/resolve.js +352 -0
- package/src/resolve.resolvePath.test.ts +24 -0
- package/src/resolve.test.ts +23 -0
- package/src/specifier.js +71 -0
- package/src/specifier.test.ts +90 -0
- package/src/tar-worker.js +61 -0
- package/src/tar.js +76 -0
- package/src/types.ts +335 -58
- package/src/utils.js +28 -1
- package/declarations/index.d.ts +0 -73
- package/dist/index.js +0 -107
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { completionKeymap } from '@codemirror/autocomplete';
|
|
2
|
+
import { indentWithTab } from '@codemirror/commands';
|
|
3
|
+
import { markdownKeymap } from '@codemirror/lang-markdown';
|
|
4
|
+
import { Compartment, EditorSelection, EditorState } from '@codemirror/state';
|
|
5
|
+
import { keymap } from '@codemirror/view';
|
|
6
|
+
import { basicSetup, EditorView } from 'codemirror';
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
import { foldByIndent } from 'codemirror-lang-mermaid';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Builds and creates a codemirror instance for the given element
|
|
12
|
+
*
|
|
13
|
+
* @typedef {any} Extension
|
|
14
|
+
*
|
|
15
|
+
* @typedef {object} CodemirrorOptions
|
|
16
|
+
* @property {HTMLElement} element
|
|
17
|
+
* @property {string} text
|
|
18
|
+
* @property {string} format
|
|
19
|
+
* @property {Extension[]} [ extensions ]
|
|
20
|
+
* @property {(text: string) => void} handleUpdate
|
|
21
|
+
* @property {(format: string) => Promise<Extension>} getLang
|
|
22
|
+
* @property {(format: string) => Promise<Extension>} getSupport
|
|
23
|
+
*
|
|
24
|
+
* @param {CodemirrorOptions} options
|
|
25
|
+
*/
|
|
26
|
+
export async function buildCodemirror({
|
|
27
|
+
element,
|
|
28
|
+
text,
|
|
29
|
+
format,
|
|
30
|
+
extensions,
|
|
31
|
+
handleUpdate,
|
|
32
|
+
getLang,
|
|
33
|
+
getSupport,
|
|
34
|
+
}) {
|
|
35
|
+
const languageConf = new Compartment();
|
|
36
|
+
const supportConf = new Compartment();
|
|
37
|
+
const tabSize = new Compartment();
|
|
38
|
+
|
|
39
|
+
const updateListener = EditorView.updateListener.of(({ state, docChanged }) => {
|
|
40
|
+
if (docChanged) {
|
|
41
|
+
handleUpdate(state.doc.toString());
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @param {string} format
|
|
47
|
+
*/
|
|
48
|
+
async function languageForFormat(format) {
|
|
49
|
+
switch (format) {
|
|
50
|
+
case 'glimdown':
|
|
51
|
+
case 'gdm':
|
|
52
|
+
case 'gmd':
|
|
53
|
+
return getLang('gmd');
|
|
54
|
+
case 'jsx':
|
|
55
|
+
case 'jsx|react':
|
|
56
|
+
return getLang('jsx|react');
|
|
57
|
+
default:
|
|
58
|
+
return getLang(format);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @param {string} format
|
|
64
|
+
*/
|
|
65
|
+
async function supportForFormat(format) {
|
|
66
|
+
const support = await getSupport(format);
|
|
67
|
+
|
|
68
|
+
if (!support) {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return Array.isArray(support) ? support : [support];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const [language, support] = await Promise.all([
|
|
76
|
+
languageForFormat(format),
|
|
77
|
+
supportForFormat(format),
|
|
78
|
+
]);
|
|
79
|
+
|
|
80
|
+
const editorExtensions = [
|
|
81
|
+
// features
|
|
82
|
+
basicSetup,
|
|
83
|
+
foldByIndent(),
|
|
84
|
+
// Language
|
|
85
|
+
languageConf.of(language),
|
|
86
|
+
supportConf.of(support),
|
|
87
|
+
|
|
88
|
+
updateListener,
|
|
89
|
+
EditorView.lineWrapping,
|
|
90
|
+
keymap.of([indentWithTab, ...completionKeymap, ...markdownKeymap]),
|
|
91
|
+
|
|
92
|
+
// TODO: lsp,
|
|
93
|
+
|
|
94
|
+
...(extensions ?? []),
|
|
95
|
+
].filter(Boolean);
|
|
96
|
+
|
|
97
|
+
const view = new EditorView({
|
|
98
|
+
parent: element,
|
|
99
|
+
state: EditorState.create({
|
|
100
|
+
extensions: editorExtensions,
|
|
101
|
+
}),
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Called from the host app to update the editor.
|
|
106
|
+
*
|
|
107
|
+
* @param {string} text
|
|
108
|
+
* @param {string} format
|
|
109
|
+
*/
|
|
110
|
+
const setText = async (text, format) => {
|
|
111
|
+
const [language, support] = await Promise.all([
|
|
112
|
+
languageForFormat(format),
|
|
113
|
+
supportForFormat(format),
|
|
114
|
+
]);
|
|
115
|
+
|
|
116
|
+
console.debug(`Codemirror changing to ${format}: ${language ? 'ok' : 'not ok'}`);
|
|
117
|
+
|
|
118
|
+
view.dispatch({
|
|
119
|
+
changes: {
|
|
120
|
+
from: 0,
|
|
121
|
+
to: view.state.doc.length,
|
|
122
|
+
insert: text,
|
|
123
|
+
},
|
|
124
|
+
effects: [languageConf.reconfigure(language), supportConf.reconfigure(support)],
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Changes just the format of the editor.
|
|
130
|
+
*
|
|
131
|
+
* @param {string} format
|
|
132
|
+
*/
|
|
133
|
+
const setFormat = async (format) => {
|
|
134
|
+
const [language, support] = await Promise.all([
|
|
135
|
+
languageForFormat(format),
|
|
136
|
+
supportForFormat(format),
|
|
137
|
+
]);
|
|
138
|
+
|
|
139
|
+
console.debug(`Codemirror changing to ${format}: ${language ? 'ok' : 'not ok'}`);
|
|
140
|
+
|
|
141
|
+
view.dispatch({
|
|
142
|
+
effects: [languageConf.reconfigure(language), supportConf.reconfigure(support)],
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
view.dispatch(
|
|
147
|
+
view.state.changeByRange((range) => ({
|
|
148
|
+
changes: [{ from: range.from, insert: text }],
|
|
149
|
+
range: EditorSelection.range(range.from, range.to),
|
|
150
|
+
}))
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
view.dispatch({
|
|
154
|
+
effects: [
|
|
155
|
+
tabSize.reconfigure(EditorState.tabSize.of(2)),
|
|
156
|
+
// languageConf.reconfigure(languageForFormat(format)),
|
|
157
|
+
],
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
return { view, setText, setFormat };
|
|
161
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { cache } from '../../cache.js';
|
|
2
|
+
import { renderApp } from './render-app-island.js';
|
|
3
|
+
|
|
4
|
+
let elementId = 0;
|
|
5
|
+
|
|
6
|
+
const buildDependencies = [
|
|
7
|
+
/**
|
|
8
|
+
* The only version of babel that is easily runnable in the browser
|
|
9
|
+
* This includes way too much stuff.
|
|
10
|
+
*/
|
|
11
|
+
'@babel/standalone',
|
|
12
|
+
/**
|
|
13
|
+
* We will be using this decorator transform
|
|
14
|
+
* instead of the babel one.
|
|
15
|
+
* The babel transform does way too much transforming.
|
|
16
|
+
*/
|
|
17
|
+
'decorator-transforms',
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Babel plugin that understands all the different ways
|
|
21
|
+
* which templates have been authored and what they need to
|
|
22
|
+
* compile to over the years.
|
|
23
|
+
*/
|
|
24
|
+
'babel-plugin-ember-template-compilation',
|
|
25
|
+
/**
|
|
26
|
+
* The actual template-compiler is ember-sounce-dependent,
|
|
27
|
+
* because the underlying format / bytecodes / etc is private,
|
|
28
|
+
* and can change between versions of ember-source.
|
|
29
|
+
*/
|
|
30
|
+
'ember-source/dist/ember-template-compiler.js',
|
|
31
|
+
/**
|
|
32
|
+
* Converts gjs/gts to standard js/ts
|
|
33
|
+
*/
|
|
34
|
+
'content-tag',
|
|
35
|
+
/**
|
|
36
|
+
* Older-style build macros
|
|
37
|
+
* (before import.meta.env was even a thing)
|
|
38
|
+
*
|
|
39
|
+
* These remove `@glimmer/env` and DEBUG usages
|
|
40
|
+
*/
|
|
41
|
+
'babel-plugin-debug-macros',
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* build macros, because the ecosystem isn't standardized on imprt.meta.env?.X
|
|
45
|
+
* Also, @embroider/macros does dead-code-elimination, which is handy.
|
|
46
|
+
*/
|
|
47
|
+
// '@embroider/macros/babel',
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @type {import('../../types.ts').CompilerConfig['compiler']}
|
|
52
|
+
*/
|
|
53
|
+
export async function compiler(config, api) {
|
|
54
|
+
const [
|
|
55
|
+
_babel,
|
|
56
|
+
_decoratorTransforms,
|
|
57
|
+
_emberTemplateCompilation,
|
|
58
|
+
compiler,
|
|
59
|
+
contentTag,
|
|
60
|
+
{ default: DebugMacros },
|
|
61
|
+
// embroiderMacros,
|
|
62
|
+
] = await api.tryResolveAll(buildDependencies);
|
|
63
|
+
|
|
64
|
+
// These libraries are compiled incorrectly for cjs<->ESM compat
|
|
65
|
+
const decoratorTransforms =
|
|
66
|
+
'default' in _decoratorTransforms ? _decoratorTransforms.default : _decoratorTransforms;
|
|
67
|
+
|
|
68
|
+
const emberTemplateCompilation =
|
|
69
|
+
'default' in _emberTemplateCompilation
|
|
70
|
+
? _emberTemplateCompilation.default
|
|
71
|
+
: _emberTemplateCompilation;
|
|
72
|
+
|
|
73
|
+
const babel = 'availablePlugins' in _babel ? _babel : _babel.default;
|
|
74
|
+
|
|
75
|
+
// let macros = embroiderMacros.buildMacros();
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @param {string} text
|
|
79
|
+
*/
|
|
80
|
+
async function transform(text) {
|
|
81
|
+
return babel.transformAsync(text, {
|
|
82
|
+
filename: `dynamic-repl.js`,
|
|
83
|
+
plugins: [
|
|
84
|
+
[
|
|
85
|
+
emberTemplateCompilation,
|
|
86
|
+
{
|
|
87
|
+
compiler,
|
|
88
|
+
transforms: [
|
|
89
|
+
// ...macros.templateMacros
|
|
90
|
+
],
|
|
91
|
+
targetFormat: 'wire',
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
[
|
|
95
|
+
// @ts-ignore - we don't care about types here..
|
|
96
|
+
decoratorTransforms,
|
|
97
|
+
{
|
|
98
|
+
runtime: {
|
|
99
|
+
import: 'decorator-transforms/runtime-esm',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
// ...macros.babelMacros,
|
|
104
|
+
[
|
|
105
|
+
DebugMacros,
|
|
106
|
+
{
|
|
107
|
+
flags: [
|
|
108
|
+
{
|
|
109
|
+
source: '@glimmer/env',
|
|
110
|
+
flags: {
|
|
111
|
+
DEBUG: true,
|
|
112
|
+
CI: false,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
debugTools: {
|
|
117
|
+
isDebug: true,
|
|
118
|
+
source: '@ember/debug',
|
|
119
|
+
assertPredicateIndex: 1,
|
|
120
|
+
},
|
|
121
|
+
externalizeHelpers: {
|
|
122
|
+
module: '@ember/debug',
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
'@ember/debug stripping',
|
|
126
|
+
],
|
|
127
|
+
[
|
|
128
|
+
DebugMacros,
|
|
129
|
+
{
|
|
130
|
+
externalizeHelpers: {
|
|
131
|
+
module: '@ember/application/deprecations',
|
|
132
|
+
},
|
|
133
|
+
debugTools: {
|
|
134
|
+
isDebug: true,
|
|
135
|
+
source: '@ember/application/deprecations',
|
|
136
|
+
assertPredicateIndex: 1,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
'@ember/application/deprecations stripping',
|
|
140
|
+
],
|
|
141
|
+
],
|
|
142
|
+
presets: [],
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const preprocessor = new contentTag.Preprocessor();
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @type {import('../../types.ts').Compiler}
|
|
150
|
+
*/
|
|
151
|
+
const gjsCompiler = {
|
|
152
|
+
compile: async (text, options) => {
|
|
153
|
+
const { code: preprocessed } = preprocessor.process(text, { filename: 'dynamic-repl.js' });
|
|
154
|
+
const transformed = await transform(preprocessed);
|
|
155
|
+
|
|
156
|
+
const code = transformed.code;
|
|
157
|
+
|
|
158
|
+
return code;
|
|
159
|
+
},
|
|
160
|
+
render: async (element, compiled, extra, compiler) => {
|
|
161
|
+
/**
|
|
162
|
+
*
|
|
163
|
+
* TODO: These will make things easier:
|
|
164
|
+
* https://github.com/emberjs/rfcs/pull/1099
|
|
165
|
+
* https://github.com/ember-cli/ember-addon-blueprint/blob/main/files/tests/test-helper.js
|
|
166
|
+
*/
|
|
167
|
+
const attribute = `data-repl-sdk-ember-gjs-${elementId++}`;
|
|
168
|
+
|
|
169
|
+
element.setAttribute(attribute, '');
|
|
170
|
+
|
|
171
|
+
const [application, destroyable, resolver, router, route, testWaiters, runloop] =
|
|
172
|
+
await compiler.tryResolveAll([
|
|
173
|
+
'@ember/application',
|
|
174
|
+
'@ember/destroyable',
|
|
175
|
+
'ember-resolver',
|
|
176
|
+
'@ember/routing/router',
|
|
177
|
+
'@ember/routing/route',
|
|
178
|
+
'@ember/test-waiters',
|
|
179
|
+
'@ember/runloop',
|
|
180
|
+
]);
|
|
181
|
+
|
|
182
|
+
// We don't want to await here, because we need to early
|
|
183
|
+
// return the element so that the app can render in to it.
|
|
184
|
+
// (Ember will only render in to an element if it's present in the DOM)
|
|
185
|
+
return renderApp({
|
|
186
|
+
element,
|
|
187
|
+
selector: `[${attribute}]`,
|
|
188
|
+
component: compiled,
|
|
189
|
+
log: compiler.announce,
|
|
190
|
+
modules: {
|
|
191
|
+
application,
|
|
192
|
+
destroyable,
|
|
193
|
+
resolver,
|
|
194
|
+
router,
|
|
195
|
+
route,
|
|
196
|
+
testWaiters,
|
|
197
|
+
runloop,
|
|
198
|
+
},
|
|
199
|
+
});
|
|
200
|
+
},
|
|
201
|
+
handlers: {
|
|
202
|
+
js: async (text) => {
|
|
203
|
+
return gjsCompiler.compile(text, {});
|
|
204
|
+
},
|
|
205
|
+
mjs: async (text) => {
|
|
206
|
+
return gjsCompiler.compile(text, {});
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
return gjsCompiler;
|
|
212
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('unified').Plugin} Plugin
|
|
3
|
+
*/
|
|
4
|
+
import { assert, isRecord } from '../../utils.js';
|
|
5
|
+
import { buildCodeFenceMetaUtils } from '../markdown/utils.js';
|
|
6
|
+
import { renderApp } from './render-app-island.js';
|
|
7
|
+
|
|
8
|
+
let elementId = 0;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {unknown} [ options ]
|
|
12
|
+
* @returns {{
|
|
13
|
+
* scope: Record<string, unknown>,
|
|
14
|
+
* remarkPlugins: Plugin[],
|
|
15
|
+
* rehypePlugins: Plugin[],
|
|
16
|
+
* ShadowComponent: string | undefined,
|
|
17
|
+
* CopyComponent: string | undefined
|
|
18
|
+
* }}
|
|
19
|
+
*/
|
|
20
|
+
export function filterOptions(options) {
|
|
21
|
+
if (!isRecord(options)) {
|
|
22
|
+
return {
|
|
23
|
+
scope: {},
|
|
24
|
+
remarkPlugins: [],
|
|
25
|
+
rehypePlugins: [],
|
|
26
|
+
ShadowComponent: undefined,
|
|
27
|
+
CopyComponent: undefined,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
scope: /** @type {Record<string, unknown>}*/ (options?.scope || {}),
|
|
33
|
+
remarkPlugins: /** @type {Plugin[]}*/ (options?.remarkPlugins || []),
|
|
34
|
+
rehypePlugins: /** @type {Plugin[]}*/ (options?.rehypePlugins || []),
|
|
35
|
+
ShadowComponent: /** @type {string}*/ (options?.ShadowComponent),
|
|
36
|
+
CopyComponent: /** @type {string}*/ (options?.CopyComponent),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @type {import('../../types.ts').CompilerConfig['compiler']}
|
|
42
|
+
*/
|
|
43
|
+
export async function compiler(config, api) {
|
|
44
|
+
const userOptions = filterOptions(
|
|
45
|
+
/** @type {Record<string, unknown>} */ (config.userOptions)?.gmd || config
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
const { isLive, isPreview, needsLive, allowedFormats, getFlavorFromMeta, isBelow } =
|
|
49
|
+
buildCodeFenceMetaUtils(api);
|
|
50
|
+
|
|
51
|
+
const { parseMarkdown } = await import('../markdown/parse.js');
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @type {import('../../types.ts').Compiler}
|
|
55
|
+
*/
|
|
56
|
+
const gmdCompiler = {
|
|
57
|
+
compile: async (text, options) => {
|
|
58
|
+
const compileOptions = filterOptions(options);
|
|
59
|
+
const result = await parseMarkdown(text, {
|
|
60
|
+
remarkPlugins: [...userOptions.remarkPlugins, ...compileOptions.remarkPlugins],
|
|
61
|
+
rehypePlugins: [...userOptions.rehypePlugins, ...compileOptions.rehypePlugins],
|
|
62
|
+
isLive,
|
|
63
|
+
isPreview,
|
|
64
|
+
isBelow,
|
|
65
|
+
needsLive,
|
|
66
|
+
ALLOWED_FORMATS: allowedFormats,
|
|
67
|
+
getFlavorFromMeta,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const { template } = await api.tryResolve('@ember/template-compiler/runtime');
|
|
71
|
+
|
|
72
|
+
const scope = {
|
|
73
|
+
...filterOptions(userOptions).scope,
|
|
74
|
+
...filterOptions(options).scope,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const component = template(result.text, {
|
|
78
|
+
scope: () => ({
|
|
79
|
+
...scope,
|
|
80
|
+
// TODO: compile all the components from "result" and add them to scope here
|
|
81
|
+
// would this be better than the markdown style multiple islands
|
|
82
|
+
}),
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
return { compiled: component, ...result, scope };
|
|
86
|
+
},
|
|
87
|
+
render: async (element, compiled, extra, compiler) => {
|
|
88
|
+
/**
|
|
89
|
+
*
|
|
90
|
+
* TODO: These will make things easier:
|
|
91
|
+
* https://github.com/emberjs/rfcs/pull/1099
|
|
92
|
+
* https://github.com/ember-cli/ember-addon-blueprint/blob/main/files/tests/test-helper.js
|
|
93
|
+
*/
|
|
94
|
+
const attribute = `data-repl-sdk-ember-gmd-${elementId++}`;
|
|
95
|
+
|
|
96
|
+
element.setAttribute(attribute, '');
|
|
97
|
+
|
|
98
|
+
const [application, destroyable, resolver, router, route, testWaiters, runloop] =
|
|
99
|
+
await compiler.tryResolveAll([
|
|
100
|
+
'@ember/application',
|
|
101
|
+
'@ember/destroyable',
|
|
102
|
+
'ember-resolver',
|
|
103
|
+
'@ember/routing/router',
|
|
104
|
+
'@ember/routing/route',
|
|
105
|
+
'@ember/test-waiters',
|
|
106
|
+
'@ember/runloop',
|
|
107
|
+
]);
|
|
108
|
+
|
|
109
|
+
// We don't want to await here, because we need to early
|
|
110
|
+
// return the element so that the app can render in to it.
|
|
111
|
+
// (Ember will only render in to an element if it's present in the DOM)
|
|
112
|
+
const destroy = await renderApp({
|
|
113
|
+
element,
|
|
114
|
+
selector: `[${attribute}]`,
|
|
115
|
+
component: compiled,
|
|
116
|
+
log: compiler.announce,
|
|
117
|
+
modules: {
|
|
118
|
+
application,
|
|
119
|
+
destroyable,
|
|
120
|
+
resolver,
|
|
121
|
+
router,
|
|
122
|
+
route,
|
|
123
|
+
testWaiters,
|
|
124
|
+
runloop,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @type {(() => void)[]}
|
|
130
|
+
*/
|
|
131
|
+
const destroyables = [];
|
|
132
|
+
|
|
133
|
+
await Promise.all(
|
|
134
|
+
/** @type {unknown[]} */ (extra.codeBlocks).map(async (/** @type {unknown} */ info) => {
|
|
135
|
+
/** @type {Record<string, unknown>} */
|
|
136
|
+
const infoObj = /** @type {Record<string, unknown>} */ (info);
|
|
137
|
+
|
|
138
|
+
if (
|
|
139
|
+
!api.canCompile(
|
|
140
|
+
/** @type {string} */ (infoObj.format),
|
|
141
|
+
/** @type {string} */ (infoObj.flavor)
|
|
142
|
+
)
|
|
143
|
+
) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const flavor = /** @type {string} */ (infoObj.flavor);
|
|
148
|
+
const hasScope =
|
|
149
|
+
flavor === 'ember' || infoObj.format === 'gjs' || infoObj.format === 'hbs';
|
|
150
|
+
const subRender = await compiler.compile(
|
|
151
|
+
/** @type {string} */ (infoObj.format),
|
|
152
|
+
/** @type {string} */ (infoObj.code),
|
|
153
|
+
{
|
|
154
|
+
...compiler.optionsFor(/** @type {string} */ (infoObj.format), flavor),
|
|
155
|
+
flavor: flavor,
|
|
156
|
+
// @ts-ignore
|
|
157
|
+
...(hasScope
|
|
158
|
+
? {
|
|
159
|
+
scope: extra.scope,
|
|
160
|
+
}
|
|
161
|
+
: {}),
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
const selector = `#${/** @type {string} */ (infoObj.placeholderId)}`;
|
|
166
|
+
const target = element.querySelector(selector);
|
|
167
|
+
|
|
168
|
+
assert(
|
|
169
|
+
`Could not find placeholder / target element (using selector: \`${selector}\`). ` +
|
|
170
|
+
`Could not render ${/** @type {string} */ (infoObj.format)} block.`,
|
|
171
|
+
target
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
destroyables.push(subRender.destroy);
|
|
175
|
+
target.appendChild(subRender.element);
|
|
176
|
+
})
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
return () => {
|
|
180
|
+
for (const subDestroy of destroyables) {
|
|
181
|
+
subDestroy();
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
destroy();
|
|
185
|
+
};
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
return gmdCompiler;
|
|
190
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { isRecord } from '../../utils.js';
|
|
2
|
+
import { renderApp } from './render-app-island.js';
|
|
3
|
+
|
|
4
|
+
let elementId = 0;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @param {unknown} [ options ]
|
|
8
|
+
* @returns {{ scope: Record<string, unknown> }}
|
|
9
|
+
*/
|
|
10
|
+
function filterOptions(options) {
|
|
11
|
+
if (!isRecord(options)) {
|
|
12
|
+
return { scope: {} };
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
scope: /** @type {Record<string, unknown>}*/ (options?.scope || {}),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @type {import('../../types.ts').CompilerConfig['compiler']}
|
|
22
|
+
*/
|
|
23
|
+
export async function compiler(config, api) {
|
|
24
|
+
/**
|
|
25
|
+
* @type {import('../../types.ts').Compiler}
|
|
26
|
+
*/
|
|
27
|
+
const hbsCompiler = {
|
|
28
|
+
compile: async (text, options) => {
|
|
29
|
+
const { template } = await api.tryResolve('@ember/template-compiler/runtime');
|
|
30
|
+
|
|
31
|
+
const component = template(text, {
|
|
32
|
+
scope: () => ({
|
|
33
|
+
...filterOptions(config).scope,
|
|
34
|
+
...filterOptions(options).scope,
|
|
35
|
+
}),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Some versions of ember implement the runtime template compiler incorrectly (albeit, correct enough for the constraints at the time).
|
|
40
|
+
* So we need to wait longer than a microtask queue request could take.
|
|
41
|
+
*
|
|
42
|
+
* To make sure that the template is compiled, and "component"
|
|
43
|
+
* has a value.
|
|
44
|
+
*
|
|
45
|
+
* See:
|
|
46
|
+
* - https://github.com/emberjs/ember.js/issues/20913
|
|
47
|
+
* - https://github.com/emberjs/ember.js/issues/20914
|
|
48
|
+
*/
|
|
49
|
+
await new Promise(requestAnimationFrame);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Is this allowed here? or do I just return text,
|
|
53
|
+
* and do the above in 'render'
|
|
54
|
+
*/
|
|
55
|
+
return component;
|
|
56
|
+
},
|
|
57
|
+
render: async (element, compiled, extra, compiler) => {
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* TODO: These will make things easier:
|
|
61
|
+
* https://github.com/emberjs/rfcs/pull/1099
|
|
62
|
+
* https://github.com/ember-cli/ember-addon-blueprint/blob/main/files/tests/test-helper.js
|
|
63
|
+
*/
|
|
64
|
+
const attribute = `data-repl-sdk-ember-hbs-${elementId++}`;
|
|
65
|
+
|
|
66
|
+
element.setAttribute(attribute, '');
|
|
67
|
+
|
|
68
|
+
const [application, destroyable, resolver, router, route, testWaiters, runloop] =
|
|
69
|
+
await compiler.tryResolveAll([
|
|
70
|
+
'@ember/application',
|
|
71
|
+
'@ember/destroyable',
|
|
72
|
+
'ember-resolver',
|
|
73
|
+
'@ember/routing/router',
|
|
74
|
+
'@ember/routing/route',
|
|
75
|
+
'@ember/test-waiters',
|
|
76
|
+
'@ember/runloop',
|
|
77
|
+
]);
|
|
78
|
+
|
|
79
|
+
return renderApp({
|
|
80
|
+
element,
|
|
81
|
+
selector: `[${attribute}]`,
|
|
82
|
+
component: compiled,
|
|
83
|
+
log: compiler.announce,
|
|
84
|
+
modules: {
|
|
85
|
+
application,
|
|
86
|
+
destroyable,
|
|
87
|
+
resolver,
|
|
88
|
+
router,
|
|
89
|
+
route,
|
|
90
|
+
testWaiters,
|
|
91
|
+
runloop,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
return hbsCompiler;
|
|
98
|
+
}
|