@dagger.io/dagger 0.19.2 → 0.19.4
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/dist/src/api/client.gen.d.ts +131 -2
- package/dist/src/api/client.gen.d.ts.map +1 -1
- package/dist/src/api/client.gen.js +232 -2
- package/dist/src/module/decorators.d.ts.map +1 -1
- package/dist/src/module/entrypoint/entrypoint.d.ts.map +1 -1
- package/dist/src/module/entrypoint/entrypoint.js +1 -1
- package/dist/src/module/entrypoint/introspection_entrypoint.d.ts +2 -0
- package/dist/src/module/entrypoint/introspection_entrypoint.d.ts.map +1 -0
- package/dist/src/module/entrypoint/introspection_entrypoint.js +52 -0
- package/dist/src/module/entrypoint/register.d.ts.map +1 -1
- package/dist/src/module/entrypoint/register.js +20 -2
- package/dist/src/module/introspector/dagger_module/function.d.ts +2 -2
- package/dist/src/module/introspector/dagger_module/function.d.ts.map +1 -1
- package/dist/src/module/introspector/dagger_module/function.js +14 -9
- package/dist/src/module/introspector/dagger_module/interfaceFunction.d.ts +2 -1
- package/dist/src/module/introspector/dagger_module/interfaceFunction.d.ts.map +1 -1
- package/dist/src/module/introspector/dagger_module/interfaceFunction.js +3 -2
- package/dist/src/module/introspector/dagger_module/module.d.ts.map +1 -1
- package/dist/src/module/introspector/dagger_module/module.js +1 -5
- package/dist/src/module/introspector/index.d.ts +1 -1
- package/dist/src/module/introspector/index.d.ts.map +1 -1
- package/dist/src/module/introspector/index.js +5 -2
- package/dist/src/module/introspector/typescript_module/ast.d.ts +1 -0
- package/dist/src/module/introspector/typescript_module/ast.d.ts.map +1 -1
- package/dist/src/module/introspector/typescript_module/ast.js +76 -16
- package/dist/src/module/introspector/typescript_module/index.d.ts +0 -1
- package/dist/src/module/introspector/typescript_module/index.d.ts.map +1 -1
- package/dist/src/module/introspector/typescript_module/index.js +0 -1
- package/dist/src/module/registry.d.ts +14 -0
- package/dist/src/module/registry.d.ts.map +1 -1
- package/dist/src/provisioning/default.d.ts +1 -1
- package/dist/src/provisioning/default.js +1 -1
- package/package.json +15 -15
- package/dist/src/module/introspector/typescript_module/explorer.d.ts +0 -4
- package/dist/src/module/introspector/typescript_module/explorer.d.ts.map +0 -1
- package/dist/src/module/introspector/typescript_module/explorer.js +0 -16
|
@@ -112,6 +112,47 @@ function ExistsTypeNameToValue(name) {
|
|
|
112
112
|
return name;
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* The behavior configured for function result caching.
|
|
117
|
+
*/
|
|
118
|
+
export var FunctionCachePolicy;
|
|
119
|
+
(function (FunctionCachePolicy) {
|
|
120
|
+
FunctionCachePolicy["Default"] = "Default";
|
|
121
|
+
FunctionCachePolicy["Never"] = "Never";
|
|
122
|
+
FunctionCachePolicy["PerSession"] = "PerSession";
|
|
123
|
+
})(FunctionCachePolicy || (FunctionCachePolicy = {}));
|
|
124
|
+
/**
|
|
125
|
+
* Utility function to convert a FunctionCachePolicy value to its name so
|
|
126
|
+
* it can be uses as argument to call a exposed function.
|
|
127
|
+
*/
|
|
128
|
+
function FunctionCachePolicyValueToName(value) {
|
|
129
|
+
switch (value) {
|
|
130
|
+
case FunctionCachePolicy.Default:
|
|
131
|
+
return "Default";
|
|
132
|
+
case FunctionCachePolicy.Never:
|
|
133
|
+
return "Never";
|
|
134
|
+
case FunctionCachePolicy.PerSession:
|
|
135
|
+
return "PerSession";
|
|
136
|
+
default:
|
|
137
|
+
return value;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Utility function to convert a FunctionCachePolicy name to its value so
|
|
142
|
+
* it can be properly used inside the module runtime.
|
|
143
|
+
*/
|
|
144
|
+
function FunctionCachePolicyNameToValue(name) {
|
|
145
|
+
switch (name) {
|
|
146
|
+
case "Default":
|
|
147
|
+
return FunctionCachePolicy.Default;
|
|
148
|
+
case "Never":
|
|
149
|
+
return FunctionCachePolicy.Never;
|
|
150
|
+
case "PerSession":
|
|
151
|
+
return FunctionCachePolicy.PerSession;
|
|
152
|
+
default:
|
|
153
|
+
return name;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
115
156
|
/**
|
|
116
157
|
* Compression algorithm to use for image layers.
|
|
117
158
|
*/
|
|
@@ -197,6 +238,40 @@ function ImageMediaTypesNameToValue(name) {
|
|
|
197
238
|
return name;
|
|
198
239
|
}
|
|
199
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* Experimental features of a module
|
|
243
|
+
*/
|
|
244
|
+
export var ModuleSourceExperimentalFeature;
|
|
245
|
+
(function (ModuleSourceExperimentalFeature) {
|
|
246
|
+
/**
|
|
247
|
+
* Self calls
|
|
248
|
+
*/
|
|
249
|
+
ModuleSourceExperimentalFeature["SelfCalls"] = "SELF_CALLS";
|
|
250
|
+
})(ModuleSourceExperimentalFeature || (ModuleSourceExperimentalFeature = {}));
|
|
251
|
+
/**
|
|
252
|
+
* Utility function to convert a ModuleSourceExperimentalFeature value to its name so
|
|
253
|
+
* it can be uses as argument to call a exposed function.
|
|
254
|
+
*/
|
|
255
|
+
function ModuleSourceExperimentalFeatureValueToName(value) {
|
|
256
|
+
switch (value) {
|
|
257
|
+
case ModuleSourceExperimentalFeature.SelfCalls:
|
|
258
|
+
return "SELF_CALLS";
|
|
259
|
+
default:
|
|
260
|
+
return value;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Utility function to convert a ModuleSourceExperimentalFeature name to its value so
|
|
265
|
+
* it can be properly used inside the module runtime.
|
|
266
|
+
*/
|
|
267
|
+
function ModuleSourceExperimentalFeatureNameToValue(name) {
|
|
268
|
+
switch (name) {
|
|
269
|
+
case "SELF_CALLS":
|
|
270
|
+
return ModuleSourceExperimentalFeature.SelfCalls;
|
|
271
|
+
default:
|
|
272
|
+
return name;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
200
275
|
/**
|
|
201
276
|
* The kind of module source.
|
|
202
277
|
*/
|
|
@@ -854,14 +929,16 @@ export class CacheVolume extends BaseClient {
|
|
|
854
929
|
export class Changeset extends BaseClient {
|
|
855
930
|
_id = undefined;
|
|
856
931
|
_export = undefined;
|
|
932
|
+
_isEmpty = undefined;
|
|
857
933
|
_sync = undefined;
|
|
858
934
|
/**
|
|
859
935
|
* Constructor is used for internal usage only, do not create object from it.
|
|
860
936
|
*/
|
|
861
|
-
constructor(ctx, _id, _export, _sync) {
|
|
937
|
+
constructor(ctx, _id, _export, _isEmpty, _sync) {
|
|
862
938
|
super(ctx);
|
|
863
939
|
this._id = _id;
|
|
864
940
|
this._export = _export;
|
|
941
|
+
this._isEmpty = _isEmpty;
|
|
865
942
|
this._sync = _sync;
|
|
866
943
|
}
|
|
867
944
|
/**
|
|
@@ -916,6 +993,17 @@ export class Changeset extends BaseClient {
|
|
|
916
993
|
const response = await ctx.execute();
|
|
917
994
|
return response;
|
|
918
995
|
};
|
|
996
|
+
/**
|
|
997
|
+
* Returns true if the changeset is empty (i.e. there are no changes).
|
|
998
|
+
*/
|
|
999
|
+
isEmpty = async () => {
|
|
1000
|
+
if (this._isEmpty) {
|
|
1001
|
+
return this._isEmpty;
|
|
1002
|
+
}
|
|
1003
|
+
const ctx = this._ctx.select("isEmpty");
|
|
1004
|
+
const response = await ctx.execute();
|
|
1005
|
+
return response;
|
|
1006
|
+
};
|
|
919
1007
|
/**
|
|
920
1008
|
* Return a snapshot containing only the created and modified files
|
|
921
1009
|
*/
|
|
@@ -1514,6 +1602,7 @@ export class Container extends BaseClient {
|
|
|
1514
1602
|
* @param source Identifier of the directory to write
|
|
1515
1603
|
* @param opts.exclude Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
|
|
1516
1604
|
* @param opts.include Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
|
|
1605
|
+
* @param opts.gitignore Apply .gitignore rules when writing the directory.
|
|
1517
1606
|
* @param opts.owner A user:group to set for the directory and its contents.
|
|
1518
1607
|
*
|
|
1519
1608
|
* The user and group can either be an ID (1000:1000) or a name (foo:bar).
|
|
@@ -1544,6 +1633,14 @@ export class Container extends BaseClient {
|
|
|
1544
1633
|
const ctx = this._ctx.select("withEnvVariable", { name, value, ...opts });
|
|
1545
1634
|
return new Container(ctx);
|
|
1546
1635
|
};
|
|
1636
|
+
/**
|
|
1637
|
+
* Raise an error.
|
|
1638
|
+
* @param err Message of the error to raise. If empty, the error will be ignored.
|
|
1639
|
+
*/
|
|
1640
|
+
withError = (err) => {
|
|
1641
|
+
const ctx = this._ctx.select("withError", { err });
|
|
1642
|
+
return new Container(ctx);
|
|
1643
|
+
};
|
|
1547
1644
|
/**
|
|
1548
1645
|
* Execute a command in the container, and return a new snapshot of the container state after execution.
|
|
1549
1646
|
* @param args Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
|
|
@@ -2039,6 +2136,7 @@ export class CurrentModule extends BaseClient {
|
|
|
2039
2136
|
* @param path Location of the directory to access (e.g., ".").
|
|
2040
2137
|
* @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
|
|
2041
2138
|
* @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
|
|
2139
|
+
* @param opts.gitignore Apply .gitignore filter rules inside the directory
|
|
2042
2140
|
*/
|
|
2043
2141
|
workdir = (path, opts) => {
|
|
2044
2142
|
const ctx = this._ctx.select("workdir", { path, ...opts });
|
|
@@ -2237,6 +2335,7 @@ export class Directory extends BaseClient {
|
|
|
2237
2335
|
* Return a snapshot with some paths included or excluded
|
|
2238
2336
|
* @param opts.exclude If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
|
|
2239
2337
|
* @param opts.include If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
|
|
2338
|
+
* @param opts.gitignore If set, apply .gitignore rules when filtering the directory.
|
|
2240
2339
|
*/
|
|
2241
2340
|
filter = (opts) => {
|
|
2242
2341
|
const ctx = this._ctx.select("filter", { ...opts });
|
|
@@ -2329,6 +2428,7 @@ export class Directory extends BaseClient {
|
|
|
2329
2428
|
* @param source Identifier of the directory to copy.
|
|
2330
2429
|
* @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
|
|
2331
2430
|
* @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
|
|
2431
|
+
* @param opts.gitignore Apply .gitignore filter rules inside the directory
|
|
2332
2432
|
* @param opts.owner A user:group to set for the copied directory and its contents.
|
|
2333
2433
|
*
|
|
2334
2434
|
* The user and group must be an ID (1000:1000), not a name (foo:bar).
|
|
@@ -2339,6 +2439,14 @@ export class Directory extends BaseClient {
|
|
|
2339
2439
|
const ctx = this._ctx.select("withDirectory", { path, source, ...opts });
|
|
2340
2440
|
return new Directory(ctx);
|
|
2341
2441
|
};
|
|
2442
|
+
/**
|
|
2443
|
+
* Raise an error.
|
|
2444
|
+
* @param err Message of the error to raise. If empty, the error will be ignored.
|
|
2445
|
+
*/
|
|
2446
|
+
withError = (err) => {
|
|
2447
|
+
const ctx = this._ctx.select("withError", { err });
|
|
2448
|
+
return new Directory(ctx);
|
|
2449
|
+
};
|
|
2342
2450
|
/**
|
|
2343
2451
|
* Retrieves this directory plus the contents of the given file copied to the given path.
|
|
2344
2452
|
* @param path Location of the copied file (e.g., "/file.txt").
|
|
@@ -2458,12 +2566,14 @@ export class Directory extends BaseClient {
|
|
|
2458
2566
|
*/
|
|
2459
2567
|
export class Engine extends BaseClient {
|
|
2460
2568
|
_id = undefined;
|
|
2569
|
+
_name = undefined;
|
|
2461
2570
|
/**
|
|
2462
2571
|
* Constructor is used for internal usage only, do not create object from it.
|
|
2463
2572
|
*/
|
|
2464
|
-
constructor(ctx, _id) {
|
|
2573
|
+
constructor(ctx, _id, _name) {
|
|
2465
2574
|
super(ctx);
|
|
2466
2575
|
this._id = _id;
|
|
2576
|
+
this._name = _name;
|
|
2467
2577
|
}
|
|
2468
2578
|
/**
|
|
2469
2579
|
* A unique identifier for this Engine.
|
|
@@ -2476,6 +2586,14 @@ export class Engine extends BaseClient {
|
|
|
2476
2586
|
const response = await ctx.execute();
|
|
2477
2587
|
return response;
|
|
2478
2588
|
};
|
|
2589
|
+
/**
|
|
2590
|
+
* The list of connected client IDs
|
|
2591
|
+
*/
|
|
2592
|
+
clients = async () => {
|
|
2593
|
+
const ctx = this._ctx.select("clients");
|
|
2594
|
+
const response = await ctx.execute();
|
|
2595
|
+
return response;
|
|
2596
|
+
};
|
|
2479
2597
|
/**
|
|
2480
2598
|
* The local (on-disk) cache for the Dagger engine
|
|
2481
2599
|
*/
|
|
@@ -2483,6 +2601,17 @@ export class Engine extends BaseClient {
|
|
|
2483
2601
|
const ctx = this._ctx.select("localCache");
|
|
2484
2602
|
return new EngineCache(ctx);
|
|
2485
2603
|
};
|
|
2604
|
+
/**
|
|
2605
|
+
* The name of the engine instance.
|
|
2606
|
+
*/
|
|
2607
|
+
name = async () => {
|
|
2608
|
+
if (this._name) {
|
|
2609
|
+
return this._name;
|
|
2610
|
+
}
|
|
2611
|
+
const ctx = this._ctx.select("name");
|
|
2612
|
+
const response = await ctx.execute();
|
|
2613
|
+
return response;
|
|
2614
|
+
};
|
|
2486
2615
|
}
|
|
2487
2616
|
/**
|
|
2488
2617
|
* A cache storage for the Dagger engine
|
|
@@ -3526,6 +3655,14 @@ export class EnvFile extends BaseClient {
|
|
|
3526
3655
|
const response = await ctx.execute();
|
|
3527
3656
|
return response;
|
|
3528
3657
|
};
|
|
3658
|
+
/**
|
|
3659
|
+
* Filters variables by prefix and removes the pref from keys. Variables without the prefix are excluded. For example, with the prefix "MY_APP_" and variables: MY_APP_TOKEN=topsecret MY_APP_NAME=hello FOO=bar the resulting environment will contain: TOKEN=topsecret NAME=hello
|
|
3660
|
+
* @param prefix The prefix to filter by
|
|
3661
|
+
*/
|
|
3662
|
+
namespace_ = (prefix) => {
|
|
3663
|
+
const ctx = this._ctx.select("namespace", { prefix });
|
|
3664
|
+
return new EnvFile(ctx);
|
|
3665
|
+
};
|
|
3529
3666
|
/**
|
|
3530
3667
|
* Return all variables
|
|
3531
3668
|
* @param opts.raw Return values exactly as written to the file. No quote removal or variable expansion
|
|
@@ -4062,6 +4199,22 @@ export class Function_ extends BaseClient {
|
|
|
4062
4199
|
const ctx = this._ctx.select("withArg", { name, typeDef, ...opts });
|
|
4063
4200
|
return new Function_(ctx);
|
|
4064
4201
|
};
|
|
4202
|
+
/**
|
|
4203
|
+
* Returns the function updated to use the provided cache policy.
|
|
4204
|
+
* @param policy The cache policy to use.
|
|
4205
|
+
* @param opts.timeToLive The TTL for the cache policy, if applicable. Provided as a duration string, e.g. "5m", "1h30s".
|
|
4206
|
+
*/
|
|
4207
|
+
withCachePolicy = (policy, opts) => {
|
|
4208
|
+
const metadata = {
|
|
4209
|
+
policy: { is_enum: true, value_to_name: FunctionCachePolicyValueToName },
|
|
4210
|
+
};
|
|
4211
|
+
const ctx = this._ctx.select("withCachePolicy", {
|
|
4212
|
+
policy,
|
|
4213
|
+
...opts,
|
|
4214
|
+
__metadata: metadata,
|
|
4215
|
+
});
|
|
4216
|
+
return new Function_(ctx);
|
|
4217
|
+
};
|
|
4065
4218
|
/**
|
|
4066
4219
|
* Returns the function with the given doc string.
|
|
4067
4220
|
* @param description The doc string to set.
|
|
@@ -4567,6 +4720,13 @@ export class GitRepository extends BaseClient {
|
|
|
4567
4720
|
const response = await ctx.execute();
|
|
4568
4721
|
return response;
|
|
4569
4722
|
};
|
|
4723
|
+
/**
|
|
4724
|
+
* Returns the changeset of uncommitted changes in the git repository.
|
|
4725
|
+
*/
|
|
4726
|
+
uncommitted = () => {
|
|
4727
|
+
const ctx = this._ctx.select("uncommitted");
|
|
4728
|
+
return new Changeset(ctx);
|
|
4729
|
+
};
|
|
4570
4730
|
/**
|
|
4571
4731
|
* The URL of the git repository.
|
|
4572
4732
|
*/
|
|
@@ -5432,6 +5592,17 @@ export class Module_ extends BaseClient {
|
|
|
5432
5592
|
const response = await ctx.execute();
|
|
5433
5593
|
return response.map((r) => new Client(ctx.copy()).loadTypeDefFromID(r.id));
|
|
5434
5594
|
};
|
|
5595
|
+
/**
|
|
5596
|
+
* The introspection schema JSON file for this module.
|
|
5597
|
+
*
|
|
5598
|
+
* This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
|
|
5599
|
+
*
|
|
5600
|
+
* Note: this is in the context of a module, so some core types may be hidden.
|
|
5601
|
+
*/
|
|
5602
|
+
introspectionSchemaJSON = () => {
|
|
5603
|
+
const ctx = this._ctx.select("introspectionSchemaJSON");
|
|
5604
|
+
return new File(ctx);
|
|
5605
|
+
};
|
|
5435
5606
|
/**
|
|
5436
5607
|
* The name of the module
|
|
5437
5608
|
*/
|
|
@@ -5791,6 +5962,17 @@ export class ModuleSource extends BaseClient {
|
|
|
5791
5962
|
const response = await ctx.execute();
|
|
5792
5963
|
return response;
|
|
5793
5964
|
};
|
|
5965
|
+
/**
|
|
5966
|
+
* The introspection schema JSON file for this module source.
|
|
5967
|
+
*
|
|
5968
|
+
* This file represents the schema visible to the module's source code, including all core types and those from the dependencies.
|
|
5969
|
+
*
|
|
5970
|
+
* Note: this is in the context of a module, so some core types may be hidden.
|
|
5971
|
+
*/
|
|
5972
|
+
introspectionSchemaJSON = () => {
|
|
5973
|
+
const ctx = this._ctx.select("introspectionSchemaJSON");
|
|
5974
|
+
return new File(ctx);
|
|
5975
|
+
};
|
|
5794
5976
|
/**
|
|
5795
5977
|
* The kind of module source (currently local, git or dir).
|
|
5796
5978
|
*/
|
|
@@ -5905,6 +6087,14 @@ export class ModuleSource extends BaseClient {
|
|
|
5905
6087
|
const response = await ctx.execute();
|
|
5906
6088
|
return new Client(ctx.copy()).loadModuleSourceFromID(response);
|
|
5907
6089
|
};
|
|
6090
|
+
/**
|
|
6091
|
+
* The toolchains referenced by the module source.
|
|
6092
|
+
*/
|
|
6093
|
+
toolchains = async () => {
|
|
6094
|
+
const ctx = this._ctx.select("toolchains").select("id");
|
|
6095
|
+
const response = await ctx.execute();
|
|
6096
|
+
return response.map((r) => new Client(ctx.copy()).loadModuleSourceFromID(r.id));
|
|
6097
|
+
};
|
|
5908
6098
|
/**
|
|
5909
6099
|
* User-defined defaults read from local .env files
|
|
5910
6100
|
*/
|
|
@@ -5956,6 +6146,14 @@ export class ModuleSource extends BaseClient {
|
|
|
5956
6146
|
const ctx = this._ctx.select("withEngineVersion", { version });
|
|
5957
6147
|
return new ModuleSource(ctx);
|
|
5958
6148
|
};
|
|
6149
|
+
/**
|
|
6150
|
+
* Enable the experimental features for the module source.
|
|
6151
|
+
* @param features The experimental features to enable.
|
|
6152
|
+
*/
|
|
6153
|
+
withExperimentalFeatures = (features) => {
|
|
6154
|
+
const ctx = this._ctx.select("withExperimentalFeatures", { features });
|
|
6155
|
+
return new ModuleSource(ctx);
|
|
6156
|
+
};
|
|
5959
6157
|
/**
|
|
5960
6158
|
* Update the module source with additional include patterns for files+directories from its context that are required for building it
|
|
5961
6159
|
* @param patterns The new additional include patterns.
|
|
@@ -5988,6 +6186,14 @@ export class ModuleSource extends BaseClient {
|
|
|
5988
6186
|
const ctx = this._ctx.select("withSourceSubpath", { path });
|
|
5989
6187
|
return new ModuleSource(ctx);
|
|
5990
6188
|
};
|
|
6189
|
+
/**
|
|
6190
|
+
* Add toolchains to the module source.
|
|
6191
|
+
* @param toolchains The toolchain modules to add.
|
|
6192
|
+
*/
|
|
6193
|
+
withToolchains = (toolchains) => {
|
|
6194
|
+
const ctx = this._ctx.select("withToolchains", { toolchains });
|
|
6195
|
+
return new ModuleSource(ctx);
|
|
6196
|
+
};
|
|
5991
6197
|
/**
|
|
5992
6198
|
* Update the blueprint module to the latest version.
|
|
5993
6199
|
*/
|
|
@@ -6003,6 +6209,14 @@ export class ModuleSource extends BaseClient {
|
|
|
6003
6209
|
const ctx = this._ctx.select("withUpdateDependencies", { dependencies });
|
|
6004
6210
|
return new ModuleSource(ctx);
|
|
6005
6211
|
};
|
|
6212
|
+
/**
|
|
6213
|
+
* Update one or more toolchains.
|
|
6214
|
+
* @param toolchains The toolchains to update.
|
|
6215
|
+
*/
|
|
6216
|
+
withUpdateToolchains = (toolchains) => {
|
|
6217
|
+
const ctx = this._ctx.select("withUpdateToolchains", { toolchains });
|
|
6218
|
+
return new ModuleSource(ctx);
|
|
6219
|
+
};
|
|
6006
6220
|
/**
|
|
6007
6221
|
* Update one or more clients.
|
|
6008
6222
|
* @param clients The clients to update
|
|
@@ -6034,6 +6248,22 @@ export class ModuleSource extends BaseClient {
|
|
|
6034
6248
|
const ctx = this._ctx.select("withoutDependencies", { dependencies });
|
|
6035
6249
|
return new ModuleSource(ctx);
|
|
6036
6250
|
};
|
|
6251
|
+
/**
|
|
6252
|
+
* Disable experimental features for the module source.
|
|
6253
|
+
* @param features The experimental features to disable.
|
|
6254
|
+
*/
|
|
6255
|
+
withoutExperimentalFeatures = (features) => {
|
|
6256
|
+
const ctx = this._ctx.select("withoutExperimentalFeatures", { features });
|
|
6257
|
+
return new ModuleSource(ctx);
|
|
6258
|
+
};
|
|
6259
|
+
/**
|
|
6260
|
+
* Remove the provided toolchains from the module source.
|
|
6261
|
+
* @param toolchains The toolchains to remove.
|
|
6262
|
+
*/
|
|
6263
|
+
withoutToolchains = (toolchains) => {
|
|
6264
|
+
const ctx = this._ctx.select("withoutToolchains", { toolchains });
|
|
6265
|
+
return new ModuleSource(ctx);
|
|
6266
|
+
};
|
|
6037
6267
|
/**
|
|
6038
6268
|
* Call the provided function with current ModuleSource.
|
|
6039
6269
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../src/module/decorators.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,MAAM,wEAAkB,CAAA;AAErC;;;;;GAKG;AACH,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../src/module/decorators.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,MAAM,wEAAkB,CAAA;AAErC;;;;;GAKG;AACH,eAAO,MAAM,IAAI,gFAoC2rD,CAAC,8BApC5qD,CAAA;AAEjC;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,qEAAiB,CAAA;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,wEAAoB,CAAA;AAEzC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,QAAQ,yIAAoB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoint.d.ts","sourceRoot":"","sources":["../../../../src/module/entrypoint/entrypoint.ts"],"names":[],"mappings":"AAYA,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"entrypoint.d.ts","sourceRoot":"","sources":["../../../../src/module/entrypoint/entrypoint.ts"],"names":[],"mappings":"AAYA,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,iBA8D/C"}
|
|
@@ -13,8 +13,8 @@ export async function entrypoint(files) {
|
|
|
13
13
|
await connection(async () => {
|
|
14
14
|
const fnCall = dag.currentFunctionCall();
|
|
15
15
|
const moduleName = await dag.currentModule().name();
|
|
16
|
-
const parentName = await fnCall.parentName();
|
|
17
16
|
const scanResult = await scan(files, moduleName);
|
|
17
|
+
const parentName = await fnCall.parentName();
|
|
18
18
|
// Pre allocate the result, we got one in both case.
|
|
19
19
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
20
|
let result;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"introspection_entrypoint.d.ts","sourceRoot":"","sources":["../../../../src/module/entrypoint/introspection_entrypoint.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as fs from "fs";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
import { connection } from "../../connect.js";
|
|
4
|
+
import { scan } from "../introspector/index.js";
|
|
5
|
+
import { Register } from "./register.js";
|
|
6
|
+
async function introspection(files, moduleName) {
|
|
7
|
+
return await scan(files, moduleName, false);
|
|
8
|
+
}
|
|
9
|
+
const allowedExtensions = [".ts", ".mts"];
|
|
10
|
+
function getTsSourceCodeFiles(dir) {
|
|
11
|
+
return fs
|
|
12
|
+
.readdirSync(dir)
|
|
13
|
+
.map((file) => {
|
|
14
|
+
const filepath = path.join(dir, file);
|
|
15
|
+
const stat = fs.statSync(filepath);
|
|
16
|
+
if (stat.isDirectory()) {
|
|
17
|
+
return getTsSourceCodeFiles(filepath);
|
|
18
|
+
}
|
|
19
|
+
const ext = path.extname(filepath);
|
|
20
|
+
if (allowedExtensions.find((allowedExt) => allowedExt === ext)) {
|
|
21
|
+
return [path.join(dir, file)];
|
|
22
|
+
}
|
|
23
|
+
return [];
|
|
24
|
+
})
|
|
25
|
+
.reduce((p, c) => [...c, ...p]);
|
|
26
|
+
}
|
|
27
|
+
async function main() {
|
|
28
|
+
const args = process.argv.slice(2);
|
|
29
|
+
if (args.length < 3) {
|
|
30
|
+
console.log("usage: introspection <moduleName> <userSourceCodeDir> <typescriptClientFile>");
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
const moduleName = args[0];
|
|
34
|
+
const userSourceCodeDir = args[1];
|
|
35
|
+
const typescriptClientFile = args[2];
|
|
36
|
+
const userSourceCodeFiles = getTsSourceCodeFiles(userSourceCodeDir);
|
|
37
|
+
const result = await introspection([...userSourceCodeFiles, typescriptClientFile], moduleName);
|
|
38
|
+
if (process.env.DRY_RUN) {
|
|
39
|
+
console.log(JSON.stringify(result, null, 2));
|
|
40
|
+
process.exit(0);
|
|
41
|
+
}
|
|
42
|
+
// TODO(TomChv): move that logic inside the engine at some point
|
|
43
|
+
// so we don't even need a connection.
|
|
44
|
+
// Idea: We should output a JSON schema of the module that can be transformed
|
|
45
|
+
// into a Dagger module by the engine.
|
|
46
|
+
await connection(async () => {
|
|
47
|
+
const outputFilePath = process.env.TYPEDEF_OUTPUT_FILE ?? "/module-id.json";
|
|
48
|
+
const moduleID = await new Register(result).run();
|
|
49
|
+
await fs.promises.writeFile(outputFilePath, JSON.stringify(moduleID));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
main();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/module/entrypoint/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAET,QAAQ,EACR,OAAO,
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/module/entrypoint/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAET,QAAQ,EACR,OAAO,EAKR,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,eAAe,IAAI,SAAS,EAC5B,iBAAiB,IAAI,WAAW,EAChC,cAAc,IAAI,MAAM,EACxB,YAAY,EAEZ,cAAc,EACf,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAA;AAU5F,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAEjD;;OAEG;IACG,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;IAgF9B;;OAEG;IACH,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,GAAG,SAAS;IAInE;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS;IA2B7D;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,CAAC,GAAG,EAAE,SAAS,KAAK,SAAS;IAkDtD;;;;;;;OAOG;IACH,sBAAsB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,GAAG,SAAS;CA4BjE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dag, TypeDefKind, } from "../../api/client.gen.js";
|
|
1
|
+
import { dag, TypeDefKind, FunctionCachePolicy, } from "../../api/client.gen.js";
|
|
2
2
|
export class Register {
|
|
3
3
|
module;
|
|
4
4
|
constructor(module) {
|
|
@@ -77,11 +77,29 @@ export class Register {
|
|
|
77
77
|
* Create a function in the Dagger API.
|
|
78
78
|
*/
|
|
79
79
|
addFunction(fct) {
|
|
80
|
-
|
|
80
|
+
let fnDef = dag
|
|
81
81
|
.function_(fct.alias ?? fct.name, addTypeDef(fct.returnType))
|
|
82
82
|
.withDescription(fct.description)
|
|
83
83
|
.withSourceMap(addSourceMap(fct))
|
|
84
84
|
.with(this.addArg(fct.arguments));
|
|
85
|
+
switch (fct.cache) {
|
|
86
|
+
case "never": {
|
|
87
|
+
fnDef = fnDef.withCachePolicy(FunctionCachePolicy.Never);
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
case "session": {
|
|
91
|
+
fnDef = fnDef.withCachePolicy(FunctionCachePolicy.PerSession);
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
case "": {
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
default: {
|
|
98
|
+
const opts = { timeToLive: fct.cache };
|
|
99
|
+
fnDef = fnDef.withCachePolicy(FunctionCachePolicy.Default, opts);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return fnDef;
|
|
85
103
|
}
|
|
86
104
|
/**
|
|
87
105
|
* Register all arguments in the function.
|
|
@@ -15,13 +15,13 @@ export declare class DaggerFunction extends Locatable {
|
|
|
15
15
|
description: string;
|
|
16
16
|
private _returnTypeRef?;
|
|
17
17
|
returnType?: TypeDef<TypeDefKind>;
|
|
18
|
-
alias: string | undefined;
|
|
19
18
|
arguments: DaggerArguments;
|
|
19
|
+
alias: string | undefined;
|
|
20
|
+
cache: string | undefined;
|
|
20
21
|
private signature;
|
|
21
22
|
private symbol;
|
|
22
23
|
constructor(node: ts.MethodDeclaration, ast: AST);
|
|
23
24
|
private getReturnType;
|
|
24
|
-
private getAlias;
|
|
25
25
|
getArgsOrder(): string[];
|
|
26
26
|
getReferences(): string[];
|
|
27
27
|
propagateReferences(references: References): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAGxD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EACL,GAAG,EAGJ,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAkB,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,MAAM,MAAM,eAAe,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAA;CAAE,CAAA;AAEhE,qBAAa,cAAe,SAAQ,SAAS;IAazC,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAbf,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IAC1B,OAAO,CAAC,cAAc,CAAC,CAAQ;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;IACjC,SAAS,EAAE,eAAe,CAAK;IAC/B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IAEhC,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,MAAM,CAAW;gBAGN,IAAI,EAAE,EAAE,CAAC,iBAAiB,EAC1B,GAAG,EAAE,GAAG;IAgC3B,OAAO,CAAC,aAAa;IAWd,YAAY,IAAI,MAAM,EAAE;IAIxB,aAAa,IAAI,MAAM,EAAE;IAoBzB,mBAAmB,CAAC,UAAU,EAAE,UAAU;IAuB1C,MAAM;;;;;;;CASd"}
|
|
@@ -10,8 +10,9 @@ export class DaggerFunction extends Locatable {
|
|
|
10
10
|
description;
|
|
11
11
|
_returnTypeRef;
|
|
12
12
|
returnType;
|
|
13
|
-
alias;
|
|
14
13
|
arguments = {};
|
|
14
|
+
alias;
|
|
15
|
+
cache;
|
|
15
16
|
signature;
|
|
16
17
|
symbol;
|
|
17
18
|
constructor(node, ast) {
|
|
@@ -22,11 +23,22 @@ export class DaggerFunction extends Locatable {
|
|
|
22
23
|
this.signature = this.ast.getSignatureFromFunctionOrThrow(node);
|
|
23
24
|
this.name = this.node.name.getText();
|
|
24
25
|
this.description = this.ast.getDocFromSymbol(this.symbol);
|
|
26
|
+
const functionArguments = this.ast.getDecoratorArgument(this.node, FUNCTION_DECORATOR, "object");
|
|
27
|
+
if (functionArguments) {
|
|
28
|
+
if (typeof functionArguments === "string") {
|
|
29
|
+
// previously only a single arg was accepted for alias, so if there's just
|
|
30
|
+
// a string we intrepret it that way for backward compatibility
|
|
31
|
+
this.alias = functionArguments;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.alias = functionArguments.alias;
|
|
35
|
+
this.cache = functionArguments.cache;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
25
38
|
for (const parameter of this.node.parameters) {
|
|
26
39
|
this.arguments[parameter.name.getText()] = new DaggerArgument(parameter, this.ast);
|
|
27
40
|
}
|
|
28
41
|
this.returnType = this.getReturnType();
|
|
29
|
-
this.alias = this.getAlias();
|
|
30
42
|
}
|
|
31
43
|
getReturnType() {
|
|
32
44
|
const type = this.signature.getReturnType();
|
|
@@ -36,13 +48,6 @@ export class DaggerFunction extends Locatable {
|
|
|
36
48
|
}
|
|
37
49
|
return typedef;
|
|
38
50
|
}
|
|
39
|
-
getAlias() {
|
|
40
|
-
const alias = this.ast.getDecoratorArgument(this.node, FUNCTION_DECORATOR, "string");
|
|
41
|
-
if (!alias) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
return JSON.parse(alias.replace(/'/g, '"'));
|
|
45
|
-
}
|
|
46
51
|
getArgsOrder() {
|
|
47
52
|
return Object.keys(this.arguments);
|
|
48
53
|
}
|
|
@@ -16,9 +16,10 @@ export declare class DaggerInterfaceFunction extends Locatable {
|
|
|
16
16
|
private _returnTypeRef?;
|
|
17
17
|
returnType?: TypeDef<TypeDefKind>;
|
|
18
18
|
arguments: DaggerArguments;
|
|
19
|
-
alias: undefined;
|
|
20
19
|
private symbol;
|
|
21
20
|
private signature?;
|
|
21
|
+
alias: undefined;
|
|
22
|
+
cache: undefined;
|
|
22
23
|
constructor(node: ts.PropertySignature | ts.MethodSignature, ast: AST);
|
|
23
24
|
getReferences(): string[];
|
|
24
25
|
propagateReferences(references: References): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaceFunction.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/interfaceFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EACL,GAAG,EAGJ,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAkB,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,MAAM,MAAM,wBAAwB,GAAG;IACrC,CAAC,IAAI,EAAE,MAAM,GAAG,uBAAuB,CAAA;CACxC,CAAA;AAED,qBAAa,uBAAwB,SAAQ,SAAS;
|
|
1
|
+
{"version":3,"file":"interfaceFunction.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/interfaceFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EACL,GAAG,EAGJ,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAkB,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,MAAM,MAAM,wBAAwB,GAAG;IACrC,CAAC,IAAI,EAAE,MAAM,GAAG,uBAAuB,CAAA;CACxC,CAAA;AAED,qBAAa,uBAAwB,SAAQ,SAAS;IAclD,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAdf,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IAC1B,OAAO,CAAC,cAAc,CAAC,CAAQ;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;IACjC,SAAS,EAAE,eAAe,CAAK;IACtC,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,SAAS,CAAC,CAAc;IAGzB,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,SAAS,CAAA;gBAGJ,IAAI,EAAE,EAAE,CAAC,iBAAiB,GAAG,EAAE,CAAC,eAAe,EAC/C,GAAG,EAAE,GAAG;IA2CpB,aAAa,IAAI,MAAM,EAAE;IAqBzB,mBAAmB,CAAC,UAAU,EAAE,UAAU;IAuB1C,MAAM;;;;;;CAQd"}
|
|
@@ -11,10 +11,11 @@ export class DaggerInterfaceFunction extends Locatable {
|
|
|
11
11
|
_returnTypeRef;
|
|
12
12
|
returnType;
|
|
13
13
|
arguments = {};
|
|
14
|
-
// Just a placeholder to be compatible with `Method` during registration
|
|
15
|
-
alias;
|
|
16
14
|
symbol;
|
|
17
15
|
signature;
|
|
16
|
+
// Just placeholders to be compatible with `Method` during registration
|
|
17
|
+
alias;
|
|
18
|
+
cache;
|
|
18
19
|
constructor(node, ast) {
|
|
19
20
|
super(node);
|
|
20
21
|
this.node = node;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/module.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAKhC,OAAO,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/module.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAKhC,OAAO,EACL,GAAG,EAGJ,MAAM,+BAA+B,CAAA;AAGtC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,EAAmB,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAElE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAInD;;;;;;;;GAQG;AACH,qBAAa,YAAY;IA4Dd,IAAI,EAAE,MAAM;IACnB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,GAAG;IA7Db;;;;;;;;;;;;;;;;;;;OAmBG;IACI,OAAO,EAAE,iBAAiB,CAAK;IAEtC;;;;;;;;;;;OAWG;IACI,KAAK,EAAE,eAAe,CAAK;IAElC;;;;;;;;;;OAUG;IACI,UAAU,EAAE,gBAAgB,CAAK;IAEjC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAEtC,OAAO,CAAC,UAAU,CAKjB;gBAGQ,IAAI,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAAE,EACpB,GAAG,EAAE,GAAG;IAuBlB;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,iBAAiB;IAkIzB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,gBAAgB;IAsExB;;OAEG;IACH,OAAO,CAAC,WAAW;IA2BnB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAU3B;;OAEG;IACH,OAAO,CAAC,cAAc;IAgBtB,MAAM;;;;;;;CASP"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
import { TypeDefKind } from "../../../api/client.gen.js";
|
|
3
3
|
import { IntrospectionError } from "../../../common/errors/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { AST, CLIENT_GEN_FILE, } from "../typescript_module/index.js";
|
|
5
5
|
import { ENUM_DECORATOR, OBJECT_DECORATOR } from "./decorator.js";
|
|
6
6
|
import { DaggerEnum } from "./enum.js";
|
|
7
7
|
import { DaggerEnumClass } from "./enumClass.js";
|
|
@@ -78,10 +78,6 @@ export class DaggerModule {
|
|
|
78
78
|
this.name = name;
|
|
79
79
|
this.userModule = userModule;
|
|
80
80
|
this.ast = ast;
|
|
81
|
-
const mainModule = findModuleByExportedName(this.name, this.userModule);
|
|
82
|
-
if (!mainModule) {
|
|
83
|
-
console.warn(`could not find module entrypoint: class ${this.name} from import. Class should be exported to benefit from all features.`);
|
|
84
|
-
}
|
|
85
81
|
const classObjects = this.findClasses();
|
|
86
82
|
for (const classObject of classObjects) {
|
|
87
83
|
// This only applies to cloud. If this is the true main object, it is correct
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DaggerModule } from "./dagger_module/index.js";
|
|
2
|
-
export declare function scan(files: string[], moduleName?: string): Promise<DaggerModule>;
|
|
2
|
+
export declare function scan(files: string[], moduleName?: string, loadModule?: boolean): Promise<DaggerModule>;
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|