ember-repl 3.0.0-beta.4 → 3.0.0-beta.5

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 (88) hide show
  1. package/declarations/browser/cjs/eval.d.ts +9 -0
  2. package/declarations/browser/cjs/eval.d.ts.map +1 -0
  3. package/declarations/browser/cjs/index.d.ts +7 -0
  4. package/declarations/browser/cjs/index.d.ts.map +1 -0
  5. package/declarations/browser/compile/formats.d.ts +16 -0
  6. package/declarations/browser/compile/formats.d.ts.map +1 -0
  7. package/{dist → declarations}/browser/compile/index.d.ts +14 -13
  8. package/declarations/browser/compile/index.d.ts.map +1 -0
  9. package/{dist → declarations}/browser/compile/markdown-to-ember.d.ts +5 -4
  10. package/declarations/browser/compile/markdown-to-ember.d.ts.map +1 -0
  11. package/declarations/browser/compile/types.d.ts +7 -0
  12. package/declarations/browser/compile/types.d.ts.map +1 -0
  13. package/declarations/browser/esm/index.d.ts +8 -0
  14. package/declarations/browser/esm/index.d.ts.map +1 -0
  15. package/{dist → declarations}/browser/eti/babel-plugin.d.ts +2 -2
  16. package/declarations/browser/eti/babel-plugin.d.ts.map +1 -0
  17. package/declarations/browser/eti/debug.d.ts +2 -0
  18. package/declarations/browser/eti/debug.d.ts.map +1 -0
  19. package/{dist → declarations}/browser/eti/parse-templates.d.ts +7 -7
  20. package/declarations/browser/eti/parse-templates.d.ts.map +1 -0
  21. package/{dist → declarations}/browser/eti/preprocess.d.ts +3 -2
  22. package/declarations/browser/eti/preprocess.d.ts.map +1 -0
  23. package/{dist → declarations}/browser/eti/template-tag-transform.d.ts +2 -2
  24. package/declarations/browser/eti/template-tag-transform.d.ts.map +1 -0
  25. package/declarations/browser/eti/util.d.ts +14 -0
  26. package/declarations/browser/eti/util.d.ts.map +1 -0
  27. package/declarations/browser/gjs.d.ts +4 -0
  28. package/declarations/browser/gjs.d.ts.map +1 -0
  29. package/{dist → declarations}/browser/hbs.d.ts +4 -3
  30. package/declarations/browser/hbs.d.ts.map +1 -0
  31. package/declarations/browser/index.d.ts +7 -0
  32. package/declarations/browser/index.d.ts.map +1 -0
  33. package/{dist → declarations}/browser/js.d.ts +3 -3
  34. package/declarations/browser/js.d.ts.map +1 -0
  35. package/{dist → declarations}/browser/known-modules.d.ts +6 -5
  36. package/declarations/browser/known-modules.d.ts.map +1 -0
  37. package/declarations/browser/types.d.ts +21 -0
  38. package/declarations/browser/types.d.ts.map +1 -0
  39. package/{dist → declarations}/browser/utils.d.ts +4 -4
  40. package/declarations/browser/utils.d.ts.map +1 -0
  41. package/declarations/test-support/index.d.ts +2 -0
  42. package/declarations/test-support/index.d.ts.map +1 -0
  43. package/dist/browser/cjs/eval.js.map +1 -1
  44. package/dist/browser/cjs/index.js.map +1 -1
  45. package/dist/browser/compile/formats.js.map +1 -1
  46. package/dist/browser/compile/index.js.map +1 -1
  47. package/dist/browser/compile/markdown-to-ember.js +2 -2
  48. package/dist/browser/compile/markdown-to-ember.js.map +1 -1
  49. package/dist/browser/esm/index.js.map +1 -1
  50. package/dist/browser/eti/babel-plugin.js.map +1 -1
  51. package/dist/browser/eti/parse-templates.js.map +1 -1
  52. package/dist/browser/eti/preprocess.js +2 -167
  53. package/dist/browser/eti/preprocess.js.map +1 -1
  54. package/dist/browser/eti/template-tag-transform.js.map +1 -1
  55. package/dist/browser/eti/util.js.map +1 -1
  56. package/dist/browser/gjs.js.map +1 -1
  57. package/dist/browser/hbs.js.map +1 -1
  58. package/dist/browser/js.js.map +1 -1
  59. package/dist/test-support/index.js.map +1 -1
  60. package/package.json +76 -56
  61. package/src/browser/cjs/eval.ts +2 -2
  62. package/src/browser/cjs/index.ts +4 -4
  63. package/src/browser/compile/formats.ts +14 -11
  64. package/src/browser/compile/index.ts +6 -6
  65. package/src/browser/compile/markdown-to-ember.ts +5 -5
  66. package/src/browser/esm/index.ts +4 -4
  67. package/src/browser/eti/babel-plugin.ts +2 -2
  68. package/src/browser/eti/parse-templates.ts +2 -2
  69. package/src/browser/eti/preprocess.ts +3 -3
  70. package/src/browser/eti/template-tag-transform.ts +1 -1
  71. package/src/browser/eti/util.ts +1 -1
  72. package/src/browser/gjs.ts +4 -4
  73. package/src/browser/hbs.ts +2 -2
  74. package/src/browser/index.ts +5 -5
  75. package/src/browser/js.ts +3 -3
  76. package/src/test-support/index.ts +1 -1
  77. package/dist/browser/cjs/eval.d.ts +0 -10
  78. package/dist/browser/cjs/eval.d.ts.map +0 -1
  79. package/dist/browser/cjs/index.d.ts +0 -7
  80. package/dist/browser/compile/formats.d.ts +0 -16
  81. package/dist/browser/compile/types.d.ts +0 -7
  82. package/dist/browser/esm/index.d.ts +0 -8
  83. package/dist/browser/eti/debug.d.ts +0 -2
  84. package/dist/browser/eti/util.d.ts +0 -14
  85. package/dist/browser/gjs.d.ts +0 -4
  86. package/dist/browser/index.d.ts +0 -6
  87. package/dist/browser/types.d.ts +0 -21
  88. package/dist/test-support/index.d.ts +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/test-support/index.ts"],"sourcesContent":["import { CACHE } from '../browser/compile/index';\n\nexport function clearCompileCache() {\n CACHE.clear();\n}\n"],"names":["clearCompileCache","CACHE","clear"],"mappings":";;AAEO,SAASA,iBAAiBA,GAAG;EAClCC,KAAK,CAACC,KAAK,EAAE,CAAA;AACf;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/test-support/index.ts"],"sourcesContent":["import { CACHE } from '../browser/compile/index.ts';\n\nexport function clearCompileCache() {\n CACHE.clear();\n}\n"],"names":["clearCompileCache","CACHE","clear"],"mappings":";;AAEO,SAASA,iBAAiBA,GAAG;EAClCC,KAAK,CAACC,KAAK,EAAE,CAAA;AACf;;;;"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "ember-repl",
3
- "version": "3.0.0-beta.4",
3
+ "version": "3.0.0-beta.5",
4
4
  "description": "Addon for enabling REPL and Playground creation with Ember/Glimmer",
5
5
  "keywords": [
6
6
  "ember-addon"
7
7
  ],
8
8
  "repository": {
9
- "type": "https",
10
- "url": "https://github.com/NullVoxPopuli/limber",
9
+ "type": "git",
10
+ "url": "https://github.com/NullVoxPopuli/limber.git",
11
11
  "directory": "packages/ember-repl/addon"
12
12
  },
13
13
  "license": "MIT",
@@ -15,63 +15,76 @@
15
15
  "typesVersions": {
16
16
  "*": {
17
17
  "test-support": [
18
- "dist/test-support/index.d.ts"
18
+ "declarations/test-support/index.d.ts"
19
19
  ],
20
20
  "markdown/parse": [
21
- "./dist/browser/compile/markdown-to-ember.d.ts"
21
+ "./declarations/browser/compile/markdown-to-ember.d.ts"
22
22
  ],
23
23
  "*": [
24
- "dist/browser/*",
25
- "dist/browser/*/index.d.ts"
24
+ "declarations/browser/*",
25
+ "declarations/browser/*/index.d.ts"
26
26
  ]
27
27
  }
28
28
  },
29
29
  "exports": {
30
- ".": "./dist/browser/index.js",
31
- "./esm": "./dist/browser/esm/index.js",
32
- "./markdown/parse": "./dist/browser/compile/markdown-to-ember.js",
30
+ ".": {
31
+ "types": "./declarations/browser/index.d.ts",
32
+ "default": "./dist/browser/index.js"
33
+ },
34
+ "./esm": {
35
+ "types": "./declarations/browser/esm/index.d.ts",
36
+ "default": "./dist/browser/esm/index.js"
37
+ },
38
+ "./markdown/parse": {
39
+ "types": "./declarations/browser/compile/markdown-to-ember.d.ts",
40
+ "default": "./dist/browser/compile/markdown-to-ember.js"
41
+ },
33
42
  "./ember-cli": {
34
43
  "require": "./src/build/ember-cli.cjs"
35
44
  },
36
- "./test-support": "./dist/test-support/index.js",
45
+ "./test-support": {
46
+ "types": "./declarations/test-support/index.d.ts",
47
+ "default": "./dist/test-support/index.js"
48
+ },
37
49
  "./addon-main.js": "./addon-main.cjs"
38
50
  },
39
51
  "files": [
40
52
  "src",
41
53
  "dist",
54
+ "declarations",
42
55
  "addon-main.cjs"
43
56
  ],
44
57
  "dependencies": {
45
58
  "@babel/helper-plugin-utils": "^7.22.5",
46
- "@babel/standalone": "^7.22.5",
47
- "@embroider/addon-shim": "1.8.5",
48
- "@embroider/macros": "1.11.1",
49
- "babel-import-util": "^1.3.0",
50
- "babel-plugin-ember-template-compilation": "^2.0.3",
59
+ "@babel/standalone": "^7.22.10",
60
+ "@embroider/addon-shim": "1.8.6",
61
+ "@embroider/macros": "1.13.1",
62
+ "babel-import-util": "^1.4.1",
63
+ "babel-plugin-ember-template-compilation": "^2.2.0",
51
64
  "broccoli-file-creator": "^2.1.1",
52
65
  "change-case": "^4.1.2",
53
66
  "common-tags": "^1.8.2",
54
67
  "line-column": "^1.0.2",
55
- "magic-string": "^0.30.0",
68
+ "magic-string": "^0.30.2",
56
69
  "mdast": "^3.0.0",
57
70
  "parse-static-imports": "^1.1.0",
58
71
  "rehype-raw": "^6.1.1",
59
- "rehype-stringify": "^9.0.3",
72
+ "rehype-stringify": "^9.0.4",
60
73
  "remark-gfm": "^3.0.1",
61
74
  "remark-parse": "^10.0.2",
62
75
  "remark-rehype": "^10.1.0",
63
76
  "unified": "^10.1.2",
64
- "unist-util-visit": "^4.1.2",
77
+ "unist-util-visit": "^5.0.0",
65
78
  "uuid": "^9.0.0",
66
- "vfile": "^6.0.0"
79
+ "vfile": "^6.0.1"
67
80
  },
68
81
  "devDependencies": {
69
- "@babel/core": "^7.22.5",
82
+ "@babel/core": "^7.22.10",
70
83
  "@babel/preset-typescript": "^7.22.5",
71
- "@babel/types": "^7.22.5",
72
- "@ember/test-helpers": "^3.1.0",
84
+ "@babel/types": "^7.22.10",
85
+ "@ember/test-helpers": "^3.2.0",
73
86
  "@ember/test-waiters": "^3.0.2",
74
- "@embroider/addon-dev": "3.1.1",
87
+ "@embroider/addon-dev": "4.1.0",
75
88
  "@glimmer/compiler": "^0.84.3",
76
89
  "@glimmer/component": "^1.1.2",
77
90
  "@glimmer/interfaces": "^0.84.3",
@@ -79,39 +92,39 @@
79
92
  "@glimmer/syntax": "^0.84.3",
80
93
  "@glimmer/tracking": "^1.1.2",
81
94
  "@glimmer/util": "^0.84.3",
82
- "@glint/core": "^1.0.2",
83
- "@glint/environment-ember-loose": "^1.0.2",
84
- "@glint/environment-ember-template-imports": "^1.0.2",
85
- "@glint/template": "^1.0.2",
86
- "@nullvoxpopuli/eslint-configs": "^3.1.3",
87
- "@rollup/plugin-commonjs": "^25.0.2",
88
- "@tsconfig/ember": "^2.0.0",
89
- "@types/babel__core": "^7.20.0",
95
+ "@glint/core": "^1.1.0",
96
+ "@glint/environment-ember-loose": "^1.1.0",
97
+ "@glint/environment-ember-template-imports": "^1.1.0",
98
+ "@glint/template": "^1.1.0",
99
+ "@nullvoxpopuli/eslint-configs": "^3.2.2",
100
+ "@rollup/plugin-babel": "^6.0.3",
101
+ "@rollup/plugin-commonjs": "^25.0.4",
102
+ "@tsconfig/ember": "^3.0.0",
103
+ "@types/babel__core": "^7.20.1",
90
104
  "@types/babel__standalone": "^7.1.4",
91
- "@types/babel__traverse": "^7.18.5",
92
- "@types/hast": "^2.3.4",
93
- "@types/mdast": "^3.0.11",
94
- "@types/unist": "^2.0.6",
95
- "@types/uuid": "^9.0.1",
96
- "@typescript-eslint/eslint-plugin": "^5.59.11",
97
- "@typescript-eslint/parser": "^5.59.11",
105
+ "@types/babel__traverse": "^7.20.1",
106
+ "@types/hast": "^3.0.0",
107
+ "@types/mdast": "^4.0.0",
108
+ "@types/unist": "^3.0.0",
109
+ "@types/uuid": "^9.0.2",
110
+ "@typescript-eslint/eslint-plugin": "^6.4.0",
111
+ "@typescript-eslint/parser": "^6.4.0",
98
112
  "concurrently": "^8.2.0",
99
- "ember-resources": "^6.1.0",
100
- "ember-source": "^5.0.0",
113
+ "ember-resources": "^6.4.0",
114
+ "ember-source": "^5.2.0",
101
115
  "ember-template-imports": "^3.4.2",
102
- "ember-template-lint": "^5.10.3",
103
- "eslint": "^8.43.0",
104
- "eslint-plugin-ember": "^11.8.0",
116
+ "ember-template-lint": "^5.11.2",
117
+ "eslint": "^8.47.0",
118
+ "eslint-plugin-ember": "^11.10.0",
105
119
  "eslint-plugin-node": "^11.1.0",
106
- "eslint-plugin-prettier": "^4.2.1",
107
- "prettier": "^2.8.8",
108
- "prettier-plugin-ember-template-tag": "^0.3.2",
109
- "publint": "^0.1.12",
110
- "rollup": "~3.25.1",
120
+ "eslint-plugin-prettier": "^5.0.0",
121
+ "prettier": "^3.0.2",
122
+ "prettier-plugin-ember-template-tag": "^1.0.2",
123
+ "publint": "^0.2.1",
124
+ "rollup": "~3.28.0",
111
125
  "rollup-plugin-copy": "^3.4.0",
112
126
  "rollup-plugin-glimmer-template-tag": "^0.4.1",
113
- "rollup-plugin-ts": "^3.2.0",
114
- "typescript": "^5.0.4",
127
+ "typescript": "^5.1.6",
115
128
  "@nullvoxpopuli/limber-untyped": "0.0.0"
116
129
  },
117
130
  "volta": {
@@ -130,13 +143,20 @@
130
143
  "@glimmer/compiler": "^0.84.3",
131
144
  "@glimmer/component": "^1.1.2",
132
145
  "@glimmer/syntax": "^0.84.3",
133
- "@glint/template": "^1.0.2",
134
- "ember-resources": "^6.1.0",
135
- "ember-source": "^5.0.0"
146
+ "@glint/template": "^1.1.0",
147
+ "ember-resources": "^6.4.0",
148
+ "ember-source": "^5.2.0"
149
+ },
150
+ "engines": {
151
+ "node": ">= v16",
152
+ "npm": "use pnpm",
153
+ "yarn": "use pnpm"
136
154
  },
137
155
  "scripts": {
138
- "build": "rollup --config",
139
- "lint:types": "glint",
156
+ "build": "concurrently 'npm:build:*'",
157
+ "build:js": "rollup --config",
158
+ "build:types": "tsc --emitDeclarationOnly --noEmit false",
159
+ "lint:types": "tsc --noEmit",
140
160
  "lint:fix": "pnpm -w exec lint fix",
141
161
  "start": "rollup --config --watch",
142
162
  "lint": "pnpm -w exec lint",
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-unused-vars */
2
- import { modules } from '../known-modules';
2
+ import { modules } from '../known-modules.ts';
3
3
 
4
- import type { ExtraModules } from '../types';
4
+ import type { ExtraModules } from '../types.ts';
5
5
  import type Component from '@glimmer/component';
6
6
 
7
7
  export function evalSnippet(
@@ -1,8 +1,8 @@
1
- import { preprocess, transform } from '../gjs';
2
- import { nameFor } from '../utils';
3
- import { evalSnippet } from './eval';
1
+ import { preprocess, transform } from '../gjs.ts';
2
+ import { nameFor } from '../utils.ts';
3
+ import { evalSnippet } from './eval.ts';
4
4
 
5
- import type { CompileResult, ExtraModules } from '../types';
5
+ import type { CompileResult, ExtraModules } from '../types.ts';
6
6
  import type { ComponentLike } from '@glint/template';
7
7
 
8
8
  export interface Info {
@@ -1,8 +1,8 @@
1
- import { invocationName } from '../utils';
1
+ import { invocationName } from '../utils.ts';
2
2
 
3
- import type { CompileResult } from '../types';
4
- import type { ExtractedCode } from './markdown-to-ember';
5
- import type { EvalImportMap, ScopeMap } from './types';
3
+ import type { CompileResult } from '../types.ts';
4
+ import type { ExtractedCode } from './markdown-to-ember.ts';
5
+ import type { EvalImportMap, ScopeMap } from './types.ts';
6
6
 
7
7
  async function compileAll(js: { code: string }[], importMap?: EvalImportMap) {
8
8
  let modules = await Promise.all(
@@ -19,7 +19,7 @@ export async function compileGJS(
19
19
  importMap?: EvalImportMap
20
20
  ): Promise<CompileResult> {
21
21
  try {
22
- let { compileJS } = await import('../js');
22
+ let { compileJS } = await import('../js.ts');
23
23
 
24
24
  return await compileJS(gjsInput, importMap);
25
25
  } catch (error) {
@@ -35,7 +35,7 @@ export async function compileHBS(
35
35
  }
36
36
  ): Promise<CompileResult> {
37
37
  try {
38
- let { compileHBS } = await import('../hbs');
38
+ let { compileHBS } = await import('../hbs.ts');
39
39
 
40
40
  return compileHBS(hbsInput, options);
41
41
  } catch (error) {
@@ -106,7 +106,7 @@ export async function compileMD(
106
106
  * compiled rootTemplate can invoke them
107
107
  */
108
108
  try {
109
- let { parseMarkdown } = await import('./markdown-to-ember');
109
+ let { parseMarkdown } = await import('./markdown-to-ember.ts');
110
110
  let { templateOnlyGlimdown, blocks } = await parseMarkdown(glimdownInput, {
111
111
  CopyComponent: options?.CopyComponent,
112
112
  ShadowComponent: options?.ShadowComponent,
@@ -151,11 +151,14 @@ export async function compileMD(
151
151
  * Step 4: Compile the Ember Template
152
152
  */
153
153
  try {
154
- let localScope = scope.reduce((accum, { component, name }) => {
155
- accum[invocationName(name)] = component;
154
+ let localScope = scope.reduce(
155
+ (accum, { component, name }) => {
156
+ accum[invocationName(name)] = component;
156
157
 
157
- return accum;
158
- }, {} as Record<string, unknown>);
158
+ return accum;
159
+ },
160
+ {} as Record<string, unknown>
161
+ );
159
162
 
160
163
  return await compileHBS(rootTemplate, {
161
164
  moduleName: 'DynamicRootTemplate',
@@ -1,14 +1,14 @@
1
1
  import { cell, resource, resourceFactory } from 'ember-resources';
2
2
 
3
- import { nameFor } from '../utils';
3
+ import { nameFor } from '../utils.ts';
4
4
  import {
5
5
  compileGJS as processGJS,
6
6
  compileHBS as processHBS,
7
7
  compileMD as processMD,
8
- } from './formats';
8
+ } from './formats.ts';
9
9
 
10
- import type { CompileResult } from '../types';
11
- import type { EvalImportMap, ScopeMap } from './types';
10
+ import type { CompileResult } from '../types.ts';
11
+ import type { EvalImportMap, ScopeMap } from './types.ts';
12
12
  import type { ComponentLike } from '@glint/template';
13
13
  type Format = 'glimdown' | 'gjs' | 'hbs';
14
14
 
@@ -114,7 +114,7 @@ type ExtraOptions =
114
114
  */
115
115
  export interface Value {
116
116
  isReady: boolean;
117
- error: unknown;
117
+ error: string | null;
118
118
  component: ComponentLike;
119
119
  }
120
120
 
@@ -139,7 +139,7 @@ export function buildCompiler(
139
139
 
140
140
  let input = typeof markdownText === 'function' ? markdownText() : markdownText;
141
141
  let ready = cell(false);
142
- let error = cell();
142
+ let error = cell<string | null>();
143
143
  let result = cell<ComponentLike>();
144
144
 
145
145
  if (input) {
@@ -6,7 +6,7 @@ import remarkRehype from 'remark-rehype';
6
6
  import { unified } from 'unified';
7
7
  import { visit } from 'unist-util-visit';
8
8
 
9
- import { invocationOf, nameFor } from '../utils';
9
+ import { invocationOf, nameFor } from '../utils.ts';
10
10
 
11
11
  import type { Node } from 'hast';
12
12
  import type { Code, Text } from 'mdast';
@@ -114,9 +114,9 @@ function liveCodeExtraction(options: Options = {}) {
114
114
 
115
115
  function enhance(code: Code) {
116
116
  code.data ??= {};
117
- code.data['hProperties'] ??= {};
117
+ (code.data as any)['hProperties'] ??= {};
118
118
  // This is secret-to-us-only API, so we don't really care about the type
119
- (code.data['hProperties'] as any)[GLIMDOWN_PREVIEW] = true;
119
+ (code.data as any)['hProperties'][GLIMDOWN_PREVIEW] = true;
120
120
 
121
121
  return {
122
122
  data: {
@@ -138,8 +138,8 @@ function liveCodeExtraction(options: Options = {}) {
138
138
 
139
139
  return function transformer(tree: Parent, file: VFileWithMeta) {
140
140
  visit(tree, ['code'], function (node, index, parent) {
141
- if (parent === null) return;
142
- if (index === null) return;
141
+ if (parent === null || parent === undefined) return;
142
+ if (index === null || index === undefined) return;
143
143
 
144
144
  if (!isRelevantCode(node as Code)) {
145
145
  let enhanced = enhance(node as Code);
@@ -1,8 +1,8 @@
1
- import { preprocess, transform } from '../gjs';
2
- import { modules } from '../known-modules';
3
- import { nameFor } from '../utils';
1
+ import { preprocess, transform } from '../gjs.ts';
2
+ import { modules } from '../known-modules.ts';
3
+ import { nameFor } from '../utils.ts';
4
4
 
5
- import type { CompileResult, ExtraModules } from '../types';
5
+ import type { CompileResult, ExtraModules } from '../types.ts';
6
6
  import type Component from '@glimmer/component';
7
7
  import type { ComponentLike } from '@glint/template';
8
8
 
@@ -1,7 +1,7 @@
1
1
  import { ImportUtil } from 'babel-import-util';
2
2
 
3
- import { transformTemplateTag } from './template-tag-transform';
4
- import * as util from './util';
3
+ import { transformTemplateTag } from './template-tag-transform.ts';
4
+ import * as util from './util.ts';
5
5
 
6
6
  import type { NodePath } from '@babel/traverse';
7
7
  import type { CallExpression, Class, Program } from '@babel/types';
@@ -1,5 +1,5 @@
1
- import { expect } from './debug';
2
- import { TEMPLATE_TAG_NAME } from './util';
1
+ import { expect } from './debug.ts';
2
+ import { TEMPLATE_TAG_NAME } from './util.ts';
3
3
 
4
4
  export type TemplateMatch = TemplateTagMatch;
5
5
 
@@ -7,10 +7,10 @@ import { getTemplateLocals } from '@glimmer/syntax';
7
7
  import lineColumn from 'line-column';
8
8
  import MagicString from 'magic-string';
9
9
 
10
- import { expect } from './debug';
11
- import { parseTemplates } from './parse-templates';
10
+ import { expect } from './debug.ts';
11
+ import { parseTemplates } from './parse-templates.ts';
12
12
 
13
- import type { ParseTemplatesOptions, TemplateMatch } from './parse-templates';
13
+ import type { ParseTemplatesOptions, TemplateMatch } from './parse-templates.ts';
14
14
 
15
15
  interface PreprocessOptionsEager {
16
16
  importIdentifier?: string;
@@ -1,4 +1,4 @@
1
- import { buildPrecompileTemplateCall, registerRefs, TEMPLATE_TAG_NAME } from './util';
1
+ import { buildPrecompileTemplateCall, registerRefs, TEMPLATE_TAG_NAME } from './util.ts';
2
2
 
3
3
  /**
4
4
  * Supports the following syntaxes:
@@ -1,4 +1,4 @@
1
- import type { TemplateMatch } from './parse-templates';
1
+ import type { TemplateMatch } from './parse-templates.ts';
2
2
  import type { NodePath } from '@babel/traverse';
3
3
  import type { CallExpression } from '@babel/types';
4
4
  import type { ImportUtil } from 'babel-import-util';
@@ -3,11 +3,11 @@ import { importSync } from '@embroider/macros';
3
3
  import babelPluginEmberTemplateCompilation from 'babel-plugin-ember-template-compilation';
4
4
 
5
5
  // TODO: use real packages, and not these copied files from ember-template-imports
6
- import babelPluginIntermediateGJS from './eti/babel-plugin';
7
- import { preprocessEmbeddedTemplates } from './eti/preprocess';
8
- import { TEMPLATE_TAG_NAME, TEMPLATE_TAG_PLACEHOLDER } from './eti/util';
6
+ import babelPluginIntermediateGJS from './eti/babel-plugin.ts';
7
+ import { preprocessEmbeddedTemplates } from './eti/preprocess.ts';
8
+ import { TEMPLATE_TAG_NAME, TEMPLATE_TAG_PLACEHOLDER } from './eti/util.ts';
9
9
 
10
- import type { Babel } from './types';
10
+ import type { Babel } from './types.ts';
11
11
 
12
12
  const compiler = importSync('ember-source/dist/ember-template-compiler.js');
13
13
 
@@ -11,9 +11,9 @@ import { on } from '@ember/modifier';
11
11
  import { createTemplateFactory } from '@ember/template-factory';
12
12
  import { importSync } from '@embroider/macros';
13
13
 
14
- import { nameFor } from './utils';
14
+ import { nameFor } from './utils.ts';
15
15
 
16
- import type { CompileResult } from './types';
16
+ import type { CompileResult } from './types.ts';
17
17
  import type { ComponentLike } from '@glint/template';
18
18
 
19
19
  // These things are pre-bundled in the old system.
@@ -1,8 +1,8 @@
1
- export { compile, Compiled } from './compile';
2
- export { compileHBS } from './hbs';
3
- export { compileJS } from './js';
4
- export { modules as frameworkModules } from './known-modules';
5
- export { invocationName, invocationOf, nameFor } from './utils';
1
+ export { compile, Compiled } from './compile/index.ts';
2
+ export { compileHBS } from './hbs.ts';
3
+ export { compileJS } from './js.ts';
4
+ export { modules as frameworkModules } from './known-modules.ts';
5
+ export { invocationName, invocationOf, nameFor } from './utils.ts';
6
6
 
7
7
  // Public Types
8
8
  export type { CompileResult } from './types';
package/src/browser/js.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { compileJS as compileAMD } from './cjs';
2
- import { compileJS as compileESM } from './esm';
1
+ import { compileJS as compileAMD } from './cjs/index.ts';
2
+ import { compileJS as compileESM } from './esm/index.ts';
3
3
 
4
- import type { CompileResult, ExtraModules, Options } from './types';
4
+ import type { CompileResult, ExtraModules, Options } from './types.ts';
5
5
 
6
6
  /**
7
7
  * @public
@@ -1,4 +1,4 @@
1
- import { CACHE } from '../browser/compile/index';
1
+ import { CACHE } from '../browser/compile/index.ts';
2
2
 
3
3
  export function clearCompileCache() {
4
4
  CACHE.clear();
@@ -1,10 +0,0 @@
1
- import { ExtraModules } from "../types.js";
2
- import Component from '@glimmer/component';
3
- declare function evalSnippet(compiled: string, extraModules?: ExtraModules): {
4
- default: Component;
5
- services?: {
6
- [key: string]: unknown;
7
- };
8
- };
9
- export { evalSnippet };
10
- //# sourceMappingURL=browser/cjs/eval.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser/cjs/eval.d.ts","sourceRoot":"","sources":["../src/browser/cjs/eval.ts"],"names":[],"mappings":"AAGA,OAAO,gBAAqB,oBAAiB;AAC7C,OAAO,SAAc,MAAM,oBAAoB,CAAC;AAEhD,iBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,YAAY,GAAE,YAAiB,GAC9B;IACD,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CACvC,CAmBA"}
@@ -1,7 +0,0 @@
1
- import { CompileResult, ExtraModules } from "../types.js";
2
- interface Info {
3
- code: string;
4
- name: string;
5
- }
6
- declare function compileJS(code: string, extraModules?: ExtraModules): Promise<CompileResult>;
7
- export { Info, compileJS };
@@ -1,16 +0,0 @@
1
- import { CompileResult } from "../types.js";
2
- import { EvalImportMap, ScopeMap } from "./types.js";
3
- declare function compileGJS(gjsInput: string, importMap?: EvalImportMap): Promise<CompileResult>;
4
- declare function compileHBS(hbsInput: string, options?: {
5
- moduleName?: string;
6
- scope?: Record<string, unknown>;
7
- }): Promise<CompileResult>;
8
- declare function compileMD(glimdownInput: string, options?: {
9
- importMap?: EvalImportMap;
10
- topLevelScope?: ScopeMap;
11
- CopyComponent?: string;
12
- ShadowComponent?: string;
13
- }): Promise<CompileResult & {
14
- rootTemplate?: string;
15
- }>;
16
- export { compileGJS, compileHBS, compileMD };
@@ -1,7 +0,0 @@
1
- interface EvalImportMap {
2
- [moduleName: string]: ScopeMap;
3
- }
4
- interface ScopeMap {
5
- [localName: string]: unknown;
6
- }
7
- export { EvalImportMap, ScopeMap };
@@ -1,8 +0,0 @@
1
- import { CompileResult, ExtraModules } from "../types.js";
2
- interface Info {
3
- code: string;
4
- name: string;
5
- }
6
- declare function compileJS(code: string, extraModules?: ExtraModules): Promise<CompileResult>;
7
- declare function proxyToSkypack(code: string, extraModules?: ExtraModules): string;
8
- export { Info, compileJS, proxyToSkypack };
@@ -1,2 +0,0 @@
1
- declare function expect<T>(value: T | null | undefined, message: string): T;
2
- export { expect };
@@ -1,14 +0,0 @@
1
- import { TemplateMatch } from "./parse-templates.js";
2
- import { NodePath } from '@babel/traverse';
3
- import { CallExpression } from '@babel/types';
4
- import { ImportUtil } from 'babel-import-util';
5
- declare const TEMPLATE_TAG_NAME = "template";
6
- declare const TEMPLATE_TAG_PLACEHOLDER = "__GLIMMER_TEMPLATE";
7
- declare function isTemplateTag(callExpressionPath: NodePath<CallExpression>): boolean;
8
- declare function buildPrecompileTemplateCall(t: any, callExpressionPath: NodePath<CallExpression>, state: {
9
- importUtil: ImportUtil;
10
- }): CallExpression;
11
- declare function registerRefs(newPath: string | string[], getRefPaths: (path: string) => NodePath[]): void;
12
- declare function isSupportedScriptFileExtension(filePath: string): boolean;
13
- declare function isStrictMode(templateInfo: TemplateMatch): boolean;
14
- export { TEMPLATE_TAG_NAME, TEMPLATE_TAG_PLACEHOLDER, isTemplateTag, buildPrecompileTemplateCall, registerRefs, isSupportedScriptFileExtension, isStrictMode };
@@ -1,4 +0,0 @@
1
- import { Babel } from "./types.js";
2
- declare function preprocess(input: string, name: string): string;
3
- declare function transform(intermediate: string, name: string, options?: any): Promise<ReturnType<Babel['transform']>>;
4
- export { preprocess, transform };
@@ -1,6 +0,0 @@
1
- export { compile, Compiled } from "./compile/index.js";
2
- export { compileHBS } from "./hbs.js";
3
- export { compileJS } from "./js.js";
4
- export { modules as frameworkModules } from "./known-modules.js";
5
- export { invocationName, invocationOf, nameFor } from "./utils.js";
6
- export type { CompileResult } from "./types.js";
@@ -1,21 +0,0 @@
1
- import { availablePlugins, availablePresets, transform } from '@babel/standalone';
2
- import { ComponentLike } from '@glint/template';
3
- interface CompileResult {
4
- component?: ComponentLike;
5
- error?: Error;
6
- name: string;
7
- }
8
- interface Babel {
9
- availablePlugins: typeof availablePlugins;
10
- availablePresets: typeof availablePresets;
11
- transform: typeof transform;
12
- }
13
- type Options = {
14
- /**
15
- * @internal
16
- * @deprecated do not use - not under semver
17
- */
18
- skypack?: boolean;
19
- };
20
- type ExtraModules = Record<string, unknown>;
21
- export { CompileResult, Babel, Options, ExtraModules };
@@ -1,2 +0,0 @@
1
- declare function clearCompileCache(): void;
2
- export { clearCompileCache };