@typespec/compiler 1.15.0-dev.3 → 1.15.0-dev.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.
- package/cmd/tsp-server.js +1 -1
- package/cmd/tsp.js +1 -1
- package/dist/manifest.js +2 -2
- package/dist/src/core/cli/actions/init.d.ts +2 -0
- package/dist/src/core/cli/actions/init.d.ts.map +1 -1
- package/dist/src/core/cli/actions/init.js.map +1 -1
- package/dist/src/core/cli/cli.d.ts +15 -1
- package/dist/src/core/cli/cli.d.ts.map +1 -1
- package/dist/src/core/cli/cli.js +38 -12
- package/dist/src/core/cli/cli.js.map +1 -1
- package/dist/src/core/cli/utils.d.ts +4 -4
- package/dist/src/core/cli/utils.d.ts.map +1 -1
- package/dist/src/core/cli/utils.js +6 -6
- package/dist/src/core/cli/utils.js.map +1 -1
- package/dist/src/init/core-templates.d.ts +2 -3
- package/dist/src/init/core-templates.d.ts.map +1 -1
- package/dist/src/init/core-templates.js +3 -9
- package/dist/src/init/core-templates.js.map +1 -1
- package/dist/src/init/init.d.ts +8 -7
- package/dist/src/init/init.d.ts.map +1 -1
- package/dist/src/init/init.js +37 -44
- package/dist/src/init/init.js.map +1 -1
- package/dist/src/init/scaffold.d.ts +4 -2
- package/dist/src/init/scaffold.d.ts.map +1 -1
- package/dist/src/init/scaffold.js +4 -4
- package/dist/src/init/scaffold.js.map +1 -1
- package/dist/src/init/template-source/file-system-template-source.d.ts +12 -0
- package/dist/src/init/template-source/file-system-template-source.d.ts.map +1 -0
- package/dist/src/init/template-source/file-system-template-source.js +15 -0
- package/dist/src/init/template-source/file-system-template-source.js.map +1 -0
- package/dist/src/init/template-source/host-template-source.d.ts +34 -0
- package/dist/src/init/template-source/host-template-source.d.ts.map +1 -0
- package/dist/src/init/template-source/host-template-source.js +48 -0
- package/dist/src/init/template-source/host-template-source.js.map +1 -0
- package/dist/src/init/template-source/in-memory-template-source.d.ts +21 -0
- package/dist/src/init/template-source/in-memory-template-source.d.ts.map +1 -0
- package/dist/src/init/template-source/in-memory-template-source.js +42 -0
- package/dist/src/init/template-source/in-memory-template-source.js.map +1 -0
- package/dist/src/init/template-source/index.d.ts +6 -0
- package/dist/src/init/template-source/index.d.ts.map +1 -0
- package/dist/src/init/template-source/index.js +5 -0
- package/dist/src/init/template-source/index.js.map +1 -0
- package/dist/src/init/template-source/remote-template-source.d.ts +13 -0
- package/dist/src/init/template-source/remote-template-source.d.ts.map +1 -0
- package/dist/src/init/template-source/remote-template-source.js +14 -0
- package/dist/src/init/template-source/remote-template-source.js.map +1 -0
- package/dist/src/init/template-source/types.d.ts +30 -0
- package/dist/src/init/template-source/types.d.ts.map +1 -0
- package/dist/src/init/template-source/types.js +2 -0
- package/dist/src/init/template-source/types.js.map +1 -0
- package/dist/src/internals/index.d.ts +2 -0
- package/dist/src/internals/index.d.ts.map +1 -1
- package/dist/src/internals/index.js +3 -0
- package/dist/src/internals/index.js.map +1 -1
- package/dist/src/internals/standalone.d.ts +15 -0
- package/dist/src/internals/standalone.d.ts.map +1 -0
- package/dist/src/internals/standalone.js +14 -0
- package/dist/src/internals/standalone.js.map +1 -0
- package/dist/src/runner.d.ts +1 -1
- package/dist/src/runner.d.ts.map +1 -1
- package/dist/src/runner.js +3 -11
- package/dist/src/runner.js.map +1 -1
- package/entrypoints/cli.js +3 -1
- package/package.json +6 -2
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { SystemHost } from "../core/types.js";
|
|
2
2
|
import type { InitTemplate, InitTemplateFile, InitTemplateLibrary, InitTemplateLibrarySpec } from "./init-template.js";
|
|
3
|
+
import type { TemplateSource } from "./template-source/index.js";
|
|
3
4
|
export declare const TypeSpecConfigFilename = "tspconfig.yaml";
|
|
4
5
|
export interface ScaffoldingConfig {
|
|
5
6
|
/** Template used to resolve that config */
|
|
6
7
|
template: InitTemplate;
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* Source the template was loaded from. Used to read the template's files during scaffolding.
|
|
10
|
+
* Optional: templates that declare no `files` never need it.
|
|
9
11
|
*/
|
|
10
|
-
|
|
12
|
+
source?: TemplateSource;
|
|
11
13
|
/**
|
|
12
14
|
* Directory full path where the project should be initialized.
|
|
13
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../src/init/scaffold.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../src/init/scaffold.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAQnD,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AAEvD,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,QAAQ,EAAE,YAAY,CAAC;IAEvB;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IAExB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,EAAE,uBAAuB,EAAE,CAAC;IAErC;;OAEG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEhC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/B;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,GAAG,uBAAuB,CAKtF;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACjC,iBAAiB,CAWnB;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,iBAOnF;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAOzF"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { stringify } from "yaml";
|
|
2
2
|
import { getDirectoryPath, joinPaths } from "../core/path-utils.js";
|
|
3
3
|
import { fetchLatestPackageManifest } from "../package-manger/npm-registry.js";
|
|
4
|
-
import { readUrlOrPath, resolveRelativeUrlOrPath } from "../utils/misc.js";
|
|
5
4
|
import { createFileTemplatingContext, render, } from "./file-templating.js";
|
|
6
5
|
export const TypeSpecConfigFilename = "tspconfig.yaml";
|
|
7
6
|
export function normalizeLibrary(library) {
|
|
@@ -14,7 +13,6 @@ export function makeScaffoldingConfig(template, config) {
|
|
|
14
13
|
return {
|
|
15
14
|
template,
|
|
16
15
|
libraries: config.libraries ?? template.libraries?.map(normalizeLibrary) ?? [],
|
|
17
|
-
baseUri: config.baseUri ?? ".",
|
|
18
16
|
name: config.name ?? "",
|
|
19
17
|
directory: config.directory ?? "",
|
|
20
18
|
parameters: config.parameters ?? {},
|
|
@@ -150,8 +148,10 @@ async function writeFiles(host, config) {
|
|
|
150
148
|
}
|
|
151
149
|
}
|
|
152
150
|
async function writeFile(host, config, context, file) {
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
if (config.source === undefined) {
|
|
152
|
+
throw new Error(`Cannot resolve template file "${file.path}": template was loaded without a source.`);
|
|
153
|
+
}
|
|
154
|
+
const template = await config.source.readFile(file.path);
|
|
155
155
|
const content = render(template.text, context);
|
|
156
156
|
const destinationFilePath = joinPaths(config.directory, file.destination);
|
|
157
157
|
// create folders in case they don't exist
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../../src/init/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../../src/init/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,EACL,2BAA2B,EAE3B,MAAM,GACP,MAAM,sBAAsB,CAAC;AAS9B,MAAM,CAAC,MAAM,sBAAsB,GAAG,gBAAgB,CAAC;AA2CvD,MAAM,UAAU,gBAAgB,CAAC,OAA4B;IAC3D,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAC3B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,QAAsB,EACtB,MAAkC;IAElC,OAAO;QACL,QAAQ;QACR,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,gBAAgB,CAAC,IAAI,EAAE;QAC9E,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,EAAE;QACvB,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,EAAE;QACjC,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,EAAE;QACnC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,IAAI,IAAI;QACjD,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,EAAE;Q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,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SystemHost } from "../../core/types.js";
|
|
2
|
+
import { UriTemplateSource } from "./host-template-source.js";
|
|
3
|
+
/** Default location of the compiler's built-in `tsp init` templates. */
|
|
4
|
+
export declare const CompilerCoreTemplatesRoot: string;
|
|
5
|
+
/**
|
|
6
|
+
* {@link TemplateSource} backed by a `templates/` directory on disk, read through the given
|
|
7
|
+
* {@link SystemHost}. This is the source used by a normally-installed compiler.
|
|
8
|
+
*/
|
|
9
|
+
export declare class FileSystemTemplateSource extends UriTemplateSource {
|
|
10
|
+
constructor(host: SystemHost, rootDir?: string);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=file-system-template-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-template-source.d.ts","sourceRoot":"","sources":["../../../../src/init/template-source/file-system-template-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,wEAAwE;AACxE,eAAO,MAAM,yBAAyB,QAAgD,CAAC;AAEvF;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,iBAAiB;gBACjD,IAAI,EAAE,UAAU,EAAE,OAAO,GAAE,MAAkC;CAG1E"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CompilerPackageRoot } from "../../core/node-host.js";
|
|
2
|
+
import { resolvePath } from "../../core/path-utils.js";
|
|
3
|
+
import { UriTemplateSource } from "./host-template-source.js";
|
|
4
|
+
/** Default location of the compiler's built-in `tsp init` templates. */
|
|
5
|
+
export const CompilerCoreTemplatesRoot = resolvePath(CompilerPackageRoot, "templates");
|
|
6
|
+
/**
|
|
7
|
+
* {@link TemplateSource} backed by a `templates/` directory on disk, read through the given
|
|
8
|
+
* {@link SystemHost}. This is the source used by a normally-installed compiler.
|
|
9
|
+
*/
|
|
10
|
+
export class FileSystemTemplateSource extends UriTemplateSource {
|
|
11
|
+
constructor(host, rootDir = CompilerCoreTemplatesRoot) {
|
|
12
|
+
super(host, rootDir);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=file-system-template-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system-template-source.js","sourceRoot":"","sources":["../../../../src/init/template-source/file-system-template-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,wEAAwE;AACxE,MAAM,CAAC,MAAM,yBAAyB,GAAG,WAAW,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;AAEvF;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,iBAAiB;IAC7D,YAAY,IAAgB,EAAE,UAAkB,yBAAyB;QACvE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { SourceFile, SystemHost } from "../../core/types.js";
|
|
2
|
+
import type { LoadedTemplateIndex, TemplateSource } from "./types.js";
|
|
3
|
+
/** File name of the template index within a template source root. */
|
|
4
|
+
export declare const SCAFFOLDING_FILENAME = "scaffolding.json";
|
|
5
|
+
/**
|
|
6
|
+
* A {@link TemplateSource} that reads through a {@link SystemHost}, resolving files relative to a
|
|
7
|
+
* base location (a directory path or a URL). Shared by the filesystem and remote sources, which only
|
|
8
|
+
* differ in where their index lives.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class HostTemplateSource implements TemplateSource {
|
|
11
|
+
protected readonly host: SystemHost;
|
|
12
|
+
/** Location of the index file (`scaffolding.json`) — a path or URL. */
|
|
13
|
+
private readonly indexLocation;
|
|
14
|
+
/** Base against which template file paths are resolved — a directory path or URL. */
|
|
15
|
+
private readonly baseUri;
|
|
16
|
+
constructor(host: SystemHost,
|
|
17
|
+
/** Location of the index file (`scaffolding.json`) — a path or URL. */
|
|
18
|
+
indexLocation: string,
|
|
19
|
+
/** Base against which template file paths are resolved — a directory path or URL. */
|
|
20
|
+
baseUri: string);
|
|
21
|
+
loadIndex(): Promise<LoadedTemplateIndex>;
|
|
22
|
+
readFile(relativePath: string): Promise<SourceFile>;
|
|
23
|
+
}
|
|
24
|
+
/** Derive the base directory (path or URL) that a template index at `indexLocation` sits in. */
|
|
25
|
+
export declare function baseUriOf(indexLocation: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* A {@link TemplateSource} for a template root (a directory path or URL) laid out with a
|
|
28
|
+
* `scaffolding.json` index at its root and template files resolved relative to it. Works for both
|
|
29
|
+
* on-disk template directories and remote directories served over HTTP.
|
|
30
|
+
*/
|
|
31
|
+
export declare class UriTemplateSource extends HostTemplateSource {
|
|
32
|
+
constructor(host: SystemHost, baseUri: string);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=host-template-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-template-source.d.ts","sourceRoot":"","sources":["../../../../src/init/template-source/host-template-source.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEtE,qEAAqE;AACrE,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AAEvD;;;;GAIG;AACH,8BAAsB,kBAAmB,YAAW,cAAc;IAE9D,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,UAAU;IACnC,uEAAuE;IACvE,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,qFAAqF;IACrF,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAJL,IAAI,EAAE,UAAU;IACnC,uEAAuE;IACtD,aAAa,EAAE,MAAM;IACtC,qFAAqF;IACpE,OAAO,EAAE,MAAM;IAG5B,SAAS,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAMzC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;CAK1D;AAED,gGAAgG;AAChG,wBAAgB,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,kBAAkB;gBAC3C,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM;CAG9C"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { getDirectoryPath } from "../../core/path-utils.js";
|
|
2
|
+
import { readUrlOrPath, resolveRelativeUrlOrPath } from "../../utils/misc.js";
|
|
3
|
+
/** File name of the template index within a template source root. */
|
|
4
|
+
export const SCAFFOLDING_FILENAME = "scaffolding.json";
|
|
5
|
+
/**
|
|
6
|
+
* A {@link TemplateSource} that reads through a {@link SystemHost}, resolving files relative to a
|
|
7
|
+
* base location (a directory path or a URL). Shared by the filesystem and remote sources, which only
|
|
8
|
+
* differ in where their index lives.
|
|
9
|
+
*/
|
|
10
|
+
export class HostTemplateSource {
|
|
11
|
+
host;
|
|
12
|
+
indexLocation;
|
|
13
|
+
baseUri;
|
|
14
|
+
constructor(host,
|
|
15
|
+
/** Location of the index file (`scaffolding.json`) — a path or URL. */
|
|
16
|
+
indexLocation,
|
|
17
|
+
/** Base against which template file paths are resolved — a directory path or URL. */
|
|
18
|
+
baseUri) {
|
|
19
|
+
this.host = host;
|
|
20
|
+
this.indexLocation = indexLocation;
|
|
21
|
+
this.baseUri = baseUri;
|
|
22
|
+
}
|
|
23
|
+
async loadIndex() {
|
|
24
|
+
const indexFile = await readUrlOrPath(this.host, this.indexLocation);
|
|
25
|
+
const templates = JSON.parse(indexFile.text);
|
|
26
|
+
return { templates, indexFile, baseUri: this.baseUri };
|
|
27
|
+
}
|
|
28
|
+
async readFile(relativePath) {
|
|
29
|
+
// Trailing slash so URL bases resolve `rel` inside the base rather than its parent; harmless for
|
|
30
|
+
// filesystem paths (resolvePath ignores it).
|
|
31
|
+
return readUrlOrPath(this.host, resolveRelativeUrlOrPath(this.baseUri + "/", relativePath));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/** Derive the base directory (path or URL) that a template index at `indexLocation` sits in. */
|
|
35
|
+
export function baseUriOf(indexLocation) {
|
|
36
|
+
return getDirectoryPath(indexLocation);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A {@link TemplateSource} for a template root (a directory path or URL) laid out with a
|
|
40
|
+
* `scaffolding.json` index at its root and template files resolved relative to it. Works for both
|
|
41
|
+
* on-disk template directories and remote directories served over HTTP.
|
|
42
|
+
*/
|
|
43
|
+
export class UriTemplateSource extends HostTemplateSource {
|
|
44
|
+
constructor(host, baseUri) {
|
|
45
|
+
super(host, resolveRelativeUrlOrPath(baseUri + "/", SCAFFOLDING_FILENAME), baseUri);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=host-template-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-template-source.js","sourceRoot":"","sources":["../../../../src/init/template-source/host-template-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAG9E,qEAAqE;AACrE,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,OAAgB,kBAAkB;IAEjB;IAEF;IAEA;IALnB,YACqB,IAAgB;IACnC,uEAAuE;IACtD,aAAqB;IACtC,qFAAqF;IACpE,OAAe;QAJb,SAAI,GAAJ,IAAI,CAAY;QAElB,kBAAa,GAAb,aAAa,CAAQ;QAErB,YAAO,GAAP,OAAO,CAAQ;IAC/B,CAAC;IAEJ,KAAK,CAAC,SAAS;QACb,MAAM,SAAS,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QACrE,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC7C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,YAAoB;QACjC,iGAAiG;QACjG,6CAA6C;QAC7C,OAAO,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,wBAAwB,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC;IAC9F,CAAC;CACF;AAED,gGAAgG;AAChG,MAAM,UAAU,SAAS,CAAC,aAAqB;IAC7C,OAAO,gBAAgB,CAAC,aAAa,CAAC,CAAC;AACzC,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,iBAAkB,SAAQ,kBAAkB;IACvD,YAAY,IAAgB,EAAE,OAAe;QAC3C,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,GAAG,GAAG,EAAE,oBAAoB,CAAC,EAAE,OAAO,CAAC,CAAC;IACtF,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SourceFile } from "../../core/types.js";
|
|
2
|
+
import type { LoadedTemplateIndex, TemplateSource } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* {@link TemplateSource} that serves templates from an in-memory map of POSIX-relative path to file
|
|
5
|
+
* contents (e.g. `"scaffolding.json"`, `"emitter-ts/package.json"`). Used by the standalone
|
|
6
|
+
* single-executable, which embeds the `templates/` tree as an asset and has no `templates/` dir on
|
|
7
|
+
* disk to read.
|
|
8
|
+
*/
|
|
9
|
+
export declare class InMemoryTemplateSource implements TemplateSource {
|
|
10
|
+
private readonly baseUri;
|
|
11
|
+
private readonly files;
|
|
12
|
+
/**
|
|
13
|
+
* @param files Map of POSIX path (relative to the templates root) to file contents.
|
|
14
|
+
* @param baseUri Synthetic base used for the {@link SourceFile} paths (diagnostics/display only).
|
|
15
|
+
*/
|
|
16
|
+
constructor(files: Readonly<Record<string, string>>, baseUri?: string);
|
|
17
|
+
loadIndex(): Promise<LoadedTemplateIndex>;
|
|
18
|
+
readFile(relativePath: string): Promise<SourceFile>;
|
|
19
|
+
private readFileSync;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=in-memory-template-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-memory-template-source.d.ts","sourceRoot":"","sources":["../../../../src/init/template-source/in-memory-template-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEtE;;;;;GAKG;AACH,qBAAa,sBAAuB,YAAW,cAAc;IASzD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAR1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA8B;IAEpD;;;OAGG;gBAED,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACtB,OAAO,SAA4B;IAKhD,SAAS,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAKzC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAIzD,OAAO,CAAC,YAAY;CAYrB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { joinPaths, normalizePath } from "../../core/path-utils.js";
|
|
2
|
+
import { createSourceFile } from "../../core/source-file.js";
|
|
3
|
+
import { SCAFFOLDING_FILENAME } from "./host-template-source.js";
|
|
4
|
+
/**
|
|
5
|
+
* {@link TemplateSource} that serves templates from an in-memory map of POSIX-relative path to file
|
|
6
|
+
* contents (e.g. `"scaffolding.json"`, `"emitter-ts/package.json"`). Used by the standalone
|
|
7
|
+
* single-executable, which embeds the `templates/` tree as an asset and has no `templates/` dir on
|
|
8
|
+
* disk to read.
|
|
9
|
+
*/
|
|
10
|
+
export class InMemoryTemplateSource {
|
|
11
|
+
baseUri;
|
|
12
|
+
files;
|
|
13
|
+
/**
|
|
14
|
+
* @param files Map of POSIX path (relative to the templates root) to file contents.
|
|
15
|
+
* @param baseUri Synthetic base used for the {@link SourceFile} paths (diagnostics/display only).
|
|
16
|
+
*/
|
|
17
|
+
constructor(files, baseUri = "/__typespec_templates__") {
|
|
18
|
+
this.baseUri = baseUri;
|
|
19
|
+
this.files = new Map(Object.entries(files).map(([key, value]) => [normalizeKey(key), value]));
|
|
20
|
+
}
|
|
21
|
+
async loadIndex() {
|
|
22
|
+
const indexFile = this.readFileSync(SCAFFOLDING_FILENAME);
|
|
23
|
+
return { templates: JSON.parse(indexFile.text), indexFile, baseUri: this.baseUri };
|
|
24
|
+
}
|
|
25
|
+
async readFile(relativePath) {
|
|
26
|
+
return this.readFileSync(relativePath);
|
|
27
|
+
}
|
|
28
|
+
readFileSync(relativePath) {
|
|
29
|
+
const key = normalizeKey(relativePath);
|
|
30
|
+
const content = this.files.get(key);
|
|
31
|
+
if (content === undefined) {
|
|
32
|
+
const error = new Error(`ENOENT: bundled template file not found, '${relativePath}'`);
|
|
33
|
+
error.code = "ENOENT";
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
return createSourceFile(content, joinPaths(this.baseUri, key));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function normalizeKey(path) {
|
|
40
|
+
return normalizePath(path).replace(/^\/+/, "");
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=in-memory-template-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-memory-template-source.js","sourceRoot":"","sources":["../../../../src/init/template-source/in-memory-template-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGjE;;;;;GAKG;AACH,MAAM,OAAO,sBAAsB;IASd;IARF,KAAK,CAA8B;IAEpD;;;OAGG;IACH,YACE,KAAuC,EACtB,UAAU,yBAAyB;QAAnC,YAAO,GAAP,OAAO,CAA4B;QAEpD,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAChG,CAAC;IAED,KAAK,CAAC,SAAS;QACb,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;QAC1D,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;IACrF,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,YAAoB;QACjC,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IACzC,CAAC;IAEO,YAAY,CAAC,YAAoB;QACvC,MAAM,GAAG,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,KAAK,GAA0B,IAAI,KAAK,CAC5C,6CAA6C,YAAY,GAAG,CAC7D,CAAC;YACF,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC;YACtB,MAAM,KAAK,CAAC;QACd,CAAC;QACD,OAAO,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;CACF;AAED,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { CompilerCoreTemplatesRoot, FileSystemTemplateSource, } from "./file-system-template-source.js";
|
|
2
|
+
export { UriTemplateSource } from "./host-template-source.js";
|
|
3
|
+
export { InMemoryTemplateSource } from "./in-memory-template-source.js";
|
|
4
|
+
export { RemoteTemplateSource } from "./remote-template-source.js";
|
|
5
|
+
export type { LoadedTemplateIndex, TemplateSource } from "./types.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/init/template-source/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { CompilerCoreTemplatesRoot, FileSystemTemplateSource, } from "./file-system-template-source.js";
|
|
2
|
+
export { UriTemplateSource } from "./host-template-source.js";
|
|
3
|
+
export { InMemoryTemplateSource } from "./in-memory-template-source.js";
|
|
4
|
+
export { RemoteTemplateSource } from "./remote-template-source.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/init/template-source/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { SystemHost } from "../../core/types.js";
|
|
2
|
+
import { HostTemplateSource } from "./host-template-source.js";
|
|
3
|
+
/**
|
|
4
|
+
* {@link TemplateSource} for a template index hosted at a URL (`tsp init <templatesUrl>`), read
|
|
5
|
+
* through the given {@link SystemHost}. Template files are resolved relative to the index URL.
|
|
6
|
+
*
|
|
7
|
+
* Loading an untrusted template can execute arbitrary code during scaffolding; callers are
|
|
8
|
+
* responsible for confirming the source with the user before using this.
|
|
9
|
+
*/
|
|
10
|
+
export declare class RemoteTemplateSource extends HostTemplateSource {
|
|
11
|
+
constructor(host: SystemHost, url: string);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=remote-template-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-template-source.d.ts","sourceRoot":"","sources":["../../../../src/init/template-source/remote-template-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAa,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE1E;;;;;;GAMG;AACH,qBAAa,oBAAqB,SAAQ,kBAAkB;gBAC9C,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM;CAG1C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { baseUriOf, HostTemplateSource } from "./host-template-source.js";
|
|
2
|
+
/**
|
|
3
|
+
* {@link TemplateSource} for a template index hosted at a URL (`tsp init <templatesUrl>`), read
|
|
4
|
+
* through the given {@link SystemHost}. Template files are resolved relative to the index URL.
|
|
5
|
+
*
|
|
6
|
+
* Loading an untrusted template can execute arbitrary code during scaffolding; callers are
|
|
7
|
+
* responsible for confirming the source with the user before using this.
|
|
8
|
+
*/
|
|
9
|
+
export class RemoteTemplateSource extends HostTemplateSource {
|
|
10
|
+
constructor(host, url) {
|
|
11
|
+
super(host, url, baseUriOf(url));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=remote-template-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-template-source.js","sourceRoot":"","sources":["../../../../src/init/template-source/remote-template-source.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,OAAO,oBAAqB,SAAQ,kBAAkB;IAC1D,YAAY,IAAgB,EAAE,GAAW;QACvC,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { SourceFile } from "../../core/types.js";
|
|
2
|
+
import type { InitTemplate } from "../init-template.js";
|
|
3
|
+
/** Result of loading a template index (the set of templates offered by a {@link TemplateSource}). */
|
|
4
|
+
export interface LoadedTemplateIndex {
|
|
5
|
+
/** Templates keyed by their id. */
|
|
6
|
+
readonly templates: Record<string, InitTemplate>;
|
|
7
|
+
/** Source file the index was parsed from. Used to position validation diagnostics. */
|
|
8
|
+
readonly indexFile: SourceFile;
|
|
9
|
+
/** Location the index was loaded from (a directory path or URL). Informational only. */
|
|
10
|
+
readonly baseUri: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A source of `tsp init` templates.
|
|
14
|
+
*
|
|
15
|
+
* Decouples template loading from the {@link import("../../core/types.js").CompilerHost} filesystem
|
|
16
|
+
* contract: `init` no longer reaches templates through `host.getExecutionRoot()`. Each context
|
|
17
|
+
* supplies an implementation instead:
|
|
18
|
+
* - {@link import("./file-system-template-source.js").FileSystemTemplateSource} for an installed
|
|
19
|
+
* compiler (reads the `templates/` dir off disk),
|
|
20
|
+
* - {@link import("./remote-template-source.js").RemoteTemplateSource} for `--templates-url`,
|
|
21
|
+
* - {@link import("./in-memory-template-source.js").InMemoryTemplateSource} for the standalone
|
|
22
|
+
* single-executable (serves templates embedded as assets).
|
|
23
|
+
*/
|
|
24
|
+
export interface TemplateSource {
|
|
25
|
+
/** Load the template index (metadata for every template this source offers). */
|
|
26
|
+
loadIndex(): Promise<LoadedTemplateIndex>;
|
|
27
|
+
/** Read a file referenced by a template, resolved relative to this source. */
|
|
28
|
+
readFile(relativePath: string): Promise<SourceFile>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/init/template-source/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,qGAAqG;AACrG,MAAM,WAAW,mBAAmB;IAClC,mCAAmC;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACjD,sFAAsF;IACtF,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B,wFAAwF;IACxF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,cAAc;IAC7B,gFAAgF;IAChF,SAAS,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1C,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/init/template-source/types.ts"],"names":[],"mappings":""}
|
|
@@ -6,6 +6,8 @@ export { resolveCompilerOptions } from "../config/config-to-options.js";
|
|
|
6
6
|
export { NodeSystemHost } from "../core/node-system-host.js";
|
|
7
7
|
export { InitTemplateSchema } from "../init/init-template.js";
|
|
8
8
|
export { makeScaffoldingConfig, scaffoldNewProject } from "../init/scaffold.js";
|
|
9
|
+
export { UriTemplateSource } from "../init/template-source/host-template-source.js";
|
|
10
|
+
export type { TemplateSource } from "../init/template-source/types.js";
|
|
9
11
|
export { resolveEntrypointFile } from "../server/entrypoint-resolver.js";
|
|
10
12
|
export { InternalCompileResult, ServerDiagnostic } from "../server/index.js";
|
|
11
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internals/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internals/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACpF,YAAY,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -9,5 +9,8 @@ export { resolveCompilerOptions } from "../config/config-to-options.js";
|
|
|
9
9
|
export { NodeSystemHost } from "../core/node-system-host.js";
|
|
10
10
|
export { InitTemplateSchema } from "../init/init-template.js";
|
|
11
11
|
export { makeScaffoldingConfig, scaffoldNewProject } from "../init/scaffold.js";
|
|
12
|
+
// Imported from host-template-source (not the barrel) to avoid pulling `node-host`'s top-level
|
|
13
|
+
// await, which would break browser/CommonJS consumers of `internals`.
|
|
14
|
+
export { UriTemplateSource } from "../init/template-source/host-template-source.js";
|
|
12
15
|
export { resolveEntrypointFile } from "../server/entrypoint-resolver.js";
|
|
13
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/internals/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,IAAI,CAAE,UAAkB,CAAC,6BAA6B,EAAE,CAAC;IACvD,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;AAC/F,CAAC;AAED,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/internals/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,IAAI,CAAE,UAAkB,CAAC,6BAA6B,EAAE,CAAC;IACvD,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;AAC/F,CAAC;AAED,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAChF,+FAA+F;AAC/F,sEAAsE;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAEpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal API used to build a self-contained ("standalone") TypeSpec CLI that bundles the compiler
|
|
3
|
+
* into a single executable.
|
|
4
|
+
*
|
|
5
|
+
* This is a separate entrypoint from `@typespec/compiler/internals` on purpose: `runTypeSpecCli`
|
|
6
|
+
* reaches into the CLI runner, which transitively loads `node-host` (top-level `await`) and Node
|
|
7
|
+
* built-ins. Keeping it out of the general `internals` barrel avoids forcing those onto every
|
|
8
|
+
* browser/CommonJS consumer of `internals` (e.g. the VS Code extension and the playground).
|
|
9
|
+
*
|
|
10
|
+
* DO NOT USE. Not part of the public API and may change at any time with no warning.
|
|
11
|
+
*/
|
|
12
|
+
export { runTypeSpecCli } from "../core/cli/cli.js";
|
|
13
|
+
export { InMemoryTemplateSource } from "../init/template-source/index.js";
|
|
14
|
+
export type { LoadedTemplateIndex, TemplateSource } from "../init/template-source/index.js";
|
|
15
|
+
//# sourceMappingURL=standalone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standalone.d.ts","sourceRoot":"","sources":["../../../src/internals/standalone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal API used to build a self-contained ("standalone") TypeSpec CLI that bundles the compiler
|
|
3
|
+
* into a single executable.
|
|
4
|
+
*
|
|
5
|
+
* This is a separate entrypoint from `@typespec/compiler/internals` on purpose: `runTypeSpecCli`
|
|
6
|
+
* reaches into the CLI runner, which transitively loads `node-host` (top-level `await`) and Node
|
|
7
|
+
* built-ins. Keeping it out of the general `internals` barrel avoids forcing those onto every
|
|
8
|
+
* browser/CommonJS consumer of `internals` (e.g. the VS Code extension and the playground).
|
|
9
|
+
*
|
|
10
|
+
* DO NOT USE. Not part of the public API and may change at any time with no warning.
|
|
11
|
+
*/
|
|
12
|
+
export { runTypeSpecCli } from "../core/cli/cli.js";
|
|
13
|
+
export { InMemoryTemplateSource } from "../init/template-source/index.js";
|
|
14
|
+
//# sourceMappingURL=standalone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standalone.js","sourceRoot":"","sources":["../../../src/internals/standalone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC"}
|
package/dist/src/runner.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Prevents loading two conflicting copies of TypeSpec modules from global and
|
|
6
6
|
* local package locations.
|
|
7
7
|
*/
|
|
8
|
-
export declare function runScript(relativePath: string
|
|
8
|
+
export declare function runScript(relativePath: string): Promise<void>;
|
|
9
9
|
//# sourceMappingURL=runner.d.ts.map
|
package/dist/src/runner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/runner.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAC,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/runner.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYnE"}
|
package/dist/src/runner.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readFile, realpath, stat } from "fs/promises";
|
|
2
2
|
import { join, resolve } from "path";
|
|
3
3
|
import { fileURLToPath, pathToFileURL } from "url";
|
|
4
4
|
import { resolveModule } from "./module-resolver/index.js";
|
|
@@ -9,13 +9,10 @@ import { resolveModule } from "./module-resolver/index.js";
|
|
|
9
9
|
* Prevents loading two conflicting copies of TypeSpec modules from global and
|
|
10
10
|
* local package locations.
|
|
11
11
|
*/
|
|
12
|
-
export async function runScript(relativePath
|
|
12
|
+
export async function runScript(relativePath) {
|
|
13
13
|
const packageRoot = await resolvePackageRoot();
|
|
14
14
|
if (packageRoot) {
|
|
15
|
-
|
|
16
|
-
if (!(await checkFileExists(script)) && backupPath) {
|
|
17
|
-
script = join(packageRoot, backupPath);
|
|
18
|
-
}
|
|
15
|
+
const script = join(packageRoot, relativePath);
|
|
19
16
|
const scriptUrl = pathToFileURL(script).toString();
|
|
20
17
|
await import(scriptUrl);
|
|
21
18
|
}
|
|
@@ -23,11 +20,6 @@ export async function runScript(relativePath, backupPath) {
|
|
|
23
20
|
throw new Error("Couldn't resolve TypeSpec compiler root. This is unexpected. Please file an issue at https://github.com/microsoft/typespec.");
|
|
24
21
|
}
|
|
25
22
|
}
|
|
26
|
-
function checkFileExists(file) {
|
|
27
|
-
return access(file)
|
|
28
|
-
.then(() => true)
|
|
29
|
-
.catch(() => false);
|
|
30
|
-
}
|
|
31
23
|
async function resolvePackageRoot() {
|
|
32
24
|
if (process.env.TYPESPEC_SKIP_COMPILER_RESOLVE === "1") {
|
|
33
25
|
return await getThisPackageRoot();
|
package/dist/src/runner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACnD,OAAO,EAAqB,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,YAAoB;IAClD,MAAM,WAAW,GAAG,MAAM,kBAAkB,EAAE,CAAC;IAE/C,IAAI,WAAW,EAAE,CAAC;QAChB,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QAC/C,MAAM,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CACb,6HAA6H,CAC9H,CAAC;IACJ,CAAC;AACH,CAAC;AAED,KAAK,UAAU,kBAAkB;IAC/B,IAAI,OAAO,CAAC,GAAG,CAAC,8BAA8B,KAAK,GAAG,EAAE,CAAC;QACvD,OAAO,MAAM,kBAAkB,EAAE,CAAC;IACpC,CAAC;IAED,IAAI,CAAC;QACH,MAAM,IAAI,GAAsB;YAC9B,QAAQ;YACR,QAAQ,EAAE,KAAK,EAAE,IAAY,EAAE,EAAE,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;YAC/D,IAAI;SACL,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,EAAE,oBAAoB,EAAE;YAC/D,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE;SACvB,CAAC,CAAC;QACH,IAAI,QAAQ,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CACb,2FAA2F,QAAQ,CAAC,IAAI,IAAI,CAC7G,CAAC;QACJ,CAAC;QACD,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,IAAI,GAAG,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;YACpC,mDAAmD;YACnD,OAAO,MAAM,kBAAkB,EAAE,CAAC;QACpC,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;AACH,CAAC;AAED,KAAK,UAAU,kBAAkB;IAC/B,OAAO,OAAO,CAAC,MAAM,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AAC7E,CAAC"}
|
package/entrypoints/cli.js
CHANGED
|
@@ -2,4 +2,6 @@
|
|
|
2
2
|
* File serving as an entrypoint to resolve a local tsp install from a global install.
|
|
3
3
|
* DO NOT MOVE or this will create a breaking change for user of global cli.
|
|
4
4
|
*/
|
|
5
|
-
import "../dist/src/core/cli/cli.js";
|
|
5
|
+
import { runTypeSpecCli } from "../dist/src/core/cli/cli.js";
|
|
6
|
+
|
|
7
|
+
await runTypeSpecCli();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/compiler",
|
|
3
|
-
"version": "1.15.0-dev.
|
|
3
|
+
"version": "1.15.0-dev.5",
|
|
4
4
|
"description": "TypeSpec compiler and standard library",
|
|
5
5
|
"author": "Microsoft Corporation",
|
|
6
6
|
"license": "MIT",
|
|
@@ -60,9 +60,13 @@
|
|
|
60
60
|
"./internals/prettier-formatter": {
|
|
61
61
|
"import": "./dist/src/internals/prettier-formatter.js"
|
|
62
62
|
},
|
|
63
|
+
"./internals/standalone": {
|
|
64
|
+
"import": "./dist/src/internals/standalone.js"
|
|
65
|
+
},
|
|
63
66
|
"./casing": {
|
|
64
67
|
"import": "./dist/src/casing/index.js"
|
|
65
|
-
}
|
|
68
|
+
},
|
|
69
|
+
"./package.json": "./package.json"
|
|
66
70
|
},
|
|
67
71
|
"browser": {
|
|
68
72
|
"./dist/src/core/node-host.js": "./dist/src/core/node-host.browser.js",
|