@glint/ember-tsc 1.1.2-unstable.27a551c → 1.2.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/LICENSE +21 -0
- package/README.md +1 -1
- package/package.json +11 -12
- package/src/config/loader.ts +23 -3
- package/src/transform/template/template-to-typescript.ts +11 -1
- package/src/volar/language-server.ts +34 -80
- package/lib/cli/run-volar-tsc.d.ts +0 -2
- package/lib/cli/run-volar-tsc.d.ts.map +0 -1
- package/lib/cli/run-volar-tsc.js +0 -32
- package/lib/cli/run-volar-tsc.js.map +0 -1
- package/lib/config/config.d.ts +0 -15
- package/lib/config/config.d.ts.map +0 -1
- package/lib/config/config.js +0 -21
- package/lib/config/config.js.map +0 -1
- package/lib/config/environment.d.ts +0 -26
- package/lib/config/environment.d.ts.map +0 -1
- package/lib/config/environment.js +0 -96
- package/lib/config/environment.js.map +0 -1
- package/lib/config/index.d.ts +0 -17
- package/lib/config/index.d.ts.map +0 -1
- package/lib/config/index.js +0 -26
- package/lib/config/index.js.map +0 -1
- package/lib/config/loader.d.ts +0 -25
- package/lib/config/loader.d.ts.map +0 -1
- package/lib/config/loader.js +0 -110
- package/lib/config/loader.js.map +0 -1
- package/lib/config/types.cjs +0 -3
- package/lib/config/types.cjs.map +0 -1
- package/lib/config/types.d.cts +0 -60
- package/lib/config/types.d.cts.map +0 -1
- package/lib/environment-ember-template-imports/-private/environment/common.d.ts +0 -13
- package/lib/environment-ember-template-imports/-private/environment/common.d.ts.map +0 -1
- package/lib/environment-ember-template-imports/-private/environment/common.js +0 -2
- package/lib/environment-ember-template-imports/-private/environment/common.js.map +0 -1
- package/lib/environment-ember-template-imports/-private/environment/index.d.ts +0 -3
- package/lib/environment-ember-template-imports/-private/environment/index.d.ts.map +0 -1
- package/lib/environment-ember-template-imports/-private/environment/index.js +0 -76
- package/lib/environment-ember-template-imports/-private/environment/index.js.map +0 -1
- package/lib/environment-ember-template-imports/-private/environment/preprocess.d.ts +0 -4
- package/lib/environment-ember-template-imports/-private/environment/preprocess.d.ts.map +0 -1
- package/lib/environment-ember-template-imports/-private/environment/preprocess.js +0 -73
- package/lib/environment-ember-template-imports/-private/environment/preprocess.js.map +0 -1
- package/lib/environment-ember-template-imports/-private/environment/transform.d.ts +0 -4
- package/lib/environment-ember-template-imports/-private/environment/transform.d.ts.map +0 -1
- package/lib/environment-ember-template-imports/-private/environment/transform.js +0 -134
- package/lib/environment-ember-template-imports/-private/environment/transform.js.map +0 -1
- package/lib/index.d.ts +0 -7
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -6
- package/lib/index.js.map +0 -1
- package/lib/plugins/g-compiler-errors.d.ts +0 -12
- package/lib/plugins/g-compiler-errors.d.ts.map +0 -1
- package/lib/plugins/g-compiler-errors.js +0 -58
- package/lib/plugins/g-compiler-errors.js.map +0 -1
- package/lib/plugins/g-template-tag-symbols.d.ts +0 -11
- package/lib/plugins/g-template-tag-symbols.d.ts.map +0 -1
- package/lib/plugins/g-template-tag-symbols.js +0 -48
- package/lib/plugins/g-template-tag-symbols.js.map +0 -1
- package/lib/plugins/utils.d.ts +0 -25
- package/lib/plugins/utils.d.ts.map +0 -1
- package/lib/plugins/utils.js +0 -63
- package/lib/plugins/utils.js.map +0 -1
- package/lib/transform/diagnostics/augmentation.d.ts +0 -4
- package/lib/transform/diagnostics/augmentation.d.ts.map +0 -1
- package/lib/transform/diagnostics/augmentation.js +0 -223
- package/lib/transform/diagnostics/augmentation.js.map +0 -1
- package/lib/transform/diagnostics/index.d.ts +0 -5
- package/lib/transform/diagnostics/index.d.ts.map +0 -1
- package/lib/transform/diagnostics/index.js +0 -2
- package/lib/transform/diagnostics/index.js.map +0 -1
- package/lib/transform/index.d.ts +0 -4
- package/lib/transform/index.d.ts.map +0 -1
- package/lib/transform/index.js +0 -2
- package/lib/transform/index.js.map +0 -1
- package/lib/transform/template/code-features.d.ts +0 -30
- package/lib/transform/template/code-features.d.ts.map +0 -1
- package/lib/transform/template/code-features.js +0 -26
- package/lib/transform/template/code-features.js.map +0 -1
- package/lib/transform/template/glimmer-ast-mapping-tree.d.ts +0 -80
- package/lib/transform/template/glimmer-ast-mapping-tree.d.ts.map +0 -1
- package/lib/transform/template/glimmer-ast-mapping-tree.js +0 -132
- package/lib/transform/template/glimmer-ast-mapping-tree.js.map +0 -1
- package/lib/transform/template/inlining/index.d.ts +0 -16
- package/lib/transform/template/inlining/index.d.ts.map +0 -1
- package/lib/transform/template/inlining/index.js +0 -21
- package/lib/transform/template/inlining/index.js.map +0 -1
- package/lib/transform/template/inlining/tagged-strings.d.ts +0 -8
- package/lib/transform/template/inlining/tagged-strings.d.ts.map +0 -1
- package/lib/transform/template/inlining/tagged-strings.js +0 -140
- package/lib/transform/template/inlining/tagged-strings.js.map +0 -1
- package/lib/transform/template/map-template-contents.d.ts +0 -121
- package/lib/transform/template/map-template-contents.d.ts.map +0 -1
- package/lib/transform/template/map-template-contents.js +0 -287
- package/lib/transform/template/map-template-contents.js.map +0 -1
- package/lib/transform/template/rewrite-module.d.ts +0 -22
- package/lib/transform/template/rewrite-module.d.ts.map +0 -1
- package/lib/transform/template/rewrite-module.js +0 -265
- package/lib/transform/template/rewrite-module.js.map +0 -1
- package/lib/transform/template/scope-stack.d.ts +0 -13
- package/lib/transform/template/scope-stack.d.ts.map +0 -1
- package/lib/transform/template/scope-stack.js +0 -28
- package/lib/transform/template/scope-stack.js.map +0 -1
- package/lib/transform/template/template-to-typescript.d.ts +0 -19
- package/lib/transform/template/template-to-typescript.d.ts.map +0 -1
- package/lib/transform/template/template-to-typescript.js +0 -1095
- package/lib/transform/template/template-to-typescript.js.map +0 -1
- package/lib/transform/template/transformed-module.d.ts +0 -111
- package/lib/transform/template/transformed-module.d.ts.map +0 -1
- package/lib/transform/template/transformed-module.js +0 -287
- package/lib/transform/template/transformed-module.js.map +0 -1
- package/lib/transform/util.d.ts +0 -7
- package/lib/transform/util.d.ts.map +0 -1
- package/lib/transform/util.js +0 -15
- package/lib/transform/util.js.map +0 -1
- package/lib/volar/ember-language-plugin.d.ts +0 -14
- package/lib/volar/ember-language-plugin.d.ts.map +0 -1
- package/lib/volar/ember-language-plugin.js +0 -91
- package/lib/volar/ember-language-plugin.js.map +0 -1
- package/lib/volar/gts-virtual-code.d.ts +0 -83
- package/lib/volar/gts-virtual-code.d.ts.map +0 -1
- package/lib/volar/gts-virtual-code.js +0 -210
- package/lib/volar/gts-virtual-code.js.map +0 -1
- package/lib/volar/language-server.d.ts +0 -2
- package/lib/volar/language-server.d.ts.map +0 -1
- package/lib/volar/language-server.js +0 -214
- package/lib/volar/language-server.js.map +0 -1
- package/lib/volar/script-snapshot.d.ts +0 -17
- package/lib/volar/script-snapshot.d.ts.map +0 -1
- package/lib/volar/script-snapshot.js +0 -24
- package/lib/volar/script-snapshot.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 The Ember TypeScript team and contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glint/ember-tsc",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"repository": "typed-ember/glint",
|
|
5
5
|
"description": "A CLI for performing typechecking on Glimmer templates",
|
|
6
6
|
"license": "MIT",
|
|
@@ -52,17 +52,11 @@
|
|
|
52
52
|
"ember-tsc": "bin/ember-tsc.js",
|
|
53
53
|
"glint-language-server": "bin/glint-language-server.js"
|
|
54
54
|
},
|
|
55
|
-
"scripts": {
|
|
56
|
-
"build": "tsc --build",
|
|
57
|
-
"dev": "tsc --watch",
|
|
58
|
-
"prepack": "pnpm build"
|
|
59
|
-
},
|
|
60
55
|
"peerDependencies": {
|
|
61
56
|
"typescript": ">=5.6.0"
|
|
62
57
|
},
|
|
63
58
|
"dependencies": {
|
|
64
59
|
"@glimmer/syntax": "^0.95.0",
|
|
65
|
-
"@glint/template": "1.7.5-unstable.27a551c",
|
|
66
60
|
"@volar/kit": "~2.4.28",
|
|
67
61
|
"@volar/language-core": "~2.4.28",
|
|
68
62
|
"@volar/language-server": "~2.4.28",
|
|
@@ -76,11 +70,11 @@
|
|
|
76
70
|
"volar-service-typescript": "~0.0.68",
|
|
77
71
|
"vscode-languageserver-protocol": "^3.17.5",
|
|
78
72
|
"vscode-languageserver-textdocument": "^1.0.12",
|
|
79
|
-
"vscode-uri": "^3.1.0"
|
|
73
|
+
"vscode-uri": "^3.1.0",
|
|
74
|
+
"@glint/template": "1.7.5"
|
|
80
75
|
},
|
|
81
76
|
"devDependencies": {
|
|
82
77
|
"@glimmer/component": "^2.0.0",
|
|
83
|
-
"@glint/type-test": "2.0.1-unstable.27a551c",
|
|
84
78
|
"@types/common-tags": "^1.8.0",
|
|
85
79
|
"@types/node": "^18.11.5",
|
|
86
80
|
"@types/semver": "^7.3.13",
|
|
@@ -90,11 +84,16 @@
|
|
|
90
84
|
"@vitest/ui": "~1.0.0",
|
|
91
85
|
"common-tags": "^1.8.0",
|
|
92
86
|
"execa": "^4.0.1",
|
|
93
|
-
"glint-monorepo-test-utils": "workspace:*",
|
|
94
87
|
"strip-ansi": "^6.0.0",
|
|
95
|
-
"typescript": "^5.9.3"
|
|
88
|
+
"typescript": "^5.9.3",
|
|
89
|
+
"glint-monorepo-test-utils": "0.0.0",
|
|
90
|
+
"@glint/type-test": "2.0.0"
|
|
96
91
|
},
|
|
97
92
|
"publishConfig": {
|
|
98
93
|
"access": "public"
|
|
94
|
+
},
|
|
95
|
+
"scripts": {
|
|
96
|
+
"build": "tsc --build",
|
|
97
|
+
"dev": "tsc --watch"
|
|
99
98
|
}
|
|
100
|
-
}
|
|
99
|
+
}
|
package/src/config/loader.ts
CHANGED
|
@@ -23,6 +23,15 @@ type TypeScript = typeof TS;
|
|
|
23
23
|
*/
|
|
24
24
|
export class ConfigLoader {
|
|
25
25
|
private configs = new Map<string, GlintConfig | null>();
|
|
26
|
+
private logInfo?: (message: string) => void;
|
|
27
|
+
|
|
28
|
+
constructor(logInfo?: (message: string) => void) {
|
|
29
|
+
this.logInfo = logInfo;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private log(message: string): void {
|
|
33
|
+
this.logInfo?.(message);
|
|
34
|
+
}
|
|
26
35
|
|
|
27
36
|
public configForFile(filePath: string): GlintConfig | null {
|
|
28
37
|
return this.configForDirectory(path.dirname(filePath));
|
|
@@ -30,17 +39,28 @@ export class ConfigLoader {
|
|
|
30
39
|
|
|
31
40
|
public configForDirectory(directory: string): GlintConfig | null {
|
|
32
41
|
let ts = findTypeScript(directory);
|
|
33
|
-
if (!ts)
|
|
42
|
+
if (!ts) {
|
|
43
|
+
this.log(`No TypeScript installation found from ${directory}.`);
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
34
46
|
|
|
35
47
|
let configPath = findNearestConfigFile(ts, directory);
|
|
36
|
-
if (!configPath)
|
|
48
|
+
if (!configPath) {
|
|
49
|
+
this.log(`No tsconfig.json or jsconfig.json found from ${directory}.`);
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
37
52
|
|
|
38
53
|
let existing = this.configs.get(configPath);
|
|
39
|
-
if (existing !== undefined)
|
|
54
|
+
if (existing !== undefined) {
|
|
55
|
+
this.log(`Using cached Glint config from ${configPath}.`);
|
|
56
|
+
return existing;
|
|
57
|
+
}
|
|
40
58
|
|
|
41
59
|
let configInput = loadConfigInput(ts, configPath);
|
|
42
60
|
let config = new GlintConfig(ts, configPath, configInput || { environment: [] });
|
|
43
61
|
|
|
62
|
+
this.log(`Loaded Glint config from ${configPath}.`);
|
|
63
|
+
|
|
44
64
|
this.configs.set(configPath, config);
|
|
45
65
|
|
|
46
66
|
return config;
|
|
@@ -562,6 +562,16 @@ export function templateToTypescript(
|
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
564
|
|
|
565
|
+
function emitQuotedTextNodeValue(node: AST.TextNode): void {
|
|
566
|
+
mapper.text('"');
|
|
567
|
+
mapper.identifier(
|
|
568
|
+
JSON.stringify(node.chars).slice(1, -1),
|
|
569
|
+
node.loc.getStart().offset! + prefix.length + 1,
|
|
570
|
+
node.chars.length,
|
|
571
|
+
);
|
|
572
|
+
mapper.text('"');
|
|
573
|
+
}
|
|
574
|
+
|
|
565
575
|
function emitConcatStatement(node: AST.ConcatStatement): void {
|
|
566
576
|
mapper.forNode(node, () => {
|
|
567
577
|
mapper.text('`');
|
|
@@ -671,7 +681,7 @@ export function templateToTypescript(
|
|
|
671
681
|
|
|
672
682
|
switch (attr.value.type) {
|
|
673
683
|
case 'TextNode':
|
|
674
|
-
|
|
684
|
+
emitQuotedTextNodeValue(attr.value);
|
|
675
685
|
break;
|
|
676
686
|
case 'ConcatStatement':
|
|
677
687
|
emitConcatStatement(attr.value);
|
|
@@ -17,6 +17,14 @@ const connection = createConnection();
|
|
|
17
17
|
const server = createServer(connection);
|
|
18
18
|
const tsserverRequestHandlers = new Map<number, (res: any) => void>();
|
|
19
19
|
|
|
20
|
+
const logInfo = (message: string): void => {
|
|
21
|
+
connection.console.info(`[Glint] ${message}`);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const logWarn = (message: string): void => {
|
|
25
|
+
connection.console.warn(`[Glint] ${message}`);
|
|
26
|
+
};
|
|
27
|
+
|
|
20
28
|
let tsserverRequestId = 0;
|
|
21
29
|
|
|
22
30
|
connection.listen();
|
|
@@ -32,6 +40,16 @@ connection.onNotification('tsserver/response', ([id, res]) => {
|
|
|
32
40
|
* other initialization params needed by the server.
|
|
33
41
|
*/
|
|
34
42
|
connection.onInitialize((params) => {
|
|
43
|
+
logInfo('Language server initializing.');
|
|
44
|
+
if (params.workspaceFolders && params.workspaceFolders.length > 0) {
|
|
45
|
+
const folders = params.workspaceFolders.map((folder) => folder.uri).join(', ');
|
|
46
|
+
logInfo(`Workspace folders: ${folders}`);
|
|
47
|
+
} else if (params.rootUri) {
|
|
48
|
+
logInfo(`Workspace root: ${params.rootUri}`);
|
|
49
|
+
} else {
|
|
50
|
+
logWarn('No workspace folder or root URI provided by client.');
|
|
51
|
+
}
|
|
52
|
+
|
|
35
53
|
const tsconfigProjects = createUriMap<LanguageService>();
|
|
36
54
|
|
|
37
55
|
server.fileWatcher.onDidChangeWatchedFiles((obj: any) => {
|
|
@@ -45,6 +63,8 @@ connection.onInitialize((params) => {
|
|
|
45
63
|
});
|
|
46
64
|
|
|
47
65
|
let simpleLs: LanguageService | undefined;
|
|
66
|
+
let warnedMissingProjectInfo = false;
|
|
67
|
+
let warnedSimpleLs = false;
|
|
48
68
|
|
|
49
69
|
return server.initialize(
|
|
50
70
|
params,
|
|
@@ -69,10 +89,17 @@ connection.onInitialize((params) => {
|
|
|
69
89
|
tsconfigProjects.set(URI.file(configFileName), ls);
|
|
70
90
|
}
|
|
71
91
|
return ls;
|
|
92
|
+
} else if (!warnedMissingProjectInfo) {
|
|
93
|
+
warnedMissingProjectInfo = true;
|
|
94
|
+
logWarn(`No tsserver project info for ${fileName}; falling back to simple LS.`);
|
|
72
95
|
}
|
|
73
96
|
}
|
|
74
97
|
// TODO: this branch is hit when running Volar Labs and currently breaks. Figure out
|
|
75
98
|
// how to reinstate a "simple" LS without a tsconfig.
|
|
99
|
+
if (!warnedSimpleLs) {
|
|
100
|
+
warnedSimpleLs = true;
|
|
101
|
+
logWarn('Using simple language service without a tsconfig/jsconfig.');
|
|
102
|
+
}
|
|
76
103
|
return (simpleLs ??= createLanguageServiceHelper(server, undefined));
|
|
77
104
|
},
|
|
78
105
|
getExistingLanguageServices() {
|
|
@@ -120,12 +147,17 @@ connection.onInitialize((params) => {
|
|
|
120
147
|
];
|
|
121
148
|
|
|
122
149
|
if (tsconfigFileName) {
|
|
123
|
-
const configLoader = new ConfigLoader();
|
|
150
|
+
const configLoader = new ConfigLoader(logInfo);
|
|
124
151
|
const glintConfig = configLoader.configForFile(tsconfigFileName);
|
|
125
152
|
if (glintConfig) {
|
|
153
|
+
logInfo(`Glint config active for ${tsconfigFileName}.`);
|
|
126
154
|
const emberLanguagePlugin = createEmberLanguagePlugin(glintConfig);
|
|
127
155
|
languagePlugins.push(emberLanguagePlugin);
|
|
156
|
+
} else {
|
|
157
|
+
logWarn(`Glint config not found for ${tsconfigFileName}; Glint features disabled.`);
|
|
128
158
|
}
|
|
159
|
+
} else {
|
|
160
|
+
logWarn('No tsconfig/jsconfig provided; Glint config cannot be resolved.');
|
|
129
161
|
}
|
|
130
162
|
|
|
131
163
|
const language = createLanguage<URI>(languagePlugins, createUriMap(), (uri) => {
|
|
@@ -167,84 +199,6 @@ function getHybridModeLanguageServicePluginsForLanguageServer(
|
|
|
167
199
|
|
|
168
200
|
function getCommonLanguageServicePluginsForLanguageServer(
|
|
169
201
|
getTsPluginClient: (context: LanguageServiceContext) => any,
|
|
170
|
-
// ) => import('@glint/tsserver/lib/requests').Requests | undefined,
|
|
171
202
|
): LanguageServicePlugin[] {
|
|
172
|
-
return [
|
|
173
|
-
createTemplateTagSymbolsPlugin(),
|
|
174
|
-
createCompilerErrorsPlugin(),
|
|
175
|
-
// createTypeScriptTwoslashQueriesPlugin(ts),
|
|
176
|
-
// createCssPlugin(),
|
|
177
|
-
// createPugFormatPlugin(),
|
|
178
|
-
// createJsonPlugin(),
|
|
179
|
-
// createVueTemplatePlugin('html', getTsPluginClient),
|
|
180
|
-
// createVueTemplatePlugin('pug', getTsPluginClient),
|
|
181
|
-
// createVueMissingPropsHintsPlugin(getTsPluginClient),
|
|
182
|
-
// createVueCompilerDomErrorsPlugin(),
|
|
183
|
-
// createVueSfcPlugin(),
|
|
184
|
-
// createVueTwoslashQueriesPlugin(getTsPluginClient),
|
|
185
|
-
// createVueDocumentLinksPlugin(),
|
|
186
|
-
// createVueDocumentDropPlugin(ts, getTsPluginClient),
|
|
187
|
-
// createVueCompleteDefineAssignmentPlugin(),
|
|
188
|
-
// createVueAutoDotValuePlugin(ts, getTsPluginClient),
|
|
189
|
-
// createVueAutoAddSpacePlugin(),
|
|
190
|
-
// createVueInlayHintsPlugin(ts),
|
|
191
|
-
// createVueDirectiveCommentsPlugin(),
|
|
192
|
-
// createVueExtractFilePlugin(ts, getTsPluginClient),
|
|
193
|
-
// createEmmetPlugin({
|
|
194
|
-
// mappedLanguages: {
|
|
195
|
-
// 'vue-root-tags': 'html',
|
|
196
|
-
// 'postcss': 'scss',
|
|
197
|
-
// },
|
|
198
|
-
// }),
|
|
199
|
-
// {
|
|
200
|
-
// name: 'vue-parse-sfc',
|
|
201
|
-
// capabilities: {
|
|
202
|
-
// executeCommandProvider: {
|
|
203
|
-
// commands: [commands.parseSfc],
|
|
204
|
-
// },
|
|
205
|
-
// },
|
|
206
|
-
// create() {
|
|
207
|
-
// return {
|
|
208
|
-
// executeCommand(_command, [source]) {
|
|
209
|
-
// return parse(source);
|
|
210
|
-
// },
|
|
211
|
-
// };
|
|
212
|
-
// },
|
|
213
|
-
// },
|
|
214
|
-
// {
|
|
215
|
-
// name: 'vue-name-casing',
|
|
216
|
-
// capabilities: {
|
|
217
|
-
// executeCommandProvider: {
|
|
218
|
-
// commands: [
|
|
219
|
-
// commands.detectNameCasing,
|
|
220
|
-
// commands.convertTagsToKebabCase,
|
|
221
|
-
// commands.convertTagsToPascalCase,
|
|
222
|
-
// commands.convertPropsToKebabCase,
|
|
223
|
-
// commands.convertPropsToCamelCase,
|
|
224
|
-
// ],
|
|
225
|
-
// }
|
|
226
|
-
// },
|
|
227
|
-
// create(context) {
|
|
228
|
-
// return {
|
|
229
|
-
// executeCommand(command, [uri]) {
|
|
230
|
-
// if (command === commands.detectNameCasing) {
|
|
231
|
-
// return detect(context, URI.parse(uri));
|
|
232
|
-
// }
|
|
233
|
-
// else if (command === commands.convertTagsToKebabCase) {
|
|
234
|
-
// return convertTagName(context, URI.parse(uri), TagNameCasing.Kebab, getTsPluginClient(context));
|
|
235
|
-
// }
|
|
236
|
-
// else if (command === commands.convertTagsToPascalCase) {
|
|
237
|
-
// return convertTagName(context, URI.parse(uri), TagNameCasing.Pascal, getTsPluginClient(context));
|
|
238
|
-
// }
|
|
239
|
-
// else if (command === commands.convertPropsToKebabCase) {
|
|
240
|
-
// return convertAttrName(context, URI.parse(uri), AttrNameCasing.Kebab, getTsPluginClient(context));
|
|
241
|
-
// }
|
|
242
|
-
// else if (command === commands.convertPropsToCamelCase) {
|
|
243
|
-
// return convertAttrName(context, URI.parse(uri), AttrNameCasing.Camel, getTsPluginClient(context));
|
|
244
|
-
// }
|
|
245
|
-
// },
|
|
246
|
-
// };
|
|
247
|
-
// },
|
|
248
|
-
// }
|
|
249
|
-
];
|
|
203
|
+
return [createTemplateTagSymbolsPlugin(), createCompilerErrorsPlugin()];
|
|
250
204
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-volar-tsc.d.ts","sourceRoot":"","sources":["../../src/cli/run-volar-tsc.ts"],"names":[],"mappings":"AAOA,wBAAgB,GAAG,IAAI,IAAI,CA6B1B"}
|
package/lib/cli/run-volar-tsc.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { runTsc } from '@volar/typescript/lib/quickstart/runTsc.js';
|
|
2
|
-
import { createEmberLanguagePlugin } from '../volar/ember-language-plugin.js';
|
|
3
|
-
import { findConfig } from '../config/index.js';
|
|
4
|
-
import { createRequire } from 'node:module';
|
|
5
|
-
const require = createRequire(import.meta.url);
|
|
6
|
-
export function run() {
|
|
7
|
-
let cwd = process.cwd();
|
|
8
|
-
const options = {
|
|
9
|
-
extraSupportedExtensions: ['.gjs', '.gts'],
|
|
10
|
-
// With the below configuration `{basename.gts}` will produce `{basename}.d.ts`
|
|
11
|
-
// This is in line with how V2 addons build their components.
|
|
12
|
-
// At build time, `.gts` components are emitted as `.js` files, so that's why the corresponding declarations should be `.d.ts`
|
|
13
|
-
//
|
|
14
|
-
// Please refer to https://github.com/typed-ember/glint/issues/988 for more information
|
|
15
|
-
//
|
|
16
|
-
// Before this option, glint emitted broken declarations in which relative imports to other .gts files did not strip extensions (https://github.com/typed-ember/glint/issues/628).
|
|
17
|
-
// The declarations outputted by volar's runTsc luckily also remove extension in imports.
|
|
18
|
-
extraExtensionsToRemove: ['.gjs', '.gts'],
|
|
19
|
-
};
|
|
20
|
-
const main = () => runTsc(require.resolve('typescript/lib/tsc'), options, (ts, options) => {
|
|
21
|
-
const glintConfig = findConfig(cwd);
|
|
22
|
-
if (glintConfig) {
|
|
23
|
-
const gtsLanguagePlugin = createEmberLanguagePlugin(glintConfig);
|
|
24
|
-
return [gtsLanguagePlugin];
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
return [];
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
main();
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=run-volar-tsc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-volar-tsc.js","sourceRoot":"","sources":["../../src/cli/run-volar-tsc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,4CAA4C,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,MAAM,UAAU,GAAG;IACjB,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAExB,MAAM,OAAO,GAAG;QACd,wBAAwB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;QAE1C,+EAA+E;QAC/E,6DAA6D;QAC7D,8HAA8H;QAC9H,EAAE;QACF,uFAAuF;QACvF,EAAE;QACF,kLAAkL;QAClL,yFAAyF;QACzF,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;KAC1C,CAAC;IAEF,MAAM,IAAI,GAAG,GAAS,EAAE,CACtB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE;QACrE,MAAM,WAAW,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;QAEpC,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,iBAAiB,GAAG,yBAAyB,CAAC,WAAW,CAAC,CAAC;YACjE,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAC7B,CAAC;aAAM,CAAC;YACN,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC,CAAC,CAAC;IACL,IAAI,EAAE,CAAC;AACT,CAAC"}
|
package/lib/config/config.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { GlintConfigInput } from '@glint/ember-tsc/config-types';
|
|
2
|
-
import { GlintEnvironment } from './environment.js';
|
|
3
|
-
/**
|
|
4
|
-
* This class represents parsed Glint configuration from a `tsconfig` or `jsconfig` file,
|
|
5
|
-
* with methods for interrogating project configuration based on its contents.
|
|
6
|
-
*/
|
|
7
|
-
export declare class GlintConfig {
|
|
8
|
-
readonly ts: typeof import('typescript');
|
|
9
|
-
readonly rootDir: string;
|
|
10
|
-
readonly configPath: string;
|
|
11
|
-
readonly environment: GlintEnvironment;
|
|
12
|
-
constructor(ts: typeof import('typescript'), configPath: string, config: GlintConfigInput);
|
|
13
|
-
}
|
|
14
|
-
export declare function normalizePath(fileName: string): string;
|
|
15
|
-
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;GAGG;AACH,qBAAa,WAAW;IACtB,SAAwB,EAAE,EAAE,cAAc,YAAY,CAAC,CAAC;IACxD,SAAgB,OAAO,EAAE,MAAM,CAAC;IAChC,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,WAAW,EAAE,gBAAgB,CAAC;gBAG5C,EAAE,EAAE,cAAc,YAAY,CAAC,EAC/B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,gBAAgB;CAO3B;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMtD"}
|
package/lib/config/config.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as path from 'node:path';
|
|
2
|
-
import { GlintEnvironment } from './environment.js';
|
|
3
|
-
/**
|
|
4
|
-
* This class represents parsed Glint configuration from a `tsconfig` or `jsconfig` file,
|
|
5
|
-
* with methods for interrogating project configuration based on its contents.
|
|
6
|
-
*/
|
|
7
|
-
export class GlintConfig {
|
|
8
|
-
constructor(ts, configPath, config) {
|
|
9
|
-
Object.defineProperty(this, 'ts', { value: ts });
|
|
10
|
-
this.configPath = normalizePath(configPath);
|
|
11
|
-
this.rootDir = path.dirname(configPath);
|
|
12
|
-
this.environment = GlintEnvironment.load(config);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export function normalizePath(fileName) {
|
|
16
|
-
if (path.sep !== '/') {
|
|
17
|
-
return fileName.split(path.sep).join('/');
|
|
18
|
-
}
|
|
19
|
-
return fileName;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=config.js.map
|
package/lib/config/config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;GAGG;AACH,MAAM,OAAO,WAAW;IAMtB,YACE,EAA+B,EAC/B,UAAkB,EAClB,MAAwB;QAExB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,UAAU,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;CACF;AAED,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,IAAI,IAAI,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;QACrB,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { GlintEnvironmentConfig, GlintExtensionConfig, GlintExtensionsConfig, GlintTagsConfig, SourceKind } from '@glint/ember-tsc/config-types';
|
|
2
|
-
export declare const DEFAULT_EXTENSIONS: GlintExtensionsConfig;
|
|
3
|
-
/**
|
|
4
|
-
* A GlintEnvironment represents the _merged_ configurations of one or more
|
|
5
|
-
* glint environments (e.g. ember-template-imports).
|
|
6
|
-
*/
|
|
7
|
-
export declare class GlintEnvironment {
|
|
8
|
-
readonly names: Array<string>;
|
|
9
|
-
private tagConfig;
|
|
10
|
-
private extensionsConfig;
|
|
11
|
-
constructor(names: Array<string>, config: GlintEnvironmentConfig);
|
|
12
|
-
static load(topLevelGlintConfigObject: any): GlintEnvironment;
|
|
13
|
-
getSourceKind(fileName: string): SourceKind | 'unknown';
|
|
14
|
-
isUntypedScript(path: string): boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Returns any custom configuration for the given file extension.
|
|
17
|
-
*/
|
|
18
|
-
getConfigForExtension(extension: string): GlintExtensionConfig | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* Returns an array of template tags that should be rewritten according to this
|
|
21
|
-
* config object, along with an import specifier indicating where the template types
|
|
22
|
-
* for each tag can be found.
|
|
23
|
-
*/
|
|
24
|
-
getConfiguredTemplateTags(): GlintTagsConfig;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/config/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,UAAU,EACX,MAAM,+BAA+B,CAAC;AAMvC,eAAO,MAAM,kBAAkB,EAAE,qBAGhC,CAAC;AAEF;;;GAGG;AACH,qBAAa,gBAAgB;aAKT,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;IAJtC,OAAO,CAAC,SAAS,CAAkB;IACnC,OAAO,CAAC,gBAAgB,CAAwB;gBAG9B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,EACpC,MAAM,EAAE,sBAAsB;WAOlB,IAAI,CAAC,yBAAyB,EAAE,GAAG,GAAG,gBAAgB;IAqE7D,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAKvD,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI7C;;OAEG;IACI,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS;IAIjF;;;;OAIG;IACI,yBAAyB,IAAI,eAAe;CAGpD"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import * as path from 'node:path';
|
|
2
|
-
import SilentError from 'silent-error';
|
|
3
|
-
import emberTemplateImportsEnvironment from '../environment-ember-template-imports/-private/environment/index.js';
|
|
4
|
-
export const DEFAULT_EXTENSIONS = {
|
|
5
|
-
'.js': { kind: 'untyped-script' },
|
|
6
|
-
'.ts': { kind: 'typed-script' },
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* A GlintEnvironment represents the _merged_ configurations of one or more
|
|
10
|
-
* glint environments (e.g. ember-template-imports).
|
|
11
|
-
*/
|
|
12
|
-
export class GlintEnvironment {
|
|
13
|
-
constructor(names, config) {
|
|
14
|
-
this.names = names;
|
|
15
|
-
this.tagConfig = config.tags ?? {};
|
|
16
|
-
// when is this populated? what is config?
|
|
17
|
-
this.extensionsConfig = config.extensions ?? {};
|
|
18
|
-
}
|
|
19
|
-
static load(topLevelGlintConfigObject) {
|
|
20
|
-
// Glint V1:
|
|
21
|
-
let additionalGlobals = null;
|
|
22
|
-
let additionalSpecialForms = {};
|
|
23
|
-
if (topLevelGlintConfigObject) {
|
|
24
|
-
if (topLevelGlintConfigObject.additionalGlobals ||
|
|
25
|
-
topLevelGlintConfigObject.additionalSpecialForms) {
|
|
26
|
-
additionalGlobals = topLevelGlintConfigObject.additionalGlobals;
|
|
27
|
-
additionalSpecialForms = topLevelGlintConfigObject.additionalSpecialForms ?? {};
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
if (Array.isArray(topLevelGlintConfigObject.environment)) {
|
|
31
|
-
// If it's a legacy array of environment names, e.g. ['ember-template-imports', 'ember-loose'],
|
|
32
|
-
// then there is no additional config such as additionalGlobals to extract.
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
if (typeof topLevelGlintConfigObject.environment === 'object') {
|
|
36
|
-
const emberTemplateImportsConfig = topLevelGlintConfigObject.environment?.['ember-template-imports'] ?? {};
|
|
37
|
-
additionalGlobals = emberTemplateImportsConfig.additionalGlobals ?? [];
|
|
38
|
-
additionalSpecialForms = emberTemplateImportsConfig.additionalSpecialForms ?? {};
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
let tags = {};
|
|
44
|
-
let extensions = { ...DEFAULT_EXTENSIONS };
|
|
45
|
-
const envUserConfig = { additionalGlobals, additionalSpecialForms };
|
|
46
|
-
let config = emberTemplateImportsEnvironment(envUserConfig);
|
|
47
|
-
if (config.tags) {
|
|
48
|
-
for (let [importSource, specifiers] of Object.entries(config.tags)) {
|
|
49
|
-
tags[importSource] ?? (tags[importSource] = {});
|
|
50
|
-
for (let [importSpecifier, tagConfig] of Object.entries(specifiers)) {
|
|
51
|
-
if (importSpecifier in tags[importSource]) {
|
|
52
|
-
throw new SilentError('Multiple configured Glint environments attempted to define behavior for the tag `' +
|
|
53
|
-
importSpecifier +
|
|
54
|
-
"` in module '" +
|
|
55
|
-
importSource +
|
|
56
|
-
"'.");
|
|
57
|
-
}
|
|
58
|
-
tags[importSource][importSpecifier] = tagConfig;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (config.extensions) {
|
|
63
|
-
for (let [extension, extensionConfig] of Object.entries(config.extensions)) {
|
|
64
|
-
if (extension in extensions) {
|
|
65
|
-
throw new SilentError('Multiple configured Glint environments attempted to define handling for the ' +
|
|
66
|
-
extension +
|
|
67
|
-
' file extension.');
|
|
68
|
-
}
|
|
69
|
-
extensions[extension] = extensionConfig;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return new GlintEnvironment(Object.keys(config), { tags, extensions });
|
|
73
|
-
}
|
|
74
|
-
getSourceKind(fileName) {
|
|
75
|
-
let extension = path.extname(fileName);
|
|
76
|
-
return this.extensionsConfig[extension]?.kind ?? 'unknown';
|
|
77
|
-
}
|
|
78
|
-
isUntypedScript(path) {
|
|
79
|
-
return this.getSourceKind(path) === 'untyped-script';
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Returns any custom configuration for the given file extension.
|
|
83
|
-
*/
|
|
84
|
-
getConfigForExtension(extension) {
|
|
85
|
-
return this.extensionsConfig[extension];
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Returns an array of template tags that should be rewritten according to this
|
|
89
|
-
* config object, along with an import specifier indicating where the template types
|
|
90
|
-
* for each tag can be found.
|
|
91
|
-
*/
|
|
92
|
-
getConfiguredTemplateTags() {
|
|
93
|
-
return this.tagConfig;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=environment.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/config/environment.ts"],"names":[],"mappings":"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"}
|
package/lib/config/index.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { GlintConfig } from './config.js';
|
|
2
|
-
export { GlintConfig } from './config.js';
|
|
3
|
-
export { GlintEnvironment } from './environment.js';
|
|
4
|
-
export { ConfigLoader, findTypeScript } from './loader.js';
|
|
5
|
-
/**
|
|
6
|
-
* Loads glint configuration, starting from the given directory
|
|
7
|
-
* and searching upwards and raising an error if no configuration
|
|
8
|
-
* is found.
|
|
9
|
-
*/
|
|
10
|
-
export declare function loadConfig(from: string): GlintConfig;
|
|
11
|
-
/**
|
|
12
|
-
* Loads glint configuration, starting from the given directory
|
|
13
|
-
* and searching upwards. Returns `null` if no configuration is
|
|
14
|
-
* found.
|
|
15
|
-
*/
|
|
16
|
-
export declare function findConfig(from: string): GlintConfig | null;
|
|
17
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAOpD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAE3D"}
|
package/lib/config/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import SilentError from 'silent-error';
|
|
2
|
-
import { ConfigLoader } from './loader.js';
|
|
3
|
-
export { GlintConfig } from './config.js';
|
|
4
|
-
export { GlintEnvironment } from './environment.js';
|
|
5
|
-
export { ConfigLoader, findTypeScript } from './loader.js';
|
|
6
|
-
/**
|
|
7
|
-
* Loads glint configuration, starting from the given directory
|
|
8
|
-
* and searching upwards and raising an error if no configuration
|
|
9
|
-
* is found.
|
|
10
|
-
*/
|
|
11
|
-
export function loadConfig(from) {
|
|
12
|
-
let config = findConfig(from);
|
|
13
|
-
if (!config) {
|
|
14
|
-
throw new SilentError(`Unable to find Glint configuration for ${from}`);
|
|
15
|
-
}
|
|
16
|
-
return config;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Loads glint configuration, starting from the given directory
|
|
20
|
-
* and searching upwards. Returns `null` if no configuration is
|
|
21
|
-
* found.
|
|
22
|
-
*/
|
|
23
|
-
export function findConfig(from) {
|
|
24
|
-
return new ConfigLoader().configForDirectory(from);
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
package/lib/config/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3D;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,IAAI,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,WAAW,CAAC,0CAA0C,IAAI,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI,YAAY,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC"}
|
package/lib/config/loader.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { GlintConfigInput } from '@glint/ember-tsc/config-types';
|
|
2
|
-
import type TS from 'typescript';
|
|
3
|
-
import { GlintConfig } from './config.js';
|
|
4
|
-
/**
|
|
5
|
-
* @private
|
|
6
|
-
*
|
|
7
|
-
* Only exported for testing purposes. Do not import.
|
|
8
|
-
*/
|
|
9
|
-
export declare const require: NodeJS.Require;
|
|
10
|
-
type TypeScript = typeof TS;
|
|
11
|
-
/**
|
|
12
|
-
* `ConfigLoader` provides an interface for finding the Glint config that
|
|
13
|
-
* applies to a given file or directory, ensuring that only a single instance
|
|
14
|
-
* of `GlintConfig` is ever created for a given `tsconfig.json` or
|
|
15
|
-
* `jsconfig.json` source file.
|
|
16
|
-
*/
|
|
17
|
-
export declare class ConfigLoader {
|
|
18
|
-
private configs;
|
|
19
|
-
configForFile(filePath: string): GlintConfig | null;
|
|
20
|
-
configForDirectory(directory: string): GlintConfig | null;
|
|
21
|
-
}
|
|
22
|
-
export declare function findTypeScript(fromDir: string): TypeScript | null;
|
|
23
|
-
export declare function loadConfigInput(ts: TypeScript, entryPath: string): GlintConfigInput | null;
|
|
24
|
-
export {};
|
|
25
|
-
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKjE,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;GAIG;AACH,eAAO,MAAM,OAAO,gBAAiC,CAAC;AAEtD,KAAK,UAAU,GAAG,OAAO,EAAE,CAAC;AAE5B;;;;;GAKG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAyC;IAEjD,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAInD,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;CAiBjE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAMjE;AAiDD,wBAAgB,eAAe,CAAC,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAE1F"}
|