@shd101wyy/yo 0.0.31 → 0.0.33
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/README.md +109 -18
- package/out/cjs/index.cjs +890 -1002
- package/out/cjs/yo-cli.cjs +954 -1069
- package/out/esm/index.mjs +786 -898
- package/out/types/src/build-runner.d.ts +3 -1
- package/out/types/src/codegen/codegen-c.d.ts +2 -0
- package/out/types/src/codegen/exprs/asm.d.ts +4 -0
- package/out/types/src/codegen/index.d.ts +10 -0
- package/out/types/src/codegen/utils/index.d.ts +1 -0
- package/out/types/src/evaluator/builtins/asm.d.ts +13 -0
- package/out/types/src/evaluator/builtins/build.d.ts +23 -10
- package/out/types/src/evaluator/exprs/while.d.ts +2 -1
- package/out/types/src/expr-traversal.d.ts +1 -0
- package/out/types/src/expr.d.ts +6 -2
- package/out/types/src/fetch.d.ts +1 -0
- package/out/types/src/module-manager.d.ts +1 -0
- package/out/types/src/pkg-config.d.ts +7 -2
- package/out/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/std/build.yo +57 -16
- package/std/{toml → encoding}/toml.yo +6 -1
- package/std/http/client.yo +359 -0
- package/std/http/index.yo +22 -0
- package/std/log/{log.yo → index.yo} +2 -2
- package/std/regex/{regex.yo → index.yo} +1 -1
- package/std/url/{url.yo → index.yo} +2 -2
- /package/std/glob/{glob.yo → index.yo} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BuildRegistry } from "./evaluator/builtins/build";
|
|
1
|
+
import { type BuildArtifact, BuildRegistry } from "./evaluator/builtins/build";
|
|
2
2
|
export interface BuildOptions {
|
|
3
3
|
buildFile: string;
|
|
4
4
|
targetTriple?: string;
|
|
@@ -11,6 +11,8 @@ export interface BuildOptions {
|
|
|
11
11
|
sysroot?: string;
|
|
12
12
|
summary?: boolean;
|
|
13
13
|
}
|
|
14
|
+
export declare function getArtifactOutputFileName(artifact: Pick<BuildArtifact, "kind" | "name" | "target">, targetTriple?: string): string;
|
|
15
|
+
export declare function stageRuntimeFiles(runtimeFiles: readonly string[], outputDir: string, verbose?: boolean): string[];
|
|
14
16
|
export declare function runBuild(options: BuildOptions): Promise<void>;
|
|
15
17
|
export interface DAGNode {
|
|
16
18
|
name: string;
|
|
@@ -2,6 +2,7 @@ import type { ModuleValue } from "../value";
|
|
|
2
2
|
export declare class CodeGeneratorC {
|
|
3
3
|
private emitter;
|
|
4
4
|
private exportedFunctionNames;
|
|
5
|
+
private _needsIntelAsmSyntax;
|
|
5
6
|
constructor();
|
|
6
7
|
compileModule(modulePath: string, moduleValue: ModuleValue, options?: {
|
|
7
8
|
debugGc?: boolean;
|
|
@@ -12,4 +13,5 @@ export declare class CodeGeneratorC {
|
|
|
12
13
|
}): void;
|
|
13
14
|
print(): string;
|
|
14
15
|
getExportedFunctionNames(): Set<string>;
|
|
16
|
+
get needsIntelAsmSyntax(): boolean;
|
|
15
17
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type FnCallExpr } from "../../expr";
|
|
2
|
+
import { type CodeGenContext } from "../utils";
|
|
3
|
+
export declare function generateAsm(expr: FnCallExpr, indent: string, context: CodeGenContext): string;
|
|
4
|
+
export declare function generateGlobalAsm(expr: FnCallExpr, indent: string, context: CodeGenContext): string;
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import { type TargetInfo } from "../target";
|
|
2
|
+
export interface StaticLibraryArchiver {
|
|
3
|
+
tool: string;
|
|
4
|
+
argsPrefix: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare function selectStaticLibraryArchiver(options: {
|
|
7
|
+
compiler: string;
|
|
8
|
+
targetInfo: TargetInfo;
|
|
9
|
+
hasLlvmAr?: boolean;
|
|
10
|
+
}): StaticLibraryArchiver;
|
|
1
11
|
export declare class CodeGenerator {
|
|
2
12
|
private moduleManager;
|
|
3
13
|
constructor();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Environment } from "../../env";
|
|
2
|
+
import { type FnCallExpr } from "../../expr";
|
|
3
|
+
import type { EvaluatorContext } from "../context";
|
|
4
|
+
export declare function evaluateAsm({ expr, env, context, }: {
|
|
5
|
+
expr: FnCallExpr;
|
|
6
|
+
env: Environment;
|
|
7
|
+
context: EvaluatorContext;
|
|
8
|
+
}): FnCallExpr;
|
|
9
|
+
export declare function evaluateGlobalAsm({ expr, env, context, }: {
|
|
10
|
+
expr: FnCallExpr;
|
|
11
|
+
env: Environment;
|
|
12
|
+
context: EvaluatorContext;
|
|
13
|
+
}): FnCallExpr;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { Environment } from "../../env";
|
|
2
2
|
import { type FnCallExpr } from "../../expr";
|
|
3
3
|
import type { EvaluatorContext } from "../context";
|
|
4
|
-
export interface BuildProject {
|
|
5
|
-
name: string;
|
|
6
|
-
root: string;
|
|
7
|
-
}
|
|
8
4
|
export interface BuildArtifact {
|
|
9
5
|
kind: "executable" | "static_library" | "shared_library";
|
|
10
6
|
name: string;
|
|
@@ -21,8 +17,10 @@ export interface BuildArtifact {
|
|
|
21
17
|
defines: string[];
|
|
22
18
|
strip: boolean;
|
|
23
19
|
staticLink: boolean;
|
|
20
|
+
runtimeFiles?: string[];
|
|
24
21
|
linkedArtifacts: string[];
|
|
25
22
|
linkedSystemLibraries: string[];
|
|
23
|
+
importedModules: ImportedModule[];
|
|
26
24
|
}
|
|
27
25
|
export interface BuildTestSuite {
|
|
28
26
|
name: string;
|
|
@@ -54,17 +52,28 @@ export interface BuildPathDependency {
|
|
|
54
52
|
}
|
|
55
53
|
export interface BuildSystemLibrary {
|
|
56
54
|
name: string;
|
|
57
|
-
pkgConfig: string;
|
|
58
55
|
fallbackInclude: string;
|
|
59
56
|
fallbackLib: string;
|
|
60
57
|
fallbackLink: string;
|
|
58
|
+
defines?: string[];
|
|
61
59
|
}
|
|
62
60
|
export interface DependencyArtifactRef {
|
|
63
61
|
dependencyName: string;
|
|
64
62
|
artifactName: string;
|
|
65
63
|
}
|
|
64
|
+
export interface BuildModuleEntry {
|
|
65
|
+
name: string;
|
|
66
|
+
root: string;
|
|
67
|
+
linkedSystemLibraries: string[];
|
|
68
|
+
}
|
|
69
|
+
export interface ImportedModule {
|
|
70
|
+
importName: string;
|
|
71
|
+
moduleName: string;
|
|
72
|
+
dependencyName: string;
|
|
73
|
+
resolvedRoot?: string;
|
|
74
|
+
propagatedSystemLibraries?: string[];
|
|
75
|
+
}
|
|
66
76
|
export declare class BuildRegistry {
|
|
67
|
-
project: BuildProject | undefined;
|
|
68
77
|
artifacts: BuildArtifact[];
|
|
69
78
|
testSuites: BuildTestSuite[];
|
|
70
79
|
runSteps: BuildRunStep[];
|
|
@@ -73,13 +82,13 @@ export declare class BuildRegistry {
|
|
|
73
82
|
pathDependencies: BuildPathDependency[];
|
|
74
83
|
systemLibraries: BuildSystemLibrary[];
|
|
75
84
|
dependencyArtifacts: DependencyArtifactRef[];
|
|
85
|
+
modules: BuildModuleEntry[];
|
|
76
86
|
cliOptions: Map<string, string>;
|
|
77
87
|
declaredOptions: Map<string, {
|
|
78
88
|
description: string;
|
|
79
89
|
defaultValue: string;
|
|
80
90
|
}>;
|
|
81
91
|
setCliOptions(options: Map<string, string>): void;
|
|
82
|
-
registerProject(name: string, root: string): void;
|
|
83
92
|
registerExecutable(config: Omit<BuildArtifact, "kind">): void;
|
|
84
93
|
registerStaticLibrary(config: Omit<BuildArtifact, "kind">): void;
|
|
85
94
|
registerSharedLibrary(config: Omit<BuildArtifact, "kind">): void;
|
|
@@ -91,6 +100,10 @@ export declare class BuildRegistry {
|
|
|
91
100
|
registerPathDependency(dep: BuildPathDependency): void;
|
|
92
101
|
registerSystemLibrary(lib: BuildSystemLibrary): void;
|
|
93
102
|
registerDependencyArtifact(ref: DependencyArtifactRef): void;
|
|
103
|
+
registerModule(entry: BuildModuleEntry): void;
|
|
104
|
+
registerModuleLink(moduleName: string, systemLibraryName: string): void;
|
|
105
|
+
registerImportedModule(artifactName: string, imported: ImportedModule): void;
|
|
106
|
+
findModule(name: string): BuildModuleEntry | undefined;
|
|
94
107
|
registerLink(artifactName: string, libraryName: string): void;
|
|
95
108
|
findArtifact(name: string): BuildArtifact | undefined;
|
|
96
109
|
findTest(name: string): BuildTestSuite | undefined;
|
|
@@ -122,9 +135,9 @@ export declare class BuildRegistry {
|
|
|
122
135
|
}
|
|
123
136
|
export declare function getRootBuildProjectDir(): string | undefined;
|
|
124
137
|
export declare function setRootBuildProjectDir(dir: string | undefined): void;
|
|
125
|
-
export declare function
|
|
126
|
-
export declare function
|
|
127
|
-
export declare function
|
|
138
|
+
export declare function clearModuleImportRoots(): void;
|
|
139
|
+
export declare function getModuleImportRoot(importName: string): string | undefined;
|
|
140
|
+
export declare function setModuleImportRoot(importName: string, resolvedRoot: string): void;
|
|
128
141
|
export declare function getBuildRegistry(): BuildRegistry;
|
|
129
142
|
export declare function clearBuildRegistry(): void;
|
|
130
143
|
export declare function swapBuildRegistry(newRegistry: BuildRegistry | undefined): BuildRegistry | undefined;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Environment } from "../../env";
|
|
2
2
|
import { type FnCallExpr } from "../../expr";
|
|
3
3
|
import type { EvaluatorContext } from "../context";
|
|
4
|
-
export declare function evaluateWhile({ expr, env, context, }: {
|
|
4
|
+
export declare function evaluateWhile({ expr, env, context, _comptimeIterationCount, }: {
|
|
5
5
|
expr: FnCallExpr;
|
|
6
6
|
env: Environment;
|
|
7
7
|
context: EvaluatorContext;
|
|
8
|
+
_comptimeIterationCount?: number;
|
|
8
9
|
}): FnCallExpr;
|
|
@@ -2,3 +2,4 @@ import { type Expr } from "./expr";
|
|
|
2
2
|
export declare function evaluatedBodyContainsEscape(expr: Expr): boolean;
|
|
3
3
|
export declare function exprTreeContainsReturn(expr: Expr): boolean;
|
|
4
4
|
export declare function exprContainsAwait(expr: Expr): boolean;
|
|
5
|
+
export declare function exprContainsLoopTerminator(expr: Expr): boolean;
|
package/out/types/src/expr.d.ts
CHANGED
|
@@ -136,7 +136,6 @@ export declare const BuiltinKeywords: {
|
|
|
136
136
|
if: string[];
|
|
137
137
|
op_and: string[];
|
|
138
138
|
op_or: string[];
|
|
139
|
-
not: string[];
|
|
140
139
|
gensym: string[];
|
|
141
140
|
dyn: string[];
|
|
142
141
|
Dyn: string[];
|
|
@@ -532,7 +531,6 @@ export declare const BuiltinFunctions: {
|
|
|
532
531
|
__yo_maybe_uninit_assume_init: string[];
|
|
533
532
|
__yo_process_platform: string[];
|
|
534
533
|
__yo_process_arch: string[];
|
|
535
|
-
__yo_build_project: string[];
|
|
536
534
|
__yo_build_executable: string[];
|
|
537
535
|
__yo_build_static_library: string[];
|
|
538
536
|
__yo_build_shared_library: string[];
|
|
@@ -549,6 +547,12 @@ export declare const BuiltinFunctions: {
|
|
|
549
547
|
__yo_build_system_library: string[];
|
|
550
548
|
__yo_build_option: string[];
|
|
551
549
|
__yo_build_dep_artifact: string[];
|
|
550
|
+
__yo_build_module: string[];
|
|
551
|
+
__yo_build_module_link: string[];
|
|
552
|
+
__yo_build_add_import: string[];
|
|
553
|
+
__yo_build_dep_module: string[];
|
|
554
|
+
asm: string[];
|
|
555
|
+
global_asm: string[];
|
|
552
556
|
};
|
|
553
557
|
export declare function exprIsInfixOperatorFunctionCall(expr: Expr): boolean;
|
|
554
558
|
export interface ExprToStringConfig {
|
package/out/types/src/fetch.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BuildGitDependency } from "./evaluator/builtins/build";
|
|
2
2
|
import { type LockFile } from "./lock-file";
|
|
3
3
|
export declare function getCacheDir(_projectDir?: string): string;
|
|
4
|
+
export declare function computeContentHash(dirPath: string): string;
|
|
4
5
|
export interface FetchResult {
|
|
5
6
|
resolvedPaths: Map<string, string>;
|
|
6
7
|
lockFile: LockFile;
|
|
@@ -5,7 +5,12 @@ export interface PkgConfigResult {
|
|
|
5
5
|
includePaths: string[];
|
|
6
6
|
libraryPaths: string[];
|
|
7
7
|
linkLibraries: string[];
|
|
8
|
+
defines: string[];
|
|
9
|
+
runtimeFiles: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface ResolveSystemLibraryOptions {
|
|
12
|
+
preferDebugRuntime?: boolean;
|
|
8
13
|
}
|
|
9
14
|
export declare function isPkgConfigAvailable(): boolean;
|
|
10
|
-
export declare function resolveSystemLibrary(lib: BuildSystemLibrary, verbose?: boolean): PkgConfigResult;
|
|
11
|
-
export declare function resolveAllSystemLibraries(libraries: BuildSystemLibrary[], verbose?: boolean): PkgConfigResult;
|
|
15
|
+
export declare function resolveSystemLibrary(lib: BuildSystemLibrary, verbose?: boolean, options?: ResolveSystemLibraryOptions): PkgConfigResult;
|
|
16
|
+
export declare function resolveAllSystemLibraries(libraries: BuildSystemLibrary[], verbose?: boolean, options?: ResolveSystemLibraryOptions): PkgConfigResult;
|