@alloy-js/typescript 0.1.0
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.txt +7 -0
- package/api-extractor.json +4 -0
- package/babel.config.cjs +4 -0
- package/dist/src/builtins/index.d.ts +2 -0
- package/dist/src/builtins/index.d.ts.map +1 -0
- package/dist/src/builtins/index.js +1 -0
- package/dist/src/builtins/index.js.map +1 -0
- package/dist/src/builtins/node.d.ts +183 -0
- package/dist/src/builtins/node.d.ts.map +1 -0
- package/dist/src/builtins/node.js +39 -0
- package/dist/src/builtins/node.js.map +1 -0
- package/dist/src/components/ArrayExpression.d.ts +7 -0
- package/dist/src/components/ArrayExpression.d.ts.map +1 -0
- package/dist/src/components/ArrayExpression.js +37 -0
- package/dist/src/components/ArrayExpression.js.map +1 -0
- package/dist/src/components/BarrelFile.d.ts +49 -0
- package/dist/src/components/BarrelFile.d.ts.map +1 -0
- package/dist/src/components/BarrelFile.js +73 -0
- package/dist/src/components/BarrelFile.js.map +1 -0
- package/dist/src/components/Block.d.ts +6 -0
- package/dist/src/components/Block.d.ts.map +1 -0
- package/dist/src/components/Block.js +11 -0
- package/dist/src/components/Block.js.map +1 -0
- package/dist/src/components/ClassDeclaration.d.ts +64 -0
- package/dist/src/components/ClassDeclaration.d.ts.map +1 -0
- package/dist/src/components/ClassDeclaration.js +122 -0
- package/dist/src/components/ClassDeclaration.js.map +1 -0
- package/dist/src/components/Declaration.d.ts +53 -0
- package/dist/src/components/Declaration.d.ts.map +1 -0
- package/dist/src/components/Declaration.js +60 -0
- package/dist/src/components/Declaration.js.map +1 -0
- package/dist/src/components/EnumDeclaration.d.ts +12 -0
- package/dist/src/components/EnumDeclaration.d.ts.map +1 -0
- package/dist/src/components/EnumDeclaration.js +48 -0
- package/dist/src/components/EnumDeclaration.js.map +1 -0
- package/dist/src/components/EnumMember.d.ts +28 -0
- package/dist/src/components/EnumMember.d.ts.map +1 -0
- package/dist/src/components/EnumMember.js +28 -0
- package/dist/src/components/EnumMember.js.map +1 -0
- package/dist/src/components/ExportStatement.d.ts +7 -0
- package/dist/src/components/ExportStatement.d.ts.map +1 -0
- package/dist/src/components/ExportStatement.js +15 -0
- package/dist/src/components/ExportStatement.js.map +1 -0
- package/dist/src/components/FunctionCallExpression.d.ts +7 -0
- package/dist/src/components/FunctionCallExpression.d.ts.map +1 -0
- package/dist/src/components/FunctionCallExpression.js +14 -0
- package/dist/src/components/FunctionCallExpression.js.map +1 -0
- package/dist/src/components/FunctionDeclaration.d.ts +29 -0
- package/dist/src/components/FunctionDeclaration.d.ts.map +1 -0
- package/dist/src/components/FunctionDeclaration.js +91 -0
- package/dist/src/components/FunctionDeclaration.js.map +1 -0
- package/dist/src/components/ImportStatement.d.ts +11 -0
- package/dist/src/components/ImportStatement.d.ts.map +1 -0
- package/dist/src/components/ImportStatement.js +92 -0
- package/dist/src/components/ImportStatement.js.map +1 -0
- package/dist/src/components/Interface.d.ts +32 -0
- package/dist/src/components/Interface.d.ts.map +1 -0
- package/dist/src/components/Interface.js +50 -0
- package/dist/src/components/Interface.js.map +1 -0
- package/dist/src/components/ObjectExpression.d.ts +16 -0
- package/dist/src/components/ObjectExpression.d.ts.map +1 -0
- package/dist/src/components/ObjectExpression.js +101 -0
- package/dist/src/components/ObjectExpression.js.map +1 -0
- package/dist/src/components/PackageDirectory.d.ts +23 -0
- package/dist/src/components/PackageDirectory.d.ts.map +1 -0
- package/dist/src/components/PackageDirectory.js +62 -0
- package/dist/src/components/PackageDirectory.js.map +1 -0
- package/dist/src/components/PackageJson.d.ts +16 -0
- package/dist/src/components/PackageJson.d.ts.map +1 -0
- package/dist/src/components/PackageJson.js +36 -0
- package/dist/src/components/PackageJson.js.map +1 -0
- package/dist/src/components/Reference.d.ts +6 -0
- package/dist/src/components/Reference.d.ts.map +1 -0
- package/dist/src/components/Reference.js +8 -0
- package/dist/src/components/Reference.js.map +1 -0
- package/dist/src/components/SourceFile.d.ts +15 -0
- package/dist/src/components/SourceFile.d.ts.map +1 -0
- package/dist/src/components/SourceFile.js +62 -0
- package/dist/src/components/SourceFile.js.map +1 -0
- package/dist/src/components/TsConfigJson.d.ts +5 -0
- package/dist/src/components/TsConfigJson.d.ts.map +1 -0
- package/dist/src/components/TsConfigJson.js +53 -0
- package/dist/src/components/TsConfigJson.js.map +1 -0
- package/dist/src/components/TypeDeclaration.d.ts +5 -0
- package/dist/src/components/TypeDeclaration.d.ts.map +1 -0
- package/dist/src/components/TypeDeclaration.js +14 -0
- package/dist/src/components/TypeDeclaration.js.map +1 -0
- package/dist/src/components/ValueExpression.d.ts +5 -0
- package/dist/src/components/ValueExpression.d.ts.map +1 -0
- package/dist/src/components/ValueExpression.js +32 -0
- package/dist/src/components/ValueExpression.js.map +1 -0
- package/dist/src/components/VarDeclaration.d.ts +11 -0
- package/dist/src/components/VarDeclaration.d.ts.map +1 -0
- package/dist/src/components/VarDeclaration.js +29 -0
- package/dist/src/components/VarDeclaration.js.map +1 -0
- package/dist/src/components/index.d.ts +22 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/index.js +22 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/components/stc/index.d.ts +102 -0
- package/dist/src/components/stc/index.d.ts.map +1 -0
- package/dist/src/components/stc/index.js +28 -0
- package/dist/src/components/stc/index.js.map +1 -0
- package/dist/src/create-package.d.ts +33 -0
- package/dist/src/create-package.d.ts.map +1 -0
- package/dist/src/create-package.js +50 -0
- package/dist/src/create-package.js.map +1 -0
- package/dist/src/index.d.ts +7 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +7 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/name-conflict-resolver.d.ts +3 -0
- package/dist/src/name-conflict-resolver.d.ts.map +1 -0
- package/dist/src/name-conflict-resolver.js +15 -0
- package/dist/src/name-conflict-resolver.js.map +1 -0
- package/dist/src/name-policy.d.ts +5 -0
- package/dist/src/name-policy.d.ts.map +1 -0
- package/dist/src/name-policy.js +23 -0
- package/dist/src/name-policy.js.map +1 -0
- package/dist/src/source-directory-data.d.ts +7 -0
- package/dist/src/source-directory-data.d.ts.map +1 -0
- package/dist/src/source-directory-data.js +13 -0
- package/dist/src/source-directory-data.js.map +1 -0
- package/dist/src/symbols/index.d.ts +7 -0
- package/dist/src/symbols/index.d.ts.map +1 -0
- package/dist/src/symbols/index.js +7 -0
- package/dist/src/symbols/index.js.map +1 -0
- package/dist/src/symbols/reference.d.ts +3 -0
- package/dist/src/symbols/reference.d.ts.map +1 -0
- package/dist/src/symbols/reference.js +75 -0
- package/dist/src/symbols/reference.js.map +1 -0
- package/dist/src/symbols/scopes.d.ts +16 -0
- package/dist/src/symbols/scopes.d.ts.map +1 -0
- package/dist/src/symbols/scopes.js +5 -0
- package/dist/src/symbols/scopes.js.map +1 -0
- package/dist/src/symbols/ts-member-scope.d.ts +9 -0
- package/dist/src/symbols/ts-member-scope.d.ts.map +1 -0
- package/dist/src/symbols/ts-member-scope.js +10 -0
- package/dist/src/symbols/ts-member-scope.js.map +1 -0
- package/dist/src/symbols/ts-module-scope.d.ts +19 -0
- package/dist/src/symbols/ts-module-scope.d.ts.map +1 -0
- package/dist/src/symbols/ts-module-scope.js +36 -0
- package/dist/src/symbols/ts-module-scope.js.map +1 -0
- package/dist/src/symbols/ts-output-symbol.d.ts +28 -0
- package/dist/src/symbols/ts-output-symbol.d.ts.map +1 -0
- package/dist/src/symbols/ts-output-symbol.js +30 -0
- package/dist/src/symbols/ts-output-symbol.js.map +1 -0
- package/dist/src/symbols/ts-package-scope.d.ts +54 -0
- package/dist/src/symbols/ts-package-scope.d.ts.map +1 -0
- package/dist/src/symbols/ts-package-scope.js +40 -0
- package/dist/src/symbols/ts-package-scope.js.map +1 -0
- package/dist/src/utils.d.ts +2 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/src/utils.js +7 -0
- package/dist/src/utils.js.map +1 -0
- package/dist/test/array.test.d.ts +2 -0
- package/dist/test/array.test.d.ts.map +1 -0
- package/dist/test/barrel.test.d.ts +2 -0
- package/dist/test/barrel.test.d.ts.map +1 -0
- package/dist/test/basic.test.d.ts +2 -0
- package/dist/test/basic.test.d.ts.map +1 -0
- package/dist/test/class.test.d.ts +2 -0
- package/dist/test/class.test.d.ts.map +1 -0
- package/dist/test/enum.test.d.ts +2 -0
- package/dist/test/enum.test.d.ts.map +1 -0
- package/dist/test/externals.test.d.ts +2 -0
- package/dist/test/externals.test.d.ts.map +1 -0
- package/dist/test/function-call-expression.test.d.ts +2 -0
- package/dist/test/function-call-expression.test.d.ts.map +1 -0
- package/dist/test/function-declaration.test.d.ts +2 -0
- package/dist/test/function-declaration.test.d.ts.map +1 -0
- package/dist/test/imports.test.d.ts +2 -0
- package/dist/test/imports.test.d.ts.map +1 -0
- package/dist/test/interface.test.d.ts +2 -0
- package/dist/test/interface.test.d.ts.map +1 -0
- package/dist/test/name-policy.test.d.ts +2 -0
- package/dist/test/name-policy.test.d.ts.map +1 -0
- package/dist/test/package-external.test.d.ts +2 -0
- package/dist/test/package-external.test.d.ts.map +1 -0
- package/dist/test/package.test.d.ts +2 -0
- package/dist/test/package.test.d.ts.map +1 -0
- package/dist/test/reference.test.d.ts +2 -0
- package/dist/test/reference.test.d.ts.map +1 -0
- package/dist/test/utils.d.ts +5 -0
- package/dist/test/utils.d.ts.map +1 -0
- package/dist/test/values.test.d.ts +2 -0
- package/dist/test/values.test.d.ts.map +1 -0
- package/dist/test/var-declaration.test.d.ts +2 -0
- package/dist/test/var-declaration.test.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +49 -0
- package/src/builtins/index.ts +1 -0
- package/src/builtins/node.ts +219 -0
- package/src/components/ArrayExpression.tsx +41 -0
- package/src/components/BarrelFile.tsx +96 -0
- package/src/components/Block.tsx +12 -0
- package/src/components/ClassDeclaration.tsx +145 -0
- package/src/components/Declaration.tsx +105 -0
- package/src/components/EnumDeclaration.tsx +53 -0
- package/src/components/EnumMember.tsx +52 -0
- package/src/components/ExportStatement.tsx +21 -0
- package/src/components/FunctionCallExpression.tsx +15 -0
- package/src/components/FunctionDeclaration.tsx +132 -0
- package/src/components/ImportStatement.tsx +131 -0
- package/src/components/Interface.tsx +62 -0
- package/src/components/ObjectExpression.tsx +130 -0
- package/src/components/PackageDirectory.tsx +104 -0
- package/src/components/PackageJson.tsx +69 -0
- package/src/components/Reference.tsx +12 -0
- package/src/components/SourceFile.tsx +71 -0
- package/src/components/TsConfigJson.tsx +62 -0
- package/src/components/TypeDeclaration.tsx +10 -0
- package/src/components/ValueExpression.tsx +32 -0
- package/src/components/VarDeclaration.tsx +42 -0
- package/src/components/index.ts +21 -0
- package/src/components/stc/index.ts +28 -0
- package/src/create-package.ts +108 -0
- package/src/index.ts +6 -0
- package/src/name-conflict-resolver.ts +22 -0
- package/src/name-policy.ts +39 -0
- package/src/source-directory-data.ts +25 -0
- package/src/symbols/index.ts +6 -0
- package/src/symbols/reference.ts +120 -0
- package/src/symbols/scopes.ts +28 -0
- package/src/symbols/ts-member-scope.ts +23 -0
- package/src/symbols/ts-module-scope.ts +66 -0
- package/src/symbols/ts-output-symbol.ts +63 -0
- package/src/symbols/ts-package-scope.ts +112 -0
- package/src/utils.ts +7 -0
- package/temp/api.json +9866 -0
- package/test/array.test.tsx +14 -0
- package/test/barrel.test.tsx +46 -0
- package/test/basic.test.tsx +78 -0
- package/test/class.test.tsx +181 -0
- package/test/enum.test.tsx +132 -0
- package/test/externals.test.tsx +139 -0
- package/test/function-call-expression.test.tsx +49 -0
- package/test/function-declaration.test.tsx +201 -0
- package/test/imports.test.tsx +213 -0
- package/test/interface.test.tsx +124 -0
- package/test/name-policy.test.tsx +62 -0
- package/test/package-external.test.tsx +75 -0
- package/test/package.test.tsx +68 -0
- package/test/reference.test.tsx +59 -0
- package/test/utils.tsx +59 -0
- package/test/values.test.tsx +292 -0
- package/test/var-declaration.test.tsx +45 -0
- package/test/vitest.d.ts +10 -0
- package/tsconfig.json +11 -0
- package/tsdoc-metadata.json +11 -0
- package/vitest.config.ts +18 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { effect, memo, SourceFile } from "@alloy-js/core";
|
|
3
|
+
import { dirname, join, relative, sep } from "pathe";
|
|
4
|
+
import { usePackage } from "./PackageDirectory.js";
|
|
5
|
+
export function TSConfigJson(props) {
|
|
6
|
+
const pkg = usePackage();
|
|
7
|
+
if (!pkg) {
|
|
8
|
+
throw new Error("TSConfigJson component needs to be inside a PackageDirectory");
|
|
9
|
+
}
|
|
10
|
+
const outDir = props.outDir ?? "dist";
|
|
11
|
+
const includeDirs = memo(() => {
|
|
12
|
+
const rootDirs = new Set();
|
|
13
|
+
for (const mod of pkg.scope.modules) {
|
|
14
|
+
const rootDir = dirname(mod.name).split(sep)[0];
|
|
15
|
+
rootDirs.add(rootDir);
|
|
16
|
+
}
|
|
17
|
+
if (rootDirs.has(".")) {
|
|
18
|
+
return ["."];
|
|
19
|
+
} else {
|
|
20
|
+
return Array.from(rootDirs);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
effect(() => {
|
|
24
|
+
const dirs = includeDirs();
|
|
25
|
+
if (dirs.length === 1) {
|
|
26
|
+
pkg.outFileMapper.value = path => join(outDir, relative(dirs[0], path));
|
|
27
|
+
} else {
|
|
28
|
+
pkg.outFileMapper.value = path => join(outDir, path);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const jsonContent = memo(() => {
|
|
32
|
+
const jsonContent = {
|
|
33
|
+
compilerOptions: {
|
|
34
|
+
target: "esnext",
|
|
35
|
+
module: "nodenext",
|
|
36
|
+
strict: true,
|
|
37
|
+
declaration: true,
|
|
38
|
+
sourceMap: true,
|
|
39
|
+
declarationMap: true,
|
|
40
|
+
outDir: "dist"
|
|
41
|
+
},
|
|
42
|
+
include: includeDirs().map(d => `${d}/**/*.ts`),
|
|
43
|
+
exclude: ["node_modules", "dist"]
|
|
44
|
+
};
|
|
45
|
+
return JSON.stringify(jsonContent, null, 2);
|
|
46
|
+
});
|
|
47
|
+
return _$createComponent(SourceFile, {
|
|
48
|
+
path: "tsconfig.json",
|
|
49
|
+
filetype: "json",
|
|
50
|
+
children: jsonContent
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=TsConfigJson.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TsConfigJson.js","names":["effect","memo","SourceFile","dirname","join","relative","sep","usePackage","TSConfigJson","props","pkg","Error","outDir","includeDirs","rootDirs","Set","mod","scope","modules","rootDir","name","split","add","has","Array","from","dirs","length","outFileMapper","value","path","jsonContent","compilerOptions","target","module","strict","declaration","sourceMap","declarationMap","include","map","d","exclude","JSON","stringify","_$createComponent","filetype","children"],"sources":["../../../src/components/TsConfigJson.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,MAAM,EAAEC,IAAI,EAAEC,UAAU,QAAQ,gBAAgB;AACzD,SAASC,OAAO,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,GAAG,QAAQ,OAAO;AACpD,SAASC,UAAU,QAAQ,uBAAuB;AAMlD,OAAO,SAASC,YAAYA,CAACC,KAAwB,EAAE;EACrD,MAAMC,GAAG,GAAGH,UAAU,CAAC,CAAC;EACxB,IAAI,CAACG,GAAG,EAAE;IACR,MAAM,IAAIC,KAAK,CACb,8DACF,CAAC;EACH;EACA,MAAMC,MAAM,GAAGH,KAAK,CAACG,MAAM,IAAI,MAAM;EACrC,MAAMC,WAAW,GAAGZ,IAAI,CAAC,MAAM;IAC7B,MAAMa,QAAQ,GAAG,IAAIC,GAAG,CAAS,CAAC;IAClC,KAAK,MAAMC,GAAG,IAAIN,GAAG,CAACO,KAAK,CAACC,OAAO,EAAE;MACnC,MAAMC,OAAO,GAAGhB,OAAO,CAACa,GAAG,CAACI,IAAI,CAAC,CAACC,KAAK,CAACf,GAAG,CAAC,CAAC,CAAC,CAAC;MA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C,QAAA,EAC7ChB;EAAW;AAEhB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeDeclaration.d.ts","sourceRoot":"","sources":["../../../src/components/TypeDeclaration.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAe,MAAM,kBAAkB,CAAC;AAErE,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;CAAG;AAErE,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,OAI1D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { mergeProps as _$mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
3
|
+
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
4
|
+
import { Name } from "@alloy-js/core";
|
|
5
|
+
import { Declaration } from "./Declaration.js";
|
|
6
|
+
export function TypeDeclaration(props) {
|
|
7
|
+
return _$createComponent(Declaration, _$mergeProps(props, {
|
|
8
|
+
nameKind: "type",
|
|
9
|
+
get children() {
|
|
10
|
+
return ["type ", _$createComponent(Name, {}), " = ", _$memo(() => props.children), ";"];
|
|
11
|
+
}
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=TypeDeclaration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TypeDeclaration.js","names":["Name","Declaration","TypeDeclaration","props","_$createComponent","_$mergeProps","nameKind","children","_$memo"],"sources":["../../../src/components/TypeDeclaration.tsx"],"sourcesContent":[null],"mappings":";;;AAAA,SAASA,IAAI,QAAQ,gBAAgB;AACrC,SAA+BC,WAAW,QAAQ,kBAAkB;AAIpE,OAAO,SAASC,eAAeA,CAACC,KAA2B,EAAE;EAC3D,OAAAC,iBAAA,CAAQH,WAAW,EAAAI,YAAA,CAAKF,KAAK;IAAEG,QAAQ;IAAA,IAAAC,SAAA;MAAA,iBAAAH,iBAAA,CAC/BJ,IAAI,cAAAQ,MAAA,OAAOL,KAAK,CAACI,QAAQ;IAAA;EAAA;AAEnC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValueExpression.d.ts","sourceRoot":"","sources":["../../../src/components/ValueExpression.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,aAuB1D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { memo } from "@alloy-js/core";
|
|
3
|
+
import { ArrayExpression } from "./ArrayExpression.js";
|
|
4
|
+
import { ObjectExpression } from "./ObjectExpression.js";
|
|
5
|
+
export function ValueExpression(props) {
|
|
6
|
+
return memo(() => {
|
|
7
|
+
const jsValue = props.jsValue;
|
|
8
|
+
if (typeof jsValue === "undefined") {
|
|
9
|
+
return "undefined";
|
|
10
|
+
} else if (typeof jsValue === "number" || typeof jsValue === "boolean") {
|
|
11
|
+
return String(jsValue);
|
|
12
|
+
} else if (typeof jsValue === "string") {
|
|
13
|
+
return `"${jsValue}"`;
|
|
14
|
+
} else if (typeof jsValue === "object") {
|
|
15
|
+
if (jsValue === null) {
|
|
16
|
+
return "null";
|
|
17
|
+
} else if (Array.isArray(jsValue)) {
|
|
18
|
+
return _$createComponent(ArrayExpression, {
|
|
19
|
+
jsValue: jsValue
|
|
20
|
+
});
|
|
21
|
+
} else {
|
|
22
|
+
return _$createComponent(ObjectExpression, {
|
|
23
|
+
jsValue: jsValue
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
} else if (typeof jsValue === "function") {
|
|
27
|
+
// functions are inserted as-is.
|
|
28
|
+
return jsValue;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=ValueExpression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValueExpression.js","names":["memo","ArrayExpression","ObjectExpression","ValueExpression","props","jsValue","String","Array","isArray","_$createComponent"],"sources":["../../../src/components/ValueExpression.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,IAAI,QAAQ,gBAAgB;AACrC,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,gBAAgB,QAAQ,uBAAuB;AAMxD,OAAO,SAASC,eAAeA,CAACC,KAA2B,EAAE;EAC3D,OAAOJ,IAAI,CAAC,MAAM;IAChB,MAAMK,OAAO,GAAGD,KAAK,CAACC,OAAO;IAE7B,IAAI,OAAOA,OAAO,KAAK,WAAW,EAAE;MAClC,OAAO,WAAW;IACpB,CAAC,MAAM,IAAI,OAAOA,OAAO,KAAK,QAAQ,IAAI,OAAOA,OAAO,KAAK,SAAS,EAAE;MACtE,OAAOC,MAAM,CAACD,OAAO,CAAC;IACxB,CAAC,MAAM,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;MACtC,OAAO,IAAIA,OAAO,GAAG;IACvB,CAAC,MAAM,IAAI,OAAOA,OAAO,KAAK,QAAQ,EAAE;MACtC,IAAIA,OAAO,KAAK,IAAI,EAAE;QACpB,OAAO,MAAM;MACf,CAAC,MAAM,IAAIE,KAAK,CAACC,OAAO,CAACH,OAAO,CAAC,EAAE;QACjC,OAAAI,iBAAA,CAAQR,eAAe;UAACI,OAAO,EAAEA;QAAO;MAC1C,CAAC,MAAM;QACL,OAAAI,iBAAA,CAAQP,gBAAgB;UAACG,OAAO,EAAEA;QAAO;MAC3C;IACF,CAAC,MAAM,IAAI,OAAOA,OAAO,KAAK,UAAU,EAAE;MACxC;MACA,OAAOA,OAAO;IAChB;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Children } from "@alloy-js/core";
|
|
2
|
+
import { BaseDeclarationProps } from "./Declaration.js";
|
|
3
|
+
export interface VarDeclarationProps extends BaseDeclarationProps {
|
|
4
|
+
const?: boolean;
|
|
5
|
+
let?: boolean;
|
|
6
|
+
var?: boolean;
|
|
7
|
+
value?: Children;
|
|
8
|
+
type?: Children;
|
|
9
|
+
}
|
|
10
|
+
export declare function VarDeclaration(props: VarDeclarationProps): any;
|
|
11
|
+
//# sourceMappingURL=VarDeclaration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VarDeclaration.d.ts","sourceRoot":"","sources":["../../../src/components/VarDeclaration.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAKT,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,OAqBxD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
3
|
+
import { AssignmentContext, Declaration as CoreDeclaration, createAssignmentContext, Name, refkey } from "@alloy-js/core";
|
|
4
|
+
import { useTSNamePolicy } from "../name-policy.js";
|
|
5
|
+
import { createTSSymbol } from "../symbols/index.js";
|
|
6
|
+
export function VarDeclaration(props) {
|
|
7
|
+
const keyword = props.var ? "var" : props.let ? "let" : "const";
|
|
8
|
+
const type = props.type ? [": ", _$memo(() => props.type)] : undefined;
|
|
9
|
+
const name = useTSNamePolicy().getName(props.name, "variable");
|
|
10
|
+
const sym = createTSSymbol({
|
|
11
|
+
name: name,
|
|
12
|
+
refkey: props.refkey ?? refkey(name),
|
|
13
|
+
default: props.default,
|
|
14
|
+
export: props.export
|
|
15
|
+
});
|
|
16
|
+
const assignmentContext = createAssignmentContext(sym);
|
|
17
|
+
return _$createComponent(CoreDeclaration, {
|
|
18
|
+
symbol: sym,
|
|
19
|
+
get children() {
|
|
20
|
+
return [_$memo(() => props.export ? "export " : ""), _$memo(() => props.default ? "default " : ""), keyword, " ", _$createComponent(Name, {}), type, " = ", _$createComponent(AssignmentContext.Provider, {
|
|
21
|
+
value: assignmentContext,
|
|
22
|
+
get children() {
|
|
23
|
+
return [_$memo(() => props.value ?? props.children), ";"];
|
|
24
|
+
}
|
|
25
|
+
})];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=VarDeclaration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VarDeclaration.js","names":["AssignmentContext","Declaration","CoreDeclaration","createAssignmentContext","Name","refkey","useTSNamePolicy","createTSSymbol","VarDeclaration","props","keyword","var","let","type","_$memo","undefined","name","getName","sym","default","export","assignmentContext","_$createComponent","symbol","children","Provider","value"],"sources":["../../../src/components/VarDeclaration.tsx"],"sourcesContent":[null],"mappings":";;AAAA,SACEA,iBAAiB,EAEjBC,WAAW,IAAIC,eAAe,EAC9BC,uBAAuB,EACvBC,IAAI,EACJC,MAAM,QACD,gBAAgB;AACvB,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,cAAc,QAAQ,qBAAqB;AAWpD,OAAO,SAASC,cAAcA,CAACC,KAA0B,EAAE;EACzD,MAAMC,OAAO,GACXD,KAAK,CAACE,GAAG,GAAG,KAAK,GACfF,KAAK,CAACG,GAAG,GAAG,KAAK,GACjB,OAAO;EACX,MAAMC,IAAI,GAAGJ,KAAK,CAACI,IAAI,UAAAC,MAAA,OAAQL,KAAK,CAACI,IAAI,KAAOE,SAAS;EACzD,MAAMC,IAAI,GAAGV,eAAe,CAAC,CAAC,CAACW,OAAO,CAACR,KAAK,CAACO,IAAI,EAAE,UAAU,CAAC;EAC9D,MAAME,GAAG,GAAGX,cAAc,CAAC;IACzBS,IAAI,EAAEA,IAAI;IACVX,MAAM,EAAEI,KAAK,CAACJ,MAAM,IAAIA,MAAM,CAACW,IAAI,CAAC;IACpCG,OAAO,EAAEV,KAAK,CAACU,OAAO;IACtBC,MAAM,EAAEX,KAAK,CAACW;EAChB,CAAC,CAAC;EAEF,MAAMC,iBAAiB,GAAGlB,uBAAuB,CAACe,GAAG,CAAC;EAEtD,OAAAI,iBAAA,CAAQpB,eAAe;IAACqB,MAAM,EAAEL,GAAG;IAAA,IAAAM,SAAA;MAAA,QAAAV,MAAA,OAChCL,KAAK,CAACW,MAAM,GAAG,SAAS,GAAG,EAAE,GAAAN,MAAA,OAAEL,KAAK,CAACU,OAAO,GAAG,UAAU,GAAG,EAAE,GAAET,OAAO,OAAAY,iBAAA,CAAGlB,IAAI,OAAIS,IAAI,SAAAS,iBAAA,CAAKtB,iBAAiB,CAACyB,QAAQ;QAACC,KAAK,EAAEL,iBAAiB;QAAA,IAAAG,SAAA;UAAA,QAAAV,MAAA,OAC5IL,KAAK,CAACiB,KAAK,IAAIjB,KAAK,CAACe,QAAQ;QAAA;MAAA;IAAA;EAAA;AAGpC","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from "./ArrayExpression.js";
|
|
2
|
+
export * from "./BarrelFile.js";
|
|
3
|
+
export * from "./Block.js";
|
|
4
|
+
export * from "./ClassDeclaration.jsx";
|
|
5
|
+
export * from "./Declaration.js";
|
|
6
|
+
export * from "./EnumDeclaration.js";
|
|
7
|
+
export * from "./EnumMember.js";
|
|
8
|
+
export * from "./ExportStatement.js";
|
|
9
|
+
export * from "./FunctionCallExpression.js";
|
|
10
|
+
export * from "./FunctionDeclaration.js";
|
|
11
|
+
export * from "./ImportStatement.js";
|
|
12
|
+
export * from "./Interface.js";
|
|
13
|
+
export * from "./ObjectExpression.js";
|
|
14
|
+
export * from "./PackageDirectory.js";
|
|
15
|
+
export * from "./PackageJson.js";
|
|
16
|
+
export * from "./Reference.js";
|
|
17
|
+
export * from "./SourceFile.js";
|
|
18
|
+
export * from "./TsConfigJson.js";
|
|
19
|
+
export * from "./TypeDeclaration.js";
|
|
20
|
+
export * from "./ValueExpression.js";
|
|
21
|
+
export * from "./VarDeclaration.js";
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from "./ArrayExpression.js";
|
|
2
|
+
export * from "./BarrelFile.js";
|
|
3
|
+
export * from "./Block.js";
|
|
4
|
+
export * from "./ClassDeclaration.js";
|
|
5
|
+
export * from "./Declaration.js";
|
|
6
|
+
export * from "./EnumDeclaration.js";
|
|
7
|
+
export * from "./EnumMember.js";
|
|
8
|
+
export * from "./ExportStatement.js";
|
|
9
|
+
export * from "./FunctionCallExpression.js";
|
|
10
|
+
export * from "./FunctionDeclaration.js";
|
|
11
|
+
export * from "./ImportStatement.js";
|
|
12
|
+
export * from "./Interface.js";
|
|
13
|
+
export * from "./ObjectExpression.js";
|
|
14
|
+
export * from "./PackageDirectory.js";
|
|
15
|
+
export * from "./PackageJson.js";
|
|
16
|
+
export * from "./Reference.js";
|
|
17
|
+
export * from "./SourceFile.js";
|
|
18
|
+
export * from "./TsConfigJson.js";
|
|
19
|
+
export * from "./TypeDeclaration.js";
|
|
20
|
+
export * from "./ValueExpression.js";
|
|
21
|
+
export * from "./VarDeclaration.js";
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc,sBAAsB;AACpC,cAAc,iBAAiB;AAC/B,cAAc,YAAY;AAC1B;AACA,cAAc,kBAAkB;AAChC,cAAc,sBAAsB;AACpC,cAAc,iBAAiB;AAC/B,cAAc,sBAAsB;AACpC,cAAc,6BAA6B;AAC3C,cAAc,0BAA0B;AACxC,cAAc,sBAAsB;AACpC,cAAc,gBAAgB;AAC9B,cAAc,uBAAuB;AACrC,cAAc,uBAAuB;AACrC,cAAc,kBAAkB;AAChC,cAAc,gBAAgB;AAC9B,cAAc,iBAAiB;AAC/B,cAAc,mBAAmB;AACjC,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,qBAAqB","ignoreList":[]}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as base from "../index.js";
|
|
2
|
+
export declare const ArrayExpression: (props?: base.ArrayExpressionProps | undefined) => import("@alloy-js/core").ComponentCreator<base.ArrayExpressionProps> & {
|
|
3
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ArrayExpressionProps>;
|
|
4
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ArrayExpressionProps>;
|
|
5
|
+
};
|
|
6
|
+
export declare const BarrelFile: (props?: base.BarrelFileProps | undefined) => import("@alloy-js/core").ComponentCreator<base.BarrelFileProps> & {
|
|
7
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.BarrelFileProps>;
|
|
8
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.BarrelFileProps>;
|
|
9
|
+
};
|
|
10
|
+
export declare const Block: (props?: base.BlockProps | undefined) => import("@alloy-js/core").ComponentCreator<base.BlockProps> & {
|
|
11
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.BlockProps>;
|
|
12
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.BlockProps>;
|
|
13
|
+
};
|
|
14
|
+
export declare const Declaration: (props: base.DeclarationProps) => import("@alloy-js/core").ComponentCreator<base.DeclarationProps> & {
|
|
15
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.DeclarationProps>;
|
|
16
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.DeclarationProps>;
|
|
17
|
+
};
|
|
18
|
+
export declare const EnumDeclaration: (props: base.EnumDeclarationProps) => import("@alloy-js/core").ComponentCreator<base.EnumDeclarationProps> & {
|
|
19
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.EnumDeclarationProps>;
|
|
20
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.EnumDeclarationProps>;
|
|
21
|
+
};
|
|
22
|
+
export declare const EnumMember: (props: base.EnumMemberProps) => import("@alloy-js/core").ComponentCreator<base.EnumMemberProps> & {
|
|
23
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.EnumMemberProps>;
|
|
24
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.EnumMemberProps>;
|
|
25
|
+
};
|
|
26
|
+
export declare const ExportStatement: (props?: base.ExportStatementProps | undefined) => import("@alloy-js/core").ComponentCreator<base.ExportStatementProps> & {
|
|
27
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ExportStatementProps>;
|
|
28
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ExportStatementProps>;
|
|
29
|
+
};
|
|
30
|
+
export declare const FunctionDeclaration: (props: base.FunctionDeclarationProps) => import("@alloy-js/core").ComponentCreator<base.FunctionDeclarationProps> & {
|
|
31
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.FunctionDeclarationProps>;
|
|
32
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.FunctionDeclarationProps>;
|
|
33
|
+
};
|
|
34
|
+
export declare const ImportStatement: (props: base.ImportStatementProps) => import("@alloy-js/core").ComponentCreator<base.ImportStatementProps> & {
|
|
35
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ImportStatementProps>;
|
|
36
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ImportStatementProps>;
|
|
37
|
+
};
|
|
38
|
+
export declare const ImportStatements: (props: base.ImportStatementsProps) => import("@alloy-js/core").ComponentCreator<base.ImportStatementsProps> & {
|
|
39
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ImportStatementsProps>;
|
|
40
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ImportStatementsProps>;
|
|
41
|
+
};
|
|
42
|
+
export declare const InterfaceDeclaration: (props: base.InterfaceDeclarationProps) => import("@alloy-js/core").ComponentCreator<base.InterfaceDeclarationProps> & {
|
|
43
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.InterfaceDeclarationProps>;
|
|
44
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.InterfaceDeclarationProps>;
|
|
45
|
+
};
|
|
46
|
+
export declare const InterfaceExpression: (props?: base.InterfaceExpressionProps | undefined) => import("@alloy-js/core").ComponentCreator<base.InterfaceExpressionProps> & {
|
|
47
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.InterfaceExpressionProps>;
|
|
48
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.InterfaceExpressionProps>;
|
|
49
|
+
};
|
|
50
|
+
export declare const InterfaceMember: (props?: base.InterfaceMemberProps | undefined) => import("@alloy-js/core").ComponentCreator<base.InterfaceMemberProps> & {
|
|
51
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.InterfaceMemberProps>;
|
|
52
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.InterfaceMemberProps>;
|
|
53
|
+
};
|
|
54
|
+
export declare const ObjectExpression: (props?: base.ObjectExpressionProps | undefined) => import("@alloy-js/core").ComponentCreator<base.ObjectExpressionProps> & {
|
|
55
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ObjectExpressionProps>;
|
|
56
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ObjectExpressionProps>;
|
|
57
|
+
};
|
|
58
|
+
export declare const ObjectProperty: (props?: base.ObjectPropertyProps | undefined) => import("@alloy-js/core").ComponentCreator<base.ObjectPropertyProps> & {
|
|
59
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ObjectPropertyProps>;
|
|
60
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ObjectPropertyProps>;
|
|
61
|
+
};
|
|
62
|
+
export declare const PackageDirectory: (props: base.PackageDirectoryProps) => import("@alloy-js/core").ComponentCreator<base.PackageDirectoryProps> & {
|
|
63
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.PackageDirectoryProps>;
|
|
64
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.PackageDirectoryProps>;
|
|
65
|
+
};
|
|
66
|
+
export declare const PackageJsonFile: (props: base.PackageJsonFileProps) => import("@alloy-js/core").ComponentCreator<base.PackageJsonFileProps> & {
|
|
67
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.PackageJsonFileProps>;
|
|
68
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.PackageJsonFileProps>;
|
|
69
|
+
};
|
|
70
|
+
export declare const Reference: (props: base.ReferenceProps) => import("@alloy-js/core").ComponentCreator<base.ReferenceProps> & {
|
|
71
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ReferenceProps>;
|
|
72
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ReferenceProps>;
|
|
73
|
+
};
|
|
74
|
+
export declare const SourceFile: (props: base.SourceFileProps) => import("@alloy-js/core").ComponentCreator<base.SourceFileProps> & {
|
|
75
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.SourceFileProps>;
|
|
76
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.SourceFileProps>;
|
|
77
|
+
};
|
|
78
|
+
export declare const TSConfigJson: (props?: base.TSConfigJsonProps | undefined) => import("@alloy-js/core").ComponentCreator<base.TSConfigJsonProps> & {
|
|
79
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.TSConfigJsonProps>;
|
|
80
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.TSConfigJsonProps>;
|
|
81
|
+
};
|
|
82
|
+
export declare const TypeDeclaration: (props: base.TypeDeclarationProps) => import("@alloy-js/core").ComponentCreator<base.TypeDeclarationProps> & {
|
|
83
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.TypeDeclarationProps>;
|
|
84
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.TypeDeclarationProps>;
|
|
85
|
+
};
|
|
86
|
+
export declare const ValueExpression: (props?: base.ValueExpressionProps | undefined) => import("@alloy-js/core").ComponentCreator<base.ValueExpressionProps> & {
|
|
87
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ValueExpressionProps>;
|
|
88
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ValueExpressionProps>;
|
|
89
|
+
};
|
|
90
|
+
export declare const VarDeclaration: (props: base.VarDeclarationProps) => import("@alloy-js/core").ComponentCreator<base.VarDeclarationProps> & {
|
|
91
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.VarDeclarationProps>;
|
|
92
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.VarDeclarationProps>;
|
|
93
|
+
};
|
|
94
|
+
export declare const ClassDeclaration: (props: base.ClassDeclarationProps) => import("@alloy-js/core").ComponentCreator<base.ClassDeclarationProps> & {
|
|
95
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ClassDeclarationProps>;
|
|
96
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ClassDeclarationProps>;
|
|
97
|
+
};
|
|
98
|
+
export declare const ClassField: (props: base.ClassFieldProps) => import("@alloy-js/core").ComponentCreator<base.ClassFieldProps> & {
|
|
99
|
+
code(template: TemplateStringsArray, ...substitutions: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ClassFieldProps>;
|
|
100
|
+
children(...children: import("@alloy-js/core").Children[]): import("@alloy-js/core").ComponentCreator<base.ClassFieldProps>;
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/stc/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AAEpC,eAAO,MAAM,eAAe;;;CAA4B,CAAC;AACzD,eAAO,MAAM,UAAU;;;CAAuB,CAAC;AAC/C,eAAO,MAAM,KAAK;;;CAAkB,CAAC;AACrC,eAAO,MAAM,WAAW;;;CAAwB,CAAC;AACjD,eAAO,MAAM,eAAe;;;CAA4B,CAAC;AACzD,eAAO,MAAM,UAAU;;;CAAuB,CAAC;AAC/C,eAAO,MAAM,eAAe;;;CAA4B,CAAC;AACzD,eAAO,MAAM,mBAAmB;;;CAAgC,CAAC;AACjE,eAAO,MAAM,eAAe;;;CAA4B,CAAC;AACzD,eAAO,MAAM,gBAAgB;;;CAA6B,CAAC;AAC3D,eAAO,MAAM,oBAAoB;;;CAAiC,CAAC;AACnE,eAAO,MAAM,mBAAmB;;;CAAgC,CAAC;AACjE,eAAO,MAAM,eAAe;;;CAA4B,CAAC;AACzD,eAAO,MAAM,gBAAgB;;;CAA6B,CAAC;AAC3D,eAAO,MAAM,cAAc;;;CAA2B,CAAC;AACvD,eAAO,MAAM,gBAAgB;;;CAA6B,CAAC;AAC3D,eAAO,MAAM,eAAe;;;CAA4B,CAAC;AACzD,eAAO,MAAM,SAAS;;;CAAsB,CAAC;AAC7C,eAAO,MAAM,UAAU;;;CAAuB,CAAC;AAC/C,eAAO,MAAM,YAAY;;;CAAyB,CAAC;AACnD,eAAO,MAAM,eAAe;;;CAA4B,CAAC;AACzD,eAAO,MAAM,eAAe;;;CAA4B,CAAC;AACzD,eAAO,MAAM,cAAc;;;CAA2B,CAAC;AACvD,eAAO,MAAM,gBAAgB;;;CAA6B,CAAC;AAC3D,eAAO,MAAM,UAAU;;;CAAuB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { stc } from "@alloy-js/core";
|
|
2
|
+
import * as base from "../index.js";
|
|
3
|
+
export const ArrayExpression = stc(base.ArrayExpression);
|
|
4
|
+
export const BarrelFile = stc(base.BarrelFile);
|
|
5
|
+
export const Block = stc(base.Block);
|
|
6
|
+
export const Declaration = stc(base.Declaration);
|
|
7
|
+
export const EnumDeclaration = stc(base.EnumDeclaration);
|
|
8
|
+
export const EnumMember = stc(base.EnumMember);
|
|
9
|
+
export const ExportStatement = stc(base.ExportStatement);
|
|
10
|
+
export const FunctionDeclaration = stc(base.FunctionDeclaration);
|
|
11
|
+
export const ImportStatement = stc(base.ImportStatement);
|
|
12
|
+
export const ImportStatements = stc(base.ImportStatements);
|
|
13
|
+
export const InterfaceDeclaration = stc(base.InterfaceDeclaration);
|
|
14
|
+
export const InterfaceExpression = stc(base.InterfaceExpression);
|
|
15
|
+
export const InterfaceMember = stc(base.InterfaceMember);
|
|
16
|
+
export const ObjectExpression = stc(base.ObjectExpression);
|
|
17
|
+
export const ObjectProperty = stc(base.ObjectProperty);
|
|
18
|
+
export const PackageDirectory = stc(base.PackageDirectory);
|
|
19
|
+
export const PackageJsonFile = stc(base.PackageJsonFile);
|
|
20
|
+
export const Reference = stc(base.Reference);
|
|
21
|
+
export const SourceFile = stc(base.SourceFile);
|
|
22
|
+
export const TSConfigJson = stc(base.TSConfigJson);
|
|
23
|
+
export const TypeDeclaration = stc(base.TypeDeclaration);
|
|
24
|
+
export const ValueExpression = stc(base.ValueExpression);
|
|
25
|
+
export const VarDeclaration = stc(base.VarDeclaration);
|
|
26
|
+
export const ClassDeclaration = stc(base.ClassDeclaration);
|
|
27
|
+
export const ClassField = stc(base.ClassField);
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["stc","base","ArrayExpression","BarrelFile","Block","Declaration","EnumDeclaration","EnumMember","ExportStatement","FunctionDeclaration","ImportStatement","ImportStatements","InterfaceDeclaration","InterfaceExpression","InterfaceMember","ObjectExpression","ObjectProperty","PackageDirectory","PackageJsonFile","Reference","SourceFile","TSConfigJson","TypeDeclaration","ValueExpression","VarDeclaration","ClassDeclaration","ClassField"],"sources":["../../../../src/components/stc/index.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,GAAG,QAAQ,gBAAgB;AACpC,OAAO,KAAKC,IAAI,MAAM,aAAa;AAEnC,OAAO,MAAMC,eAAe,GAAGF,GAAG,CAACC,IAAI,CAACC,eAAe,CAAC;AACxD,OAAO,MAAMC,UAAU,GAAGH,GAAG,CAACC,IAAI,CAACE,UAAU,CAAC;AAC9C,OAAO,MAAMC,KAAK,GAAGJ,GAAG,CAACC,IAAI,CAACG,KAAK,CAAC;AACpC,OAAO,MAAMC,WAAW,GAAGL,GAAG,CAACC,IAAI,CAACI,WAAW,CAAC;AAChD,OAAO,MAAMC,eAAe,GAAGN,GAAG,CAACC,IAAI,CAACK,eAAe,CAAC;AACxD,OAAO,MAAMC,UAAU,GAAGP,GAAG,CAACC,IAAI,CAACM,UAAU,CAAC;AAC9C,OAAO,MAAMC,eAAe,GAAGR,GAAG,CAACC,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,CAACwB,gBAAgB,CAAC;AAC1D,OAAO,MAAMC,UAAU,GAAG1B,GAAG,CAACC,IAAI,CAACyB,UAAU,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Refkey, SymbolCreator } from "@alloy-js/core";
|
|
2
|
+
export interface PackageDescriptor {
|
|
3
|
+
[path: string]: ModuleSymbolsDescriptor;
|
|
4
|
+
}
|
|
5
|
+
export interface ModuleSymbolsDescriptor {
|
|
6
|
+
default?: string;
|
|
7
|
+
named?: readonly string[];
|
|
8
|
+
}
|
|
9
|
+
export type PackageRefkeys<T extends PackageDescriptor> = {
|
|
10
|
+
[K in keyof T as K extends "." ? never : K]: {
|
|
11
|
+
[N in T[K]["named"] extends readonly string[] ? T[K]["named"][number] : never]: Refkey;
|
|
12
|
+
} & (T[K] extends {
|
|
13
|
+
default: string;
|
|
14
|
+
} ? {
|
|
15
|
+
default: Refkey;
|
|
16
|
+
} : {});
|
|
17
|
+
} & (T["."] extends {
|
|
18
|
+
default: string;
|
|
19
|
+
} ? {
|
|
20
|
+
default: Refkey;
|
|
21
|
+
} : {}) & (T["."] extends {
|
|
22
|
+
named: readonly string[];
|
|
23
|
+
} ? {
|
|
24
|
+
[N in T["."]["named"][number]]: Refkey;
|
|
25
|
+
} : {});
|
|
26
|
+
export interface CreatePackageProps<T extends PackageDescriptor> {
|
|
27
|
+
name: string;
|
|
28
|
+
version: string;
|
|
29
|
+
descriptor: T;
|
|
30
|
+
builtin?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare function createPackage<const T extends PackageDescriptor>(props: CreatePackageProps<T>): PackageRefkeys<T> & SymbolCreator;
|
|
33
|
+
//# sourceMappingURL=create-package.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-package.d.ts","sourceRoot":"","sources":["../../src/create-package.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EAEN,aAAa,EACd,MAAM,gBAAgB,CAAC;AAQ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AAK,CAAC,CAAC,SAAS,iBAAiB,EAC7D,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC3B,cAAc,CAAC,CAAC,CAAC,GAAG,aAAa,CAoBnC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { getSymbolCreatorSymbol, refkey } from "@alloy-js/core";
|
|
2
|
+
import { createTSModuleScope, createTSPackageScope, createTSSymbol } from "./symbols/index.js";
|
|
3
|
+
function createSymbols(binder, props, refkeys) {
|
|
4
|
+
const pkgScope = createTSPackageScope(binder, undefined, props.name, props.version, `node_modules/${props.name}`, props.builtin);
|
|
5
|
+
for (const [path, symbols] of Object.entries(props.descriptor)) {
|
|
6
|
+
const keys = path === "." ? refkeys : refkeys[path];
|
|
7
|
+
const moduleScope = createTSModuleScope(binder, pkgScope, path);
|
|
8
|
+
pkgScope.exportedSymbols.set(path, moduleScope);
|
|
9
|
+
if (symbols.default) {
|
|
10
|
+
const key = keys.default;
|
|
11
|
+
const sym = createTSSymbol({
|
|
12
|
+
name: symbols.default,
|
|
13
|
+
scope: moduleScope,
|
|
14
|
+
refkey: key,
|
|
15
|
+
export: true,
|
|
16
|
+
default: true
|
|
17
|
+
});
|
|
18
|
+
moduleScope.exportedSymbols.set(key, sym);
|
|
19
|
+
}
|
|
20
|
+
for (const exportedName of symbols.named ?? []) {
|
|
21
|
+
const key = keys[exportedName];
|
|
22
|
+
const sym = createTSSymbol({
|
|
23
|
+
name: exportedName,
|
|
24
|
+
scope: moduleScope,
|
|
25
|
+
refkey: key,
|
|
26
|
+
export: true,
|
|
27
|
+
default: false
|
|
28
|
+
});
|
|
29
|
+
moduleScope.exportedSymbols.set(key, sym);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export function createPackage(props) {
|
|
34
|
+
const refkeys = {
|
|
35
|
+
[getSymbolCreatorSymbol()](binder) {
|
|
36
|
+
createSymbols(binder, props, refkeys);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
for (const [path, symbols] of Object.entries(props.descriptor)) {
|
|
40
|
+
const keys = path === "." ? refkeys : (refkeys[path] = {}, refkeys[path]);
|
|
41
|
+
if (symbols.default) {
|
|
42
|
+
keys.default = refkey(props.descriptor, path, "default");
|
|
43
|
+
}
|
|
44
|
+
for (const named of symbols.named ?? []) {
|
|
45
|
+
keys[named] = refkey(props.descriptor, path, named);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return refkeys;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=create-package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-package.js","names":["getSymbolCreatorSymbol","refkey","createTSModuleScope","createTSPackageScope","createTSSymbol","createSymbols","binder","props","refkeys","pkgScope","undefined","name","version","builtin","path","symbols","Object","entries","descriptor","keys","moduleScope","exportedSymbols","set","default","key","sym","scope","export","exportedName","named","createPackage"],"sources":["../../src/create-package.ts"],"sourcesContent":[null],"mappings":"AAAA,SAEEA,sBAAsB,EAEtBC,MAAM,QAED,gBAAgB;AAEvB,SACEC,mBAAmB,EACnBC,oBAAoB,EACpBC,cAAc,QACT,oBAAoB;AAW3B,SAASC,aAAaA,CACpBC,MAAc,EACdC,KAA4C,EAC5CC,OAA4B,EAC5B;EACA,MAAMC,QAAQ,GAAGN,oBAAoB,CACnCG,MAAM,EACNI,SAAS,EACTH,KAAK,CAACI,IAAI,EACVJ,KAAK,CAACK,OAAO,EACb,gBAAgBL,KAAK,CAACI,IAAI,EAAE,EAC5BJ,KAAK,CAACM,OACR,CAAC;EACD,KAAK,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACV,KAAK,CAACW,UAAU,CAAC,EAAE;IAC9D,MAAMC,IAAI,GAAGL,IAAI,KAAK,GAAG,GAAGN,OAAO,GAAGA,OAAO,CAACM,IAAI,CAAC;IACnD,MAAMM,WAAW,GAAGlB,mBAAmB,CAACI,MAAM,EAAEG,QAAQ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GAAG,CAAC,CAAC,EAAGN,OAAO,CAACM,IAAI,CAAC,CAAC;IAE3E,IAAIC,OAAO,CAACQ,OAAO,EAAE;MACnBJ,IAAI,CAACI,OAAO,GAAGtB,MAAM,CAACM,KAAK,CAACW,UAAU,EAAEJ,IAAI,EAAE,SAAS,CAAC;IAC1D;IAEA,KAAK,MAAMe,KAAK,IAAId,OAAO,CAACc,KAAK,IAAI,EAAE,EAAE;MACvCV,IAAI,CAACU,KAAK,CAAC,GAAG5B,MAAM,CAACM,KAAK,CAACW,UAAU,EAAEJ,IAAI,EAAEe,KAAK,CAAC;IACrD;EACF;EAEA,OAAOrB,OAAO;AAChB","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./builtins/index.js";
|
|
2
|
+
export * from "./components/index.js";
|
|
3
|
+
export * from "./create-package.js";
|
|
4
|
+
export * from "./name-conflict-resolver.js";
|
|
5
|
+
export * from "./name-policy.js";
|
|
6
|
+
export * from "./symbols/index.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./builtins/index.js";
|
|
2
|
+
export * from "./components/index.js";
|
|
3
|
+
export * from "./create-package.js";
|
|
4
|
+
export * from "./name-conflict-resolver.js";
|
|
5
|
+
export * from "./name-policy.js";
|
|
6
|
+
export * from "./symbols/index.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,uBAAuB;AACrC,cAAc,qBAAqB;AACnC,cAAc,6BAA6B;AAC3C,cAAc,kBAAkB;AAChC,cAAc,oBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name-conflict-resolver.d.ts","sourceRoot":"","sources":["../../src/name-conflict-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,oBAAoB,CAAC;AAEnE,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,cAAc,EAAE,QAiB1B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TSSymbolFlags } from "./symbols/index.js";
|
|
2
|
+
export function tsNameConflictResolver(name, symbols) {
|
|
3
|
+
const goodNamedSymbols = symbols.filter(s => ~s.tsFlags & TSSymbolFlags.LocalImportSymbol);
|
|
4
|
+
const badNamedSymbols = symbols.filter(s => s.tsFlags & TSSymbolFlags.LocalImportSymbol);
|
|
5
|
+
let nameCount = 1;
|
|
6
|
+
if (goodNamedSymbols.length > 1) {
|
|
7
|
+
for (const sym of goodNamedSymbols.slice(1)) {
|
|
8
|
+
sym.name = name + "_" + nameCount++;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
for (const sym of badNamedSymbols) {
|
|
12
|
+
sym.name = name + "_" + nameCount++;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=name-conflict-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name-conflict-resolver.js","names":["TSSymbolFlags","tsNameConflictResolver","name","symbols","goodNamedSymbols","filter","s","tsFlags","LocalImportSymbol","badNamedSymbols","nameCount","length","sym","slice"],"sources":["../../src/name-conflict-resolver.ts"],"sourcesContent":[null],"mappings":"AAAA,SAAyBA,aAAa,QAAQ,oBAAoB;AAElE,OAAO,SAASC,sBAAsBA,CACpCC,IAAY,EACZC,OAAyB,EACzB;EACA,MAAMC,gBAAgB,GAAGD,OAAO,CAACE,MAAM,CACpCC,CAAC,IAAK,CAACA,CAAC,CAACC,OAAO,GAAGP,aAAa,CAACQ,iBACpC,CAAC;EACD,MAAMC,eAAe,GAAGN,OAAO,CAACE,MAAM,CACnCC,CAAC,IAAKA,CAAC,CAACC,OAAO,GAAGP,aAAa,CAACQ,iBACnC,CAAC;EACD,IAAIE,SAAS,GAAG,CAAC;EACjB,IAAIN,gBAAgB,CAACO,MAAM,GAAG,CAAC,EAAE;IAC/B,KAAK,MAAMC,GAAG,IAAIR,gBAAgB,CAACS,KAAK,CAAC,CAAC,CAAC,EAAE;MAC3CD,GAAG,CAACV,IAAI,GAAGA,IAAI,GAAG,GAAG,GAAGQ,SAAS,EAAE;IACrC;EACF;EACA,KAAK,MAAME,GAAG,IAAIH,eAAe,EAAE;IACjCG,GAAG,CAACV,IAAI,GAAGA,IAAI,GAAG,GAAG,GAAGQ,SAAS,EAAE;EACrC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { NamePolicy } from "@alloy-js/core";
|
|
2
|
+
export type TypeScriptElements = "function" | "parameter" | "class" | "variable" | "enum" | "object-member-data" | "object-member-getter" | "class-member-data" | "class-member-getter" | "enum-member" | "interface" | "interface-member" | "type";
|
|
3
|
+
export declare function createTSNamePolicy(): NamePolicy<TypeScriptElements>;
|
|
4
|
+
export declare function useTSNamePolicy(): NamePolicy<TypeScriptElements>;
|
|
5
|
+
//# sourceMappingURL=name-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name-policy.d.ts","sourceRoot":"","sources":["../../src/name-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,UAAU,EAAiB,MAAM,gBAAgB,CAAC;AAG7E,MAAM,MAAM,kBAAkB,GAC1B,UAAU,GACV,WAAW,GACX,OAAO,GACP,UAAU,GACV,MAAM,GACN,oBAAoB,GACpB,sBAAsB,GACtB,mBAAmB,GACnB,qBAAqB,GACrB,aAAa,GACb,WAAW,GACX,kBAAkB,GAClB,MAAM,CAAC;AAEX,wBAAgB,kBAAkB,IAAI,UAAU,CAAC,kBAAkB,CAAC,CAgBnE;AAED,wBAAgB,eAAe,IAAI,UAAU,CAAC,kBAAkB,CAAC,CAEhE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createNamePolicy, useNamePolicy } from "@alloy-js/core";
|
|
2
|
+
import { camelCase, pascalCase } from "change-case";
|
|
3
|
+
export function createTSNamePolicy() {
|
|
4
|
+
const caseOptions = {
|
|
5
|
+
prefixCharacters: "$_",
|
|
6
|
+
suffixCharacters: "$_"
|
|
7
|
+
};
|
|
8
|
+
return createNamePolicy((name, element) => {
|
|
9
|
+
switch (element) {
|
|
10
|
+
case "class":
|
|
11
|
+
case "type":
|
|
12
|
+
case "interface":
|
|
13
|
+
case "enum":
|
|
14
|
+
return pascalCase(name, caseOptions);
|
|
15
|
+
default:
|
|
16
|
+
return camelCase(name, caseOptions);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export function useTSNamePolicy() {
|
|
21
|
+
return useNamePolicy();
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=name-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name-policy.js","names":["createNamePolicy","useNamePolicy","camelCase","pascalCase","createTSNamePolicy","caseOptions","prefixCharacters","suffixCharacters","name","element","useTSNamePolicy"],"sources":["../../src/name-policy.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,gBAAgB,EAAcC,aAAa,QAAQ,gBAAgB;AAC5E,SAASC,SAAS,EAAEC,UAAU,QAAQ,aAAa;AAiBnD,OAAO,SAASC,kBAAkBA,CAAA,EAAmC;EACnE,MAAMC,WAAW,GAAG;IAClBC,gBAAgB,EAAE,IAAI;IACtBC,gBAAgB,EAAE;EACpB,CAAC;EACD,OAAOP,gBAAgB,CAAC,CAACQ,IAAI,EAAEC,OAAO,KAAK;IACzC,QAAQA,OAAO;MACb,KAAK,OAAO;MACZ,KAAK,MAAM;MACX,KAAK,WAAW;MAChB,KAAK,MAAM;QACT,OAAON,UAAU,CAACK,IAAI,EAAEH,WAAW,CAAC;MACtC;QACE,OAAOH,SAAS,CAACM,IAAI,EAAEH,WAAW,CAAC;IACvC;EACF,CAAC,CAAC;AACJ;AAEA,OAAO,SAASK,eAAeA,CAAA,EAAmC;EAChE,OAAOT,aAAa,CAAC,CAAC;AACxB","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SourceDirectoryContext } from "@alloy-js/core";
|
|
2
|
+
import { TSModuleScope } from "./symbols/index.js";
|
|
3
|
+
export interface SourceDirectoryData {
|
|
4
|
+
modules: Set<TSModuleScope>;
|
|
5
|
+
}
|
|
6
|
+
export declare function getSourceDirectoryData(sdContext: SourceDirectoryContext): SourceDirectoryData;
|
|
7
|
+
//# sourceMappingURL=source-directory-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-directory-data.d.ts","sourceRoot":"","sources":["../../src/source-directory-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;CAC7B;AAOD,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,sBAAsB,uBAYvE"}
|