@savvy-web/github-action-builder 0.7.11 → 0.8.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/bin/github-action-builder.js +1 -1
- package/cli/commands/init.js +1 -1
- package/errors.js +55 -16
- package/github-action.js +4 -4
- package/index.d.ts +105 -48
- package/index.js +2 -2
- package/package.json +5 -5
- package/schemas/config.js +21 -9
- package/services/build-live.js +1 -0
- package/services/build.js +4 -4
- package/services/config-live.js +28 -1
- package/services/config.js +5 -5
- package/services/persist-local-live.js +1 -1
- package/services/persist-local.js +2 -2
- package/services/validation.js +5 -5
- package/bin/github-action-builder.d.ts +0 -1
|
@@ -26,7 +26,7 @@ const rootCommand = Command.make("github-action-builder").pipe(Command.withSubco
|
|
|
26
26
|
*/
|
|
27
27
|
const cli = Command.run(rootCommand, {
|
|
28
28
|
name: "github-action-builder",
|
|
29
|
-
version: "0.
|
|
29
|
+
version: "0.8.0"
|
|
30
30
|
});
|
|
31
31
|
/**
|
|
32
32
|
* Combined layer: AppLayer + NodeContext for CLI.
|
package/cli/commands/init.js
CHANGED
|
@@ -20,7 +20,7 @@ const forceOption = Options.boolean("force").pipe(Options.withAlias("f"), Option
|
|
|
20
20
|
* Get current package version (replaced at build time).
|
|
21
21
|
*/
|
|
22
22
|
const getPackageVersion = () => {
|
|
23
|
-
return "0.
|
|
23
|
+
return "0.8.0";
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
26
|
* Generate package.json content.
|
package/errors.js
CHANGED
|
@@ -32,7 +32,7 @@ import { Data } from "effect";
|
|
|
32
32
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
33
33
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
34
34
|
*
|
|
35
|
-
* @
|
|
35
|
+
* @public
|
|
36
36
|
*/
|
|
37
37
|
const ConfigNotFoundBase = Data.TaggedError("ConfigNotFound");
|
|
38
38
|
/**
|
|
@@ -49,7 +49,7 @@ var ConfigNotFound = class extends ConfigNotFoundBase {};
|
|
|
49
49
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
50
50
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
51
51
|
*
|
|
52
|
-
* @
|
|
52
|
+
* @public
|
|
53
53
|
*/
|
|
54
54
|
const ConfigInvalidBase = Data.TaggedError("ConfigInvalid");
|
|
55
55
|
/**
|
|
@@ -66,7 +66,7 @@ var ConfigInvalid = class extends ConfigInvalidBase {};
|
|
|
66
66
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
67
67
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
68
68
|
*
|
|
69
|
-
* @
|
|
69
|
+
* @public
|
|
70
70
|
*/
|
|
71
71
|
const ConfigLoadFailedBase = Data.TaggedError("ConfigLoadFailed");
|
|
72
72
|
/**
|
|
@@ -83,7 +83,7 @@ var ConfigLoadFailed = class extends ConfigLoadFailedBase {};
|
|
|
83
83
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
84
84
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
85
85
|
*
|
|
86
|
-
* @
|
|
86
|
+
* @public
|
|
87
87
|
*/
|
|
88
88
|
const MainEntryMissingBase = Data.TaggedError("MainEntryMissing");
|
|
89
89
|
/**
|
|
@@ -93,6 +93,45 @@ const MainEntryMissingBase = Data.TaggedError("MainEntryMissing");
|
|
|
93
93
|
*/
|
|
94
94
|
var MainEntryMissing = class extends MainEntryMissingBase {};
|
|
95
95
|
/**
|
|
96
|
+
* Base class for WorkerEntryMissing error.
|
|
97
|
+
*
|
|
98
|
+
* @privateRemarks
|
|
99
|
+
* This export is required for api-extractor documentation generation.
|
|
100
|
+
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
101
|
+
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
102
|
+
*
|
|
103
|
+
* @public
|
|
104
|
+
*/
|
|
105
|
+
const WorkerEntryMissingBase = Data.TaggedError("WorkerEntryMissing");
|
|
106
|
+
/**
|
|
107
|
+
* Error when a worker entry source file is not found.
|
|
108
|
+
*
|
|
109
|
+
* @public
|
|
110
|
+
*/
|
|
111
|
+
var WorkerEntryMissing = class extends WorkerEntryMissingBase {};
|
|
112
|
+
/**
|
|
113
|
+
* Base class for WorkerEntryInvalidName error.
|
|
114
|
+
*
|
|
115
|
+
* @privateRemarks
|
|
116
|
+
* This export is required for api-extractor documentation generation.
|
|
117
|
+
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
118
|
+
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
119
|
+
*
|
|
120
|
+
* @public
|
|
121
|
+
*/
|
|
122
|
+
const WorkerEntryInvalidNameBase = Data.TaggedError("WorkerEntryInvalidName");
|
|
123
|
+
/**
|
|
124
|
+
* Error when a worker entry name is reserved or path-unsafe.
|
|
125
|
+
*
|
|
126
|
+
* @remarks
|
|
127
|
+
* A worker name becomes both an rsbuild entry key and the emitted filename
|
|
128
|
+
* (`dist/<name>.js`), so it must not collide with a lifecycle bundle
|
|
129
|
+
* (`main`/`pre`/`post`) or contain path separators that would escape `dist/`.
|
|
130
|
+
*
|
|
131
|
+
* @public
|
|
132
|
+
*/
|
|
133
|
+
var WorkerEntryInvalidName = class extends WorkerEntryInvalidNameBase {};
|
|
134
|
+
/**
|
|
96
135
|
* Base class for EntryFileMissing error.
|
|
97
136
|
*
|
|
98
137
|
* @privateRemarks
|
|
@@ -100,7 +139,7 @@ var MainEntryMissing = class extends MainEntryMissingBase {};
|
|
|
100
139
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
101
140
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
102
141
|
*
|
|
103
|
-
* @
|
|
142
|
+
* @public
|
|
104
143
|
*/
|
|
105
144
|
const EntryFileMissingBase = Data.TaggedError("EntryFileMissing");
|
|
106
145
|
/**
|
|
@@ -117,7 +156,7 @@ var EntryFileMissing = class extends EntryFileMissingBase {};
|
|
|
117
156
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
118
157
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
119
158
|
*
|
|
120
|
-
* @
|
|
159
|
+
* @public
|
|
121
160
|
*/
|
|
122
161
|
const ActionYmlMissingBase = Data.TaggedError("ActionYmlMissing");
|
|
123
162
|
/**
|
|
@@ -134,7 +173,7 @@ var ActionYmlMissing = class extends ActionYmlMissingBase {};
|
|
|
134
173
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
135
174
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
136
175
|
*
|
|
137
|
-
* @
|
|
176
|
+
* @public
|
|
138
177
|
*/
|
|
139
178
|
const ActionYmlSyntaxErrorBase = Data.TaggedError("ActionYmlSyntaxError");
|
|
140
179
|
/**
|
|
@@ -151,7 +190,7 @@ var ActionYmlSyntaxError = class extends ActionYmlSyntaxErrorBase {};
|
|
|
151
190
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
152
191
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
153
192
|
*
|
|
154
|
-
* @
|
|
193
|
+
* @public
|
|
155
194
|
*/
|
|
156
195
|
const ActionYmlSchemaErrorBase = Data.TaggedError("ActionYmlSchemaError");
|
|
157
196
|
/**
|
|
@@ -168,7 +207,7 @@ var ActionYmlSchemaError = class extends ActionYmlSchemaErrorBase {};
|
|
|
168
207
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
169
208
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
170
209
|
*
|
|
171
|
-
* @
|
|
210
|
+
* @public
|
|
172
211
|
*/
|
|
173
212
|
const ValidationFailedBase = Data.TaggedError("ValidationFailed");
|
|
174
213
|
/**
|
|
@@ -185,7 +224,7 @@ var ValidationFailed = class extends ValidationFailedBase {};
|
|
|
185
224
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
186
225
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
187
226
|
*
|
|
188
|
-
* @
|
|
227
|
+
* @public
|
|
189
228
|
*/
|
|
190
229
|
const BundleFailedBase = Data.TaggedError("BundleFailed");
|
|
191
230
|
/**
|
|
@@ -202,7 +241,7 @@ var BundleFailed = class extends BundleFailedBase {};
|
|
|
202
241
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
203
242
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
204
243
|
*
|
|
205
|
-
* @
|
|
244
|
+
* @public
|
|
206
245
|
*/
|
|
207
246
|
const WriteErrorBase = Data.TaggedError("WriteError");
|
|
208
247
|
/**
|
|
@@ -219,7 +258,7 @@ var WriteError = class extends WriteErrorBase {};
|
|
|
219
258
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
220
259
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
221
260
|
*
|
|
222
|
-
* @
|
|
261
|
+
* @public
|
|
223
262
|
*/
|
|
224
263
|
const CleanErrorBase = Data.TaggedError("CleanError");
|
|
225
264
|
/**
|
|
@@ -236,7 +275,7 @@ var CleanError = class extends CleanErrorBase {};
|
|
|
236
275
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
237
276
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
238
277
|
*
|
|
239
|
-
* @
|
|
278
|
+
* @public
|
|
240
279
|
*/
|
|
241
280
|
const BuildFailedBase = Data.TaggedError("BuildFailed");
|
|
242
281
|
/**
|
|
@@ -253,7 +292,7 @@ var BuildFailed = class extends BuildFailedBase {};
|
|
|
253
292
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
254
293
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
255
294
|
*
|
|
256
|
-
* @
|
|
295
|
+
* @public
|
|
257
296
|
*/
|
|
258
297
|
const PersistLocalErrorBase = Data.TaggedError("PersistLocalError");
|
|
259
298
|
/**
|
|
@@ -270,7 +309,7 @@ var PersistLocalError = class extends PersistLocalErrorBase {};
|
|
|
270
309
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
271
310
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
272
311
|
*
|
|
273
|
-
* @
|
|
312
|
+
* @public
|
|
274
313
|
*/
|
|
275
314
|
const ActionYmlPathErrorBase = Data.TaggedError("ActionYmlPathError");
|
|
276
315
|
/**
|
|
@@ -281,4 +320,4 @@ const ActionYmlPathErrorBase = Data.TaggedError("ActionYmlPathError");
|
|
|
281
320
|
var ActionYmlPathError = class extends ActionYmlPathErrorBase {};
|
|
282
321
|
|
|
283
322
|
//#endregion
|
|
284
|
-
export { ActionYmlMissing, ActionYmlMissingBase, ActionYmlPathError, ActionYmlPathErrorBase, ActionYmlSchemaError, ActionYmlSchemaErrorBase, ActionYmlSyntaxError, ActionYmlSyntaxErrorBase, BuildFailed, BuildFailedBase, BundleFailed, BundleFailedBase, CleanError, CleanErrorBase, ConfigInvalid, ConfigInvalidBase, ConfigLoadFailed, ConfigLoadFailedBase, ConfigNotFound, ConfigNotFoundBase, EntryFileMissing, EntryFileMissingBase, MainEntryMissing, MainEntryMissingBase, PersistLocalError, PersistLocalErrorBase, ValidationFailed, ValidationFailedBase, WriteError, WriteErrorBase };
|
|
323
|
+
export { ActionYmlMissing, ActionYmlMissingBase, ActionYmlPathError, ActionYmlPathErrorBase, ActionYmlSchemaError, ActionYmlSchemaErrorBase, ActionYmlSyntaxError, ActionYmlSyntaxErrorBase, BuildFailed, BuildFailedBase, BundleFailed, BundleFailedBase, CleanError, CleanErrorBase, ConfigInvalid, ConfigInvalidBase, ConfigLoadFailed, ConfigLoadFailedBase, ConfigNotFound, ConfigNotFoundBase, EntryFileMissing, EntryFileMissingBase, MainEntryMissing, MainEntryMissingBase, PersistLocalError, PersistLocalErrorBase, ValidationFailed, ValidationFailedBase, WorkerEntryInvalidName, WorkerEntryInvalidNameBase, WorkerEntryMissing, WorkerEntryMissingBase, WriteError, WriteErrorBase };
|
package/github-action.js
CHANGED
|
@@ -15,7 +15,7 @@ import { Effect, ManagedRuntime, Schema } from "effect";
|
|
|
15
15
|
* Check the `success` property first, then examine `error`, `validation`, or `build`
|
|
16
16
|
* for details.
|
|
17
17
|
*
|
|
18
|
-
* @
|
|
18
|
+
* @public
|
|
19
19
|
*/
|
|
20
20
|
const GitHubActionBuildResultSchema = Schema.Struct({
|
|
21
21
|
/** Whether the build completed successfully. */
|
|
@@ -39,9 +39,9 @@ const GitHubActionBuildResultSchema = Schema.Struct({
|
|
|
39
39
|
* It handles configuration loading, validation, and bundling in a single workflow.
|
|
40
40
|
*
|
|
41
41
|
* For Effect consumers, use the services directly:
|
|
42
|
-
* - {@link ConfigService} for configuration
|
|
43
|
-
* - {@link ValidationService} for validation
|
|
44
|
-
* - {@link BuildService} for building
|
|
42
|
+
* - {@link (ConfigService:interface)} for configuration
|
|
43
|
+
* - {@link (ValidationService:interface)} for validation
|
|
44
|
+
* - {@link (BuildService:interface)} for building
|
|
45
45
|
*
|
|
46
46
|
* @example Complete build workflow
|
|
47
47
|
* ```typescript
|
package/index.d.ts
CHANGED
|
@@ -5,19 +5,23 @@ import { Context, Effect, Layer, Schema } from "effect";
|
|
|
5
5
|
* Schema for entry point paths.
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
|
-
* GitHub Actions support three entry points:
|
|
8
|
+
* GitHub Actions support three lifecycle entry points:
|
|
9
9
|
* - `main`: The primary action entry point (required)
|
|
10
10
|
* - `pre`: Runs before the main action (optional)
|
|
11
11
|
* - `post`: Runs after the main action for cleanup (optional)
|
|
12
12
|
*
|
|
13
|
-
*
|
|
13
|
+
* Additional non-lifecycle bundles can be declared via `workers` (name → source path),
|
|
14
|
+
* each emitted as `dist/<name>.js`.
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
14
17
|
*/
|
|
15
18
|
declare const EntriesSchema: Schema.Struct<{
|
|
16
19
|
/** Path to the main action entry point. Defaults to "src/main.ts". */main: Schema.optionalWith<typeof Schema.String, {
|
|
17
20
|
default: () => string;
|
|
18
21
|
}>; /** Path to the pre-action hook entry point. */
|
|
19
22
|
pre: Schema.optional<typeof Schema.String>; /** Path to the post-action hook entry point. */
|
|
20
|
-
post: Schema.optional<typeof Schema.String>;
|
|
23
|
+
post: Schema.optional<typeof Schema.String>; /** Extra non-lifecycle worker bundles (name -> source path), each emitted as dist/<name>.js. */
|
|
24
|
+
workers: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
|
|
21
25
|
}>;
|
|
22
26
|
/**
|
|
23
27
|
* Entry point paths configuration.
|
|
@@ -32,7 +36,7 @@ type Entries = typeof EntriesSchema.Type;
|
|
|
32
36
|
* Build options control how the TypeScript source is bundled using rsbuild.
|
|
33
37
|
* The bundler creates a single JavaScript file with all dependencies inlined.
|
|
34
38
|
*
|
|
35
|
-
* @
|
|
39
|
+
* @public
|
|
36
40
|
*/
|
|
37
41
|
declare const BuildOptionsSchema: Schema.Struct<{
|
|
38
42
|
/** Enable minification to reduce bundle size. Defaults to true. */minify: Schema.optionalWith<typeof Schema.Boolean, {
|
|
@@ -61,7 +65,7 @@ type BuildOptions = typeof BuildOptionsSchema.Type;
|
|
|
61
65
|
* Validation options control how strictly the build process validates
|
|
62
66
|
* the project structure and configuration before building.
|
|
63
67
|
*
|
|
64
|
-
* @
|
|
68
|
+
* @public
|
|
65
69
|
*/
|
|
66
70
|
declare const ValidationOptionsSchema: Schema.Struct<{
|
|
67
71
|
/** Require action.yml to exist and be valid. Defaults to true. */requireActionYml: Schema.optionalWith<typeof Schema.Boolean, {
|
|
@@ -83,7 +87,7 @@ type ValidationOptions = typeof ValidationOptionsSchema.Type;
|
|
|
83
87
|
* Controls automatic copying of build output to a local action directory
|
|
84
88
|
* for testing with nektos/act.
|
|
85
89
|
*
|
|
86
|
-
* @
|
|
90
|
+
* @public
|
|
87
91
|
*/
|
|
88
92
|
declare const PersistLocalOptionsSchema: Schema.Struct<{
|
|
89
93
|
/** Enable persisting build output locally. Defaults to true. */enabled: Schema.optionalWith<typeof Schema.Boolean, {
|
|
@@ -109,13 +113,14 @@ type PersistLocalOptions = typeof PersistLocalOptionsSchema.Type;
|
|
|
109
113
|
* This schema is used for parsing user-provided configuration.
|
|
110
114
|
* All sections are optional; defaults are applied via {@link defineConfig}.
|
|
111
115
|
*
|
|
112
|
-
* @
|
|
116
|
+
* @public
|
|
113
117
|
*/
|
|
114
118
|
declare const ConfigInputSchema: Schema.Struct<{
|
|
115
119
|
entries: Schema.optional<Schema.Struct<{
|
|
116
120
|
main: Schema.optional<typeof Schema.String>;
|
|
117
121
|
pre: Schema.optional<typeof Schema.String>;
|
|
118
122
|
post: Schema.optional<typeof Schema.String>;
|
|
123
|
+
workers: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
|
|
119
124
|
}>>;
|
|
120
125
|
build: Schema.optional<Schema.Struct<{
|
|
121
126
|
minify: Schema.optional<typeof Schema.Boolean>;
|
|
@@ -147,7 +152,7 @@ type ConfigInput = typeof ConfigInputSchema.Type;
|
|
|
147
152
|
/**
|
|
148
153
|
* Fully resolved configuration with all defaults applied.
|
|
149
154
|
*
|
|
150
|
-
* @
|
|
155
|
+
* @public
|
|
151
156
|
*/
|
|
152
157
|
declare const ConfigSchema: Schema.Struct<{
|
|
153
158
|
entries: Schema.Struct<{
|
|
@@ -155,7 +160,8 @@ declare const ConfigSchema: Schema.Struct<{
|
|
|
155
160
|
default: () => string;
|
|
156
161
|
}>; /** Path to the pre-action hook entry point. */
|
|
157
162
|
pre: Schema.optional<typeof Schema.String>; /** Path to the post-action hook entry point. */
|
|
158
|
-
post: Schema.optional<typeof Schema.String>;
|
|
163
|
+
post: Schema.optional<typeof Schema.String>; /** Extra non-lifecycle worker bundles (name -> source path), each emitted as dist/<name>.js. */
|
|
164
|
+
workers: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
|
|
159
165
|
}>;
|
|
160
166
|
build: Schema.Struct<{
|
|
161
167
|
/** Enable minification to reduce bundle size. Defaults to true. */minify: Schema.optionalWith<typeof Schema.Boolean, {
|
|
@@ -263,7 +269,7 @@ declare function defineConfig(config?: Partial<ConfigInput>): Config;
|
|
|
263
269
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
264
270
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
265
271
|
*
|
|
266
|
-
* @
|
|
272
|
+
* @public
|
|
267
273
|
*/
|
|
268
274
|
declare const ConfigNotFoundBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
269
275
|
readonly _tag: "ConfigNotFound";
|
|
@@ -291,7 +297,7 @@ declare class ConfigNotFound extends ConfigNotFoundBase<{
|
|
|
291
297
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
292
298
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
293
299
|
*
|
|
294
|
-
* @
|
|
300
|
+
* @public
|
|
295
301
|
*/
|
|
296
302
|
declare const ConfigInvalidBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
297
303
|
readonly _tag: "ConfigInvalid";
|
|
@@ -319,7 +325,7 @@ declare class ConfigInvalid extends ConfigInvalidBase<{
|
|
|
319
325
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
320
326
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
321
327
|
*
|
|
322
|
-
* @
|
|
328
|
+
* @public
|
|
323
329
|
*/
|
|
324
330
|
declare const ConfigLoadFailedBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
325
331
|
readonly _tag: "ConfigLoadFailed";
|
|
@@ -353,7 +359,7 @@ type ConfigError = ConfigNotFound | ConfigInvalid | ConfigLoadFailed;
|
|
|
353
359
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
354
360
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
355
361
|
*
|
|
356
|
-
* @
|
|
362
|
+
* @public
|
|
357
363
|
*/
|
|
358
364
|
declare const MainEntryMissingBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
359
365
|
readonly _tag: "MainEntryMissing";
|
|
@@ -373,6 +379,56 @@ declare class MainEntryMissing extends MainEntryMissingBase<{
|
|
|
373
379
|
*/
|
|
374
380
|
readonly cwd: string;
|
|
375
381
|
}> {}
|
|
382
|
+
/**
|
|
383
|
+
* Base class for WorkerEntryMissing error.
|
|
384
|
+
*
|
|
385
|
+
* @privateRemarks
|
|
386
|
+
* This export is required for api-extractor documentation generation.
|
|
387
|
+
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
388
|
+
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
389
|
+
*
|
|
390
|
+
* @public
|
|
391
|
+
*/
|
|
392
|
+
declare const WorkerEntryMissingBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
393
|
+
readonly _tag: "WorkerEntryMissing";
|
|
394
|
+
} & Readonly<A>;
|
|
395
|
+
/**
|
|
396
|
+
* Error when a worker entry source file is not found.
|
|
397
|
+
*
|
|
398
|
+
* @public
|
|
399
|
+
*/
|
|
400
|
+
declare class WorkerEntryMissing extends WorkerEntryMissingBase<{
|
|
401
|
+
/** The worker name (config key). */readonly workerName: string; /** The expected path for the worker entry. */
|
|
402
|
+
readonly expectedPath: string; /** The working directory that was searched. */
|
|
403
|
+
readonly cwd: string;
|
|
404
|
+
}> {}
|
|
405
|
+
/**
|
|
406
|
+
* Base class for WorkerEntryInvalidName error.
|
|
407
|
+
*
|
|
408
|
+
* @privateRemarks
|
|
409
|
+
* This export is required for api-extractor documentation generation.
|
|
410
|
+
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
411
|
+
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
412
|
+
*
|
|
413
|
+
* @public
|
|
414
|
+
*/
|
|
415
|
+
declare const WorkerEntryInvalidNameBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
416
|
+
readonly _tag: "WorkerEntryInvalidName";
|
|
417
|
+
} & Readonly<A>;
|
|
418
|
+
/**
|
|
419
|
+
* Error when a worker entry name is reserved or path-unsafe.
|
|
420
|
+
*
|
|
421
|
+
* @remarks
|
|
422
|
+
* A worker name becomes both an rsbuild entry key and the emitted filename
|
|
423
|
+
* (`dist/<name>.js`), so it must not collide with a lifecycle bundle
|
|
424
|
+
* (`main`/`pre`/`post`) or contain path separators that would escape `dist/`.
|
|
425
|
+
*
|
|
426
|
+
* @public
|
|
427
|
+
*/
|
|
428
|
+
declare class WorkerEntryInvalidName extends WorkerEntryInvalidNameBase<{
|
|
429
|
+
/** The offending worker name (config key). */readonly workerName: string; /** Why the name was rejected. */
|
|
430
|
+
readonly reason: string;
|
|
431
|
+
}> {}
|
|
376
432
|
/**
|
|
377
433
|
* Base class for EntryFileMissing error.
|
|
378
434
|
*
|
|
@@ -381,7 +437,7 @@ declare class MainEntryMissing extends MainEntryMissingBase<{
|
|
|
381
437
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
382
438
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
383
439
|
*
|
|
384
|
-
* @
|
|
440
|
+
* @public
|
|
385
441
|
*/
|
|
386
442
|
declare const EntryFileMissingBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
387
443
|
readonly _tag: "EntryFileMissing";
|
|
@@ -409,7 +465,7 @@ declare class EntryFileMissing extends EntryFileMissingBase<{
|
|
|
409
465
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
410
466
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
411
467
|
*
|
|
412
|
-
* @
|
|
468
|
+
* @public
|
|
413
469
|
*/
|
|
414
470
|
declare const ActionYmlMissingBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
415
471
|
readonly _tag: "ActionYmlMissing";
|
|
@@ -433,7 +489,7 @@ declare class ActionYmlMissing extends ActionYmlMissingBase<{
|
|
|
433
489
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
434
490
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
435
491
|
*
|
|
436
|
-
* @
|
|
492
|
+
* @public
|
|
437
493
|
*/
|
|
438
494
|
declare const ActionYmlSyntaxErrorBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
439
495
|
readonly _tag: "ActionYmlSyntaxError";
|
|
@@ -469,7 +525,7 @@ declare class ActionYmlSyntaxError extends ActionYmlSyntaxErrorBase<{
|
|
|
469
525
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
470
526
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
471
527
|
*
|
|
472
|
-
* @
|
|
528
|
+
* @public
|
|
473
529
|
*/
|
|
474
530
|
declare const ActionYmlSchemaErrorBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
475
531
|
readonly _tag: "ActionYmlSchemaError";
|
|
@@ -500,7 +556,7 @@ declare class ActionYmlSchemaError extends ActionYmlSchemaErrorBase<{
|
|
|
500
556
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
501
557
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
502
558
|
*
|
|
503
|
-
* @
|
|
559
|
+
* @public
|
|
504
560
|
*/
|
|
505
561
|
declare const ValidationFailedBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
506
562
|
readonly _tag: "ValidationFailed";
|
|
@@ -529,7 +585,7 @@ declare class ValidationFailed extends ValidationFailedBase<{
|
|
|
529
585
|
*
|
|
530
586
|
* @public
|
|
531
587
|
*/
|
|
532
|
-
type ValidationError = MainEntryMissing | EntryFileMissing | ActionYmlMissing | ActionYmlSyntaxError | ActionYmlSchemaError | ValidationFailed;
|
|
588
|
+
type ValidationError = MainEntryMissing | WorkerEntryMissing | WorkerEntryInvalidName | EntryFileMissing | ActionYmlMissing | ActionYmlSyntaxError | ActionYmlSchemaError | ValidationFailed;
|
|
533
589
|
/**
|
|
534
590
|
* Base class for BundleFailed error.
|
|
535
591
|
*
|
|
@@ -538,7 +594,7 @@ type ValidationError = MainEntryMissing | EntryFileMissing | ActionYmlMissing |
|
|
|
538
594
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
539
595
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
540
596
|
*
|
|
541
|
-
* @
|
|
597
|
+
* @public
|
|
542
598
|
*/
|
|
543
599
|
declare const BundleFailedBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
544
600
|
readonly _tag: "BundleFailed";
|
|
@@ -566,7 +622,7 @@ declare class BundleFailed extends BundleFailedBase<{
|
|
|
566
622
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
567
623
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
568
624
|
*
|
|
569
|
-
* @
|
|
625
|
+
* @public
|
|
570
626
|
*/
|
|
571
627
|
declare const WriteErrorBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
572
628
|
readonly _tag: "WriteError";
|
|
@@ -594,7 +650,7 @@ declare class WriteError extends WriteErrorBase<{
|
|
|
594
650
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
595
651
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
596
652
|
*
|
|
597
|
-
* @
|
|
653
|
+
* @public
|
|
598
654
|
*/
|
|
599
655
|
declare const CleanErrorBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
600
656
|
readonly _tag: "CleanError";
|
|
@@ -622,7 +678,7 @@ declare class CleanError extends CleanErrorBase<{
|
|
|
622
678
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
623
679
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
624
680
|
*
|
|
625
|
-
* @
|
|
681
|
+
* @public
|
|
626
682
|
*/
|
|
627
683
|
declare const BuildFailedBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
628
684
|
readonly _tag: "BuildFailed";
|
|
@@ -656,7 +712,7 @@ type BuildError = BundleFailed | WriteError | CleanError | BuildFailed;
|
|
|
656
712
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
657
713
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
658
714
|
*
|
|
659
|
-
* @
|
|
715
|
+
* @public
|
|
660
716
|
*/
|
|
661
717
|
declare const PersistLocalErrorBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
662
718
|
readonly _tag: "PersistLocalError";
|
|
@@ -684,7 +740,7 @@ declare class PersistLocalError extends PersistLocalErrorBase<{
|
|
|
684
740
|
* Effect's Data.TaggedError creates an anonymous base class that must be
|
|
685
741
|
* explicitly exported to avoid "forgotten export" warnings. Do not delete.
|
|
686
742
|
*
|
|
687
|
-
* @
|
|
743
|
+
* @public
|
|
688
744
|
*/
|
|
689
745
|
declare const ActionYmlPathErrorBase: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
|
|
690
746
|
readonly _tag: "ActionYmlPathError";
|
|
@@ -724,7 +780,7 @@ type AppError = ConfigError | ValidationError | BuildError | PersistError;
|
|
|
724
780
|
//#region src/services/config.d.ts
|
|
725
781
|
/**
|
|
726
782
|
* Options for loading configuration.
|
|
727
|
-
* @
|
|
783
|
+
* @public
|
|
728
784
|
*/
|
|
729
785
|
declare const LoadConfigOptionsSchema: Schema.Struct<{
|
|
730
786
|
/** Working directory to search for config. Accepts string, Buffer, or URL. */cwd: Schema.optional<Schema.transform<Schema.Union<[typeof Schema.String, Schema.instanceOf<Buffer<ArrayBufferLike>>, Schema.instanceOf<URL>]>, typeof Schema.String>>; /** Explicit path to config file. Accepts string, Buffer, or URL. */
|
|
@@ -737,10 +793,10 @@ declare const LoadConfigOptionsSchema: Schema.Struct<{
|
|
|
737
793
|
type LoadConfigOptions = typeof LoadConfigOptionsSchema.Type;
|
|
738
794
|
/**
|
|
739
795
|
* Detected entry point information.
|
|
740
|
-
* @
|
|
796
|
+
* @public
|
|
741
797
|
*/
|
|
742
798
|
declare const DetectedEntrySchema: Schema.Struct<{
|
|
743
|
-
/** Entry type
|
|
799
|
+
/** Entry type: "main"|"pre"|"post" for lifecycle entries, or the worker name. */type: typeof Schema.String; /** Absolute path to the entry file. */
|
|
744
800
|
path: typeof Schema.String; /** Output path for the bundled file. */
|
|
745
801
|
output: typeof Schema.String;
|
|
746
802
|
}>;
|
|
@@ -751,12 +807,12 @@ declare const DetectedEntrySchema: Schema.Struct<{
|
|
|
751
807
|
type DetectedEntry = typeof DetectedEntrySchema.Type;
|
|
752
808
|
/**
|
|
753
809
|
* Result of entry detection.
|
|
754
|
-
* @
|
|
810
|
+
* @public
|
|
755
811
|
*/
|
|
756
812
|
declare const DetectEntriesResultSchema: Schema.Struct<{
|
|
757
813
|
/** Whether detection was successful. */success: typeof Schema.Boolean; /** Detected entries. */
|
|
758
814
|
entries: Schema.Array$<Schema.Struct<{
|
|
759
|
-
/** Entry type
|
|
815
|
+
/** Entry type: "main"|"pre"|"post" for lifecycle entries, or the worker name. */type: typeof Schema.String; /** Absolute path to the entry file. */
|
|
760
816
|
path: typeof Schema.String; /** Output path for the bundled file. */
|
|
761
817
|
output: typeof Schema.String;
|
|
762
818
|
}>>;
|
|
@@ -829,7 +885,8 @@ interface ConfigService {
|
|
|
829
885
|
main?: string;
|
|
830
886
|
pre?: string;
|
|
831
887
|
post?: string;
|
|
832
|
-
|
|
888
|
+
workers?: Record<string, string>;
|
|
889
|
+
}) => Effect.Effect<DetectEntriesResult, MainEntryMissing | WorkerEntryMissing | WorkerEntryInvalidName>;
|
|
833
890
|
}
|
|
834
891
|
/**
|
|
835
892
|
* ConfigService tag for dependency injection.
|
|
@@ -841,7 +898,7 @@ declare const ConfigService: Context.Tag<ConfigService, ConfigService>;
|
|
|
841
898
|
//#region src/services/build.d.ts
|
|
842
899
|
/**
|
|
843
900
|
* Options for the build process.
|
|
844
|
-
* @
|
|
901
|
+
* @public
|
|
845
902
|
*/
|
|
846
903
|
declare const BuildRunnerOptionsSchema: Schema.Struct<{
|
|
847
904
|
/** Working directory for the build. Accepts string, Buffer, or URL. */cwd: Schema.optional<Schema.transform<Schema.Union<[typeof Schema.String, Schema.instanceOf<Buffer<ArrayBufferLike>>, Schema.instanceOf<URL>]>, typeof Schema.String>>; /** Clean output directory before building. Defaults to true. */
|
|
@@ -854,7 +911,7 @@ declare const BuildRunnerOptionsSchema: Schema.Struct<{
|
|
|
854
911
|
type BuildRunnerOptions = typeof BuildRunnerOptionsSchema.Type;
|
|
855
912
|
/**
|
|
856
913
|
* Statistics for a single bundled entry.
|
|
857
|
-
* @
|
|
914
|
+
* @public
|
|
858
915
|
*/
|
|
859
916
|
declare const BundleStatsSchema: Schema.Struct<{
|
|
860
917
|
/** Entry type (main, pre, or post). */entry: typeof Schema.String; /** Bundle size in bytes. */
|
|
@@ -869,7 +926,7 @@ declare const BundleStatsSchema: Schema.Struct<{
|
|
|
869
926
|
type BundleStats = typeof BundleStatsSchema.Type;
|
|
870
927
|
/**
|
|
871
928
|
* Result of bundling a single entry.
|
|
872
|
-
* @
|
|
929
|
+
* @public
|
|
873
930
|
*/
|
|
874
931
|
declare const BundleResultSchema: Schema.Struct<{
|
|
875
932
|
/** Whether bundling succeeded. */success: typeof Schema.Boolean; /** Bundle statistics if successful. */
|
|
@@ -888,7 +945,7 @@ declare const BundleResultSchema: Schema.Struct<{
|
|
|
888
945
|
type BundleResult = typeof BundleResultSchema.Type;
|
|
889
946
|
/**
|
|
890
947
|
* Result of the complete build process.
|
|
891
|
-
* @
|
|
948
|
+
* @public
|
|
892
949
|
*/
|
|
893
950
|
declare const BuildResultSchema: Schema.Struct<{
|
|
894
951
|
/** Whether the overall build succeeded. */success: typeof Schema.Boolean; /** Results for each entry that was built. */
|
|
@@ -950,7 +1007,7 @@ interface BuildService {
|
|
|
950
1007
|
* @param options - Build options
|
|
951
1008
|
* @returns Effect that resolves to build result
|
|
952
1009
|
*/
|
|
953
|
-
readonly build: (config: Config, options?: BuildRunnerOptions) => Effect.Effect<BuildResult, BuildError | MainEntryMissing>;
|
|
1010
|
+
readonly build: (config: Config, options?: BuildRunnerOptions) => Effect.Effect<BuildResult, BuildError | MainEntryMissing | WorkerEntryMissing | WorkerEntryInvalidName>;
|
|
954
1011
|
/**
|
|
955
1012
|
* Bundle a single entry point.
|
|
956
1013
|
*
|
|
@@ -991,7 +1048,7 @@ declare const BuildService: Context.Tag<BuildService, BuildService>;
|
|
|
991
1048
|
//#region src/services/persist-local.d.ts
|
|
992
1049
|
/**
|
|
993
1050
|
* Options for the persist operation.
|
|
994
|
-
* @
|
|
1051
|
+
* @public
|
|
995
1052
|
*/
|
|
996
1053
|
declare const PersistLocalRunnerOptionsSchema: Schema.Struct<{
|
|
997
1054
|
/** Working directory. Accepts string. */cwd: Schema.optional<typeof Schema.String>;
|
|
@@ -1003,7 +1060,7 @@ declare const PersistLocalRunnerOptionsSchema: Schema.Struct<{
|
|
|
1003
1060
|
type PersistLocalRunnerOptions = typeof PersistLocalRunnerOptionsSchema.Type;
|
|
1004
1061
|
/**
|
|
1005
1062
|
* Result of the persist-local operation.
|
|
1006
|
-
* @
|
|
1063
|
+
* @public
|
|
1007
1064
|
*/
|
|
1008
1065
|
declare const PersistLocalResultSchema: Schema.Struct<{
|
|
1009
1066
|
/** Whether the operation completed successfully. */success: typeof Schema.Boolean; /** Number of files copied (changed or new). */
|
|
@@ -1058,7 +1115,7 @@ declare const PersistLocalService: Context.Tag<PersistLocalService, PersistLocal
|
|
|
1058
1115
|
//#region src/services/validation.d.ts
|
|
1059
1116
|
/**
|
|
1060
1117
|
* Options for validation.
|
|
1061
|
-
* @
|
|
1118
|
+
* @public
|
|
1062
1119
|
*/
|
|
1063
1120
|
declare const ValidateOptionsSchema: Schema.Struct<{
|
|
1064
1121
|
/** Working directory for file operations. Accepts string, Buffer, or URL. */cwd: Schema.optional<Schema.transform<Schema.Union<[typeof Schema.String, Schema.instanceOf<Buffer<ArrayBufferLike>>, Schema.instanceOf<URL>]>, typeof Schema.String>>; /** Force strict mode regardless of environment. Auto-detects from CI when undefined. */
|
|
@@ -1071,7 +1128,7 @@ declare const ValidateOptionsSchema: Schema.Struct<{
|
|
|
1071
1128
|
type ValidateOptions = typeof ValidateOptionsSchema.Type;
|
|
1072
1129
|
/**
|
|
1073
1130
|
* A validation error item.
|
|
1074
|
-
* @
|
|
1131
|
+
* @public
|
|
1075
1132
|
*/
|
|
1076
1133
|
declare const ValidationErrorSchema: Schema.Struct<{
|
|
1077
1134
|
/** Error code for categorization. */code: typeof Schema.String; /** Human-readable error message. */
|
|
@@ -1086,7 +1143,7 @@ declare const ValidationErrorSchema: Schema.Struct<{
|
|
|
1086
1143
|
type ValidationErrorItem = typeof ValidationErrorSchema.Type;
|
|
1087
1144
|
/**
|
|
1088
1145
|
* A validation warning.
|
|
1089
|
-
* @
|
|
1146
|
+
* @public
|
|
1090
1147
|
*/
|
|
1091
1148
|
declare const ValidationWarningSchema: Schema.Struct<{
|
|
1092
1149
|
/** Warning code for categorization. */code: typeof Schema.String; /** Human-readable warning message. */
|
|
@@ -1101,7 +1158,7 @@ declare const ValidationWarningSchema: Schema.Struct<{
|
|
|
1101
1158
|
type ValidationWarning = typeof ValidationWarningSchema.Type;
|
|
1102
1159
|
/**
|
|
1103
1160
|
* Validation result with errors and warnings.
|
|
1104
|
-
* @
|
|
1161
|
+
* @public
|
|
1105
1162
|
*/
|
|
1106
1163
|
declare const ValidationResultSchema: Schema.Struct<{
|
|
1107
1164
|
/** Whether validation passed (no errors, or only warnings in non-strict mode). */valid: typeof Schema.Boolean; /** Validation errors. */
|
|
@@ -1125,7 +1182,7 @@ declare const ValidationResultSchema: Schema.Struct<{
|
|
|
1125
1182
|
type ValidationResult = typeof ValidationResultSchema.Type;
|
|
1126
1183
|
/**
|
|
1127
1184
|
* Result of action.yml validation.
|
|
1128
|
-
* @
|
|
1185
|
+
* @public
|
|
1129
1186
|
*/
|
|
1130
1187
|
declare const ActionYmlResultSchema: Schema.Struct<{
|
|
1131
1188
|
/** Whether the action.yml is valid. */valid: typeof Schema.Boolean; /** Parsed action.yml content if valid. */
|
|
@@ -1281,7 +1338,7 @@ interface GitHubActionOptions {
|
|
|
1281
1338
|
* Check the `success` property first, then examine `error`, `validation`, or `build`
|
|
1282
1339
|
* for details.
|
|
1283
1340
|
*
|
|
1284
|
-
* @
|
|
1341
|
+
* @public
|
|
1285
1342
|
*/
|
|
1286
1343
|
declare const GitHubActionBuildResultSchema: Schema.Struct<{
|
|
1287
1344
|
/** Whether the build completed successfully. */success: typeof Schema.Boolean; /** Build result details if the build step ran. */
|
|
@@ -1339,9 +1396,9 @@ type GitHubActionBuildResult = typeof GitHubActionBuildResultSchema.Type;
|
|
|
1339
1396
|
* It handles configuration loading, validation, and bundling in a single workflow.
|
|
1340
1397
|
*
|
|
1341
1398
|
* For Effect consumers, use the services directly:
|
|
1342
|
-
* - {@link ConfigService} for configuration
|
|
1343
|
-
* - {@link ValidationService} for validation
|
|
1344
|
-
* - {@link BuildService} for building
|
|
1399
|
+
* - {@link (ConfigService:interface)} for configuration
|
|
1400
|
+
* - {@link (ValidationService:interface)} for validation
|
|
1401
|
+
* - {@link (BuildService:interface)} for building
|
|
1345
1402
|
*
|
|
1346
1403
|
* @example Complete build workflow
|
|
1347
1404
|
* ```typescript
|
|
@@ -1563,5 +1620,5 @@ declare const PersistLocalLayer: Layer.Layer<PersistLocalService, never, never>;
|
|
|
1563
1620
|
*/
|
|
1564
1621
|
declare const AppLayer: Layer.Layer<ConfigService | ValidationService | BuildService | PersistLocalService, never, never>;
|
|
1565
1622
|
//#endregion
|
|
1566
|
-
export { ActionYmlMissing, ActionYmlMissingBase, ActionYmlPathError, ActionYmlPathErrorBase, type ActionYmlResult, ActionYmlResultSchema, ActionYmlSchemaError, ActionYmlSchemaErrorBase, ActionYmlSyntaxError, ActionYmlSyntaxErrorBase, type AppError, AppLayer, type BuildError, BuildFailed, BuildFailedBase, BuildLayer, type BuildOptions, BuildOptionsSchema, type BuildResult, BuildResultSchema, type BuildRunnerOptions, BuildRunnerOptionsSchema, BuildService, BundleFailed, BundleFailedBase, type BundleResult, BundleResultSchema, type BundleStats, BundleStatsSchema, CleanError, CleanErrorBase, type Config, type ConfigError, type ConfigInput, ConfigInputSchema, ConfigInvalid, ConfigInvalidBase, ConfigLayer, ConfigLoadFailed, ConfigLoadFailedBase, ConfigNotFound, ConfigNotFoundBase, ConfigSchema, ConfigService, type DetectEntriesResult, DetectEntriesResultSchema, type DetectedEntry, DetectedEntrySchema, type Entries, EntriesSchema, EntryFileMissing, EntryFileMissingBase, GitHubAction, type GitHubActionBuildResult, GitHubActionBuildResultSchema, type GitHubActionOptions, type LoadConfigOptions, LoadConfigOptionsSchema, type LoadConfigResult, MainEntryMissing, MainEntryMissingBase, type PersistError, PersistLocalError, PersistLocalErrorBase, PersistLocalLayer, type PersistLocalOptions, PersistLocalOptionsSchema, type PersistLocalResult, PersistLocalResultSchema, type PersistLocalRunnerOptions, PersistLocalRunnerOptionsSchema, PersistLocalService, type ValidateOptions, ValidateOptionsSchema, type ValidationError, type ValidationErrorItem, ValidationErrorSchema, ValidationFailed, ValidationFailedBase, ValidationLayer, type ValidationOptions, ValidationOptionsSchema, type ValidationResult, ValidationResultSchema, ValidationService, type ValidationWarning, ValidationWarningSchema, WriteError, WriteErrorBase, defineConfig };
|
|
1623
|
+
export { ActionYmlMissing, ActionYmlMissingBase, ActionYmlPathError, ActionYmlPathErrorBase, type ActionYmlResult, ActionYmlResultSchema, ActionYmlSchemaError, ActionYmlSchemaErrorBase, ActionYmlSyntaxError, ActionYmlSyntaxErrorBase, type AppError, AppLayer, type BuildError, BuildFailed, BuildFailedBase, BuildLayer, type BuildOptions, BuildOptionsSchema, type BuildResult, BuildResultSchema, type BuildRunnerOptions, BuildRunnerOptionsSchema, BuildService, BundleFailed, BundleFailedBase, type BundleResult, BundleResultSchema, type BundleStats, BundleStatsSchema, CleanError, CleanErrorBase, type Config, type ConfigError, type ConfigInput, ConfigInputSchema, ConfigInvalid, ConfigInvalidBase, ConfigLayer, ConfigLoadFailed, ConfigLoadFailedBase, ConfigNotFound, ConfigNotFoundBase, ConfigSchema, ConfigService, type DetectEntriesResult, DetectEntriesResultSchema, type DetectedEntry, DetectedEntrySchema, type Entries, EntriesSchema, EntryFileMissing, EntryFileMissingBase, GitHubAction, type GitHubActionBuildResult, GitHubActionBuildResultSchema, type GitHubActionOptions, type LoadConfigOptions, LoadConfigOptionsSchema, type LoadConfigResult, MainEntryMissing, MainEntryMissingBase, type PersistError, PersistLocalError, PersistLocalErrorBase, PersistLocalLayer, type PersistLocalOptions, PersistLocalOptionsSchema, type PersistLocalResult, PersistLocalResultSchema, type PersistLocalRunnerOptions, PersistLocalRunnerOptionsSchema, PersistLocalService, type ValidateOptions, ValidateOptionsSchema, type ValidationError, type ValidationErrorItem, ValidationErrorSchema, ValidationFailed, ValidationFailedBase, ValidationLayer, type ValidationOptions, ValidationOptionsSchema, type ValidationResult, ValidationResultSchema, ValidationService, type ValidationWarning, ValidationWarningSchema, WorkerEntryInvalidName, WorkerEntryInvalidNameBase, WorkerEntryMissing, WorkerEntryMissingBase, WriteError, WriteErrorBase, defineConfig };
|
|
1567
1624
|
//# sourceMappingURL=index.d.ts.map
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionYmlMissing, ActionYmlMissingBase, ActionYmlPathError, ActionYmlPathErrorBase, ActionYmlSchemaError, ActionYmlSchemaErrorBase, ActionYmlSyntaxError, ActionYmlSyntaxErrorBase, BuildFailed, BuildFailedBase, BundleFailed, BundleFailedBase, CleanError, CleanErrorBase, ConfigInvalid, ConfigInvalidBase, ConfigLoadFailed, ConfigLoadFailedBase, ConfigNotFound, ConfigNotFoundBase, EntryFileMissing, EntryFileMissingBase, MainEntryMissing, MainEntryMissingBase, PersistLocalError, PersistLocalErrorBase, ValidationFailed, ValidationFailedBase, WriteError, WriteErrorBase } from "./errors.js";
|
|
1
|
+
import { ActionYmlMissing, ActionYmlMissingBase, ActionYmlPathError, ActionYmlPathErrorBase, ActionYmlSchemaError, ActionYmlSchemaErrorBase, ActionYmlSyntaxError, ActionYmlSyntaxErrorBase, BuildFailed, BuildFailedBase, BundleFailed, BundleFailedBase, CleanError, CleanErrorBase, ConfigInvalid, ConfigInvalidBase, ConfigLoadFailed, ConfigLoadFailedBase, ConfigNotFound, ConfigNotFoundBase, EntryFileMissing, EntryFileMissingBase, MainEntryMissing, MainEntryMissingBase, PersistLocalError, PersistLocalErrorBase, ValidationFailed, ValidationFailedBase, WorkerEntryInvalidName, WorkerEntryInvalidNameBase, WorkerEntryMissing, WorkerEntryMissingBase, WriteError, WriteErrorBase } from "./errors.js";
|
|
2
2
|
import { BuildResultSchema, BuildRunnerOptionsSchema, BuildService, BundleResultSchema, BundleStatsSchema } from "./services/build.js";
|
|
3
3
|
import { BuildOptionsSchema, ConfigInputSchema, ConfigSchema, EntriesSchema, PersistLocalOptionsSchema, ValidationOptionsSchema, defineConfig } from "./schemas/config.js";
|
|
4
4
|
import { ConfigService, DetectEntriesResultSchema, DetectedEntrySchema, LoadConfigOptionsSchema } from "./services/config.js";
|
|
@@ -7,4 +7,4 @@ import { ActionYmlResultSchema, ValidateOptionsSchema, ValidationErrorSchema, Va
|
|
|
7
7
|
import { AppLayer, BuildLayer, ConfigLayer, PersistLocalLayer, ValidationLayer } from "./layers/app.js";
|
|
8
8
|
import { GitHubAction, GitHubActionBuildResultSchema } from "./github-action.js";
|
|
9
9
|
|
|
10
|
-
export { ActionYmlMissing, ActionYmlMissingBase, ActionYmlPathError, ActionYmlPathErrorBase, ActionYmlResultSchema, ActionYmlSchemaError, ActionYmlSchemaErrorBase, ActionYmlSyntaxError, ActionYmlSyntaxErrorBase, AppLayer, BuildFailed, BuildFailedBase, BuildLayer, BuildOptionsSchema, BuildResultSchema, BuildRunnerOptionsSchema, BuildService, BundleFailed, BundleFailedBase, BundleResultSchema, BundleStatsSchema, CleanError, CleanErrorBase, ConfigInputSchema, ConfigInvalid, ConfigInvalidBase, ConfigLayer, ConfigLoadFailed, ConfigLoadFailedBase, ConfigNotFound, ConfigNotFoundBase, ConfigSchema, ConfigService, DetectEntriesResultSchema, DetectedEntrySchema, EntriesSchema, EntryFileMissing, EntryFileMissingBase, GitHubAction, GitHubActionBuildResultSchema, LoadConfigOptionsSchema, MainEntryMissing, MainEntryMissingBase, PersistLocalError, PersistLocalErrorBase, PersistLocalLayer, PersistLocalOptionsSchema, PersistLocalResultSchema, PersistLocalRunnerOptionsSchema, PersistLocalService, ValidateOptionsSchema, ValidationErrorSchema, ValidationFailed, ValidationFailedBase, ValidationLayer, ValidationOptionsSchema, ValidationResultSchema, ValidationService, ValidationWarningSchema, WriteError, WriteErrorBase, defineConfig };
|
|
10
|
+
export { ActionYmlMissing, ActionYmlMissingBase, ActionYmlPathError, ActionYmlPathErrorBase, ActionYmlResultSchema, ActionYmlSchemaError, ActionYmlSchemaErrorBase, ActionYmlSyntaxError, ActionYmlSyntaxErrorBase, AppLayer, BuildFailed, BuildFailedBase, BuildLayer, BuildOptionsSchema, BuildResultSchema, BuildRunnerOptionsSchema, BuildService, BundleFailed, BundleFailedBase, BundleResultSchema, BundleStatsSchema, CleanError, CleanErrorBase, ConfigInputSchema, ConfigInvalid, ConfigInvalidBase, ConfigLayer, ConfigLoadFailed, ConfigLoadFailedBase, ConfigNotFound, ConfigNotFoundBase, ConfigSchema, ConfigService, DetectEntriesResultSchema, DetectedEntrySchema, EntriesSchema, EntryFileMissing, EntryFileMissingBase, GitHubAction, GitHubActionBuildResultSchema, LoadConfigOptionsSchema, MainEntryMissing, MainEntryMissingBase, PersistLocalError, PersistLocalErrorBase, PersistLocalLayer, PersistLocalOptionsSchema, PersistLocalResultSchema, PersistLocalRunnerOptionsSchema, PersistLocalService, ValidateOptionsSchema, ValidationErrorSchema, ValidationFailed, ValidationFailedBase, ValidationLayer, ValidationOptionsSchema, ValidationResultSchema, ValidationService, ValidationWarningSchema, WorkerEntryInvalidName, WorkerEntryInvalidNameBase, WorkerEntryMissing, WorkerEntryMissingBase, WriteError, WriteErrorBase, defineConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvy-web/github-action-builder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A zero-config build tool for creating GitHub Actions from TypeScript. Bundles with rsbuild, validates action.yml against GitHub's schema, and outputs production-ready Node.js 24 actions.",
|
|
6
6
|
"keywords": [
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@effect/cli": "^0.75.2",
|
|
50
50
|
"@effect/cluster": "^0.59.0",
|
|
51
|
-
"@effect/platform": "^0.96.
|
|
51
|
+
"@effect/platform": "^0.96.2",
|
|
52
52
|
"@effect/platform-node": "^0.107.0",
|
|
53
53
|
"@effect/printer": "^0.49.0",
|
|
54
54
|
"@effect/printer-ansi": "^0.49.0",
|
|
@@ -56,14 +56,14 @@
|
|
|
56
56
|
"@effect/sql": "^0.51.1",
|
|
57
57
|
"@effect/typeclass": "^0.40.0",
|
|
58
58
|
"@rsbuild/core": "^2.0.15",
|
|
59
|
-
"effect": "^3.21.
|
|
59
|
+
"effect": "^3.21.4",
|
|
60
60
|
"jiti": "^2.7.0",
|
|
61
61
|
"picocolors": "^1.1.1",
|
|
62
62
|
"yaml-effect": "^0.6.0"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@types/node": "^
|
|
66
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
65
|
+
"@types/node": "^26.0.0",
|
|
66
|
+
"@typescript/native-preview": "^7.0.0-dev.20260612.1",
|
|
67
67
|
"typescript": "^6.0.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependenciesMeta": {
|
package/schemas/config.js
CHANGED
|
@@ -14,12 +14,15 @@ import { Schema } from "effect";
|
|
|
14
14
|
* Schema for entry point paths.
|
|
15
15
|
*
|
|
16
16
|
* @remarks
|
|
17
|
-
* GitHub Actions support three entry points:
|
|
17
|
+
* GitHub Actions support three lifecycle entry points:
|
|
18
18
|
* - `main`: The primary action entry point (required)
|
|
19
19
|
* - `pre`: Runs before the main action (optional)
|
|
20
20
|
* - `post`: Runs after the main action for cleanup (optional)
|
|
21
21
|
*
|
|
22
|
-
*
|
|
22
|
+
* Additional non-lifecycle bundles can be declared via `workers` (name → source path),
|
|
23
|
+
* each emitted as `dist/<name>.js`.
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
23
26
|
*/
|
|
24
27
|
const EntriesSchema = Schema.Struct({
|
|
25
28
|
/** Path to the main action entry point. Defaults to "src/main.ts". */
|
|
@@ -27,7 +30,12 @@ const EntriesSchema = Schema.Struct({
|
|
|
27
30
|
/** Path to the pre-action hook entry point. */
|
|
28
31
|
pre: Schema.optional(Schema.String),
|
|
29
32
|
/** Path to the post-action hook entry point. */
|
|
30
|
-
post: Schema.optional(Schema.String)
|
|
33
|
+
post: Schema.optional(Schema.String),
|
|
34
|
+
/** Extra non-lifecycle worker bundles (name -> source path), each emitted as dist/<name>.js. */
|
|
35
|
+
workers: Schema.optional(Schema.Record({
|
|
36
|
+
key: Schema.String,
|
|
37
|
+
value: Schema.String
|
|
38
|
+
}))
|
|
31
39
|
});
|
|
32
40
|
/**
|
|
33
41
|
* Schema for build options.
|
|
@@ -36,7 +44,7 @@ const EntriesSchema = Schema.Struct({
|
|
|
36
44
|
* Build options control how the TypeScript source is bundled using rsbuild.
|
|
37
45
|
* The bundler creates a single JavaScript file with all dependencies inlined.
|
|
38
46
|
*
|
|
39
|
-
* @
|
|
47
|
+
* @public
|
|
40
48
|
*/
|
|
41
49
|
const BuildOptionsSchema = Schema.Struct({
|
|
42
50
|
/** Enable minification to reduce bundle size. Defaults to true. */
|
|
@@ -55,7 +63,7 @@ const BuildOptionsSchema = Schema.Struct({
|
|
|
55
63
|
* Validation options control how strictly the build process validates
|
|
56
64
|
* the project structure and configuration before building.
|
|
57
65
|
*
|
|
58
|
-
* @
|
|
66
|
+
* @public
|
|
59
67
|
*/
|
|
60
68
|
const ValidationOptionsSchema = Schema.Struct({
|
|
61
69
|
/** Require action.yml to exist and be valid. Defaults to true. */
|
|
@@ -72,7 +80,7 @@ const ValidationOptionsSchema = Schema.Struct({
|
|
|
72
80
|
* Controls automatic copying of build output to a local action directory
|
|
73
81
|
* for testing with nektos/act.
|
|
74
82
|
*
|
|
75
|
-
* @
|
|
83
|
+
* @public
|
|
76
84
|
*/
|
|
77
85
|
const PersistLocalOptionsSchema = Schema.Struct({
|
|
78
86
|
/** Enable persisting build output locally. Defaults to true. */
|
|
@@ -89,13 +97,17 @@ const PersistLocalOptionsSchema = Schema.Struct({
|
|
|
89
97
|
* This schema is used for parsing user-provided configuration.
|
|
90
98
|
* All sections are optional; defaults are applied via {@link defineConfig}.
|
|
91
99
|
*
|
|
92
|
-
* @
|
|
100
|
+
* @public
|
|
93
101
|
*/
|
|
94
102
|
const ConfigInputSchema = Schema.Struct({
|
|
95
103
|
entries: Schema.optional(Schema.Struct({
|
|
96
104
|
main: Schema.optional(Schema.String),
|
|
97
105
|
pre: Schema.optional(Schema.String),
|
|
98
|
-
post: Schema.optional(Schema.String)
|
|
106
|
+
post: Schema.optional(Schema.String),
|
|
107
|
+
workers: Schema.optional(Schema.Record({
|
|
108
|
+
key: Schema.String,
|
|
109
|
+
value: Schema.String
|
|
110
|
+
}))
|
|
99
111
|
})),
|
|
100
112
|
build: Schema.optional(Schema.Struct({
|
|
101
113
|
minify: Schema.optional(Schema.Boolean),
|
|
@@ -117,7 +129,7 @@ const ConfigInputSchema = Schema.Struct({
|
|
|
117
129
|
/**
|
|
118
130
|
* Fully resolved configuration with all defaults applied.
|
|
119
131
|
*
|
|
120
|
-
* @
|
|
132
|
+
* @public
|
|
121
133
|
*/
|
|
122
134
|
const ConfigSchema = Schema.Struct({
|
|
123
135
|
entries: EntriesSchema,
|
package/services/build-live.js
CHANGED
|
@@ -183,6 +183,7 @@ const BuildServiceLive = Layer.effect(BuildService, Effect.gen(function* () {
|
|
|
183
183
|
const entriesConfig = { main: config.entries.main };
|
|
184
184
|
if (config.entries.pre) entriesConfig.pre = config.entries.pre;
|
|
185
185
|
if (config.entries.post) entriesConfig.post = config.entries.post;
|
|
186
|
+
if (config.entries.workers) entriesConfig.workers = config.entries.workers;
|
|
186
187
|
const entriesResult = yield* configService.detectEntries(cwd, entriesConfig);
|
|
187
188
|
if (shouldClean) yield* cleanDirectory(resolve(cwd, "dist"));
|
|
188
189
|
const entryResults = [];
|
package/services/build.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Context, Schema } from "effect";
|
|
|
4
4
|
//#region src/services/build.ts
|
|
5
5
|
/**
|
|
6
6
|
* Options for the build process.
|
|
7
|
-
* @
|
|
7
|
+
* @public
|
|
8
8
|
*/
|
|
9
9
|
const BuildRunnerOptionsSchema = Schema.Struct({
|
|
10
10
|
/** Working directory for the build. Accepts string, Buffer, or URL. */
|
|
@@ -14,7 +14,7 @@ const BuildRunnerOptionsSchema = Schema.Struct({
|
|
|
14
14
|
});
|
|
15
15
|
/**
|
|
16
16
|
* Statistics for a single bundled entry.
|
|
17
|
-
* @
|
|
17
|
+
* @public
|
|
18
18
|
*/
|
|
19
19
|
const BundleStatsSchema = Schema.Struct({
|
|
20
20
|
/** Entry type (main, pre, or post). */
|
|
@@ -28,7 +28,7 @@ const BundleStatsSchema = Schema.Struct({
|
|
|
28
28
|
});
|
|
29
29
|
/**
|
|
30
30
|
* Result of bundling a single entry.
|
|
31
|
-
* @
|
|
31
|
+
* @public
|
|
32
32
|
*/
|
|
33
33
|
const BundleResultSchema = Schema.Struct({
|
|
34
34
|
/** Whether bundling succeeded. */
|
|
@@ -40,7 +40,7 @@ const BundleResultSchema = Schema.Struct({
|
|
|
40
40
|
});
|
|
41
41
|
/**
|
|
42
42
|
* Result of the complete build process.
|
|
43
|
-
* @
|
|
43
|
+
* @public
|
|
44
44
|
*/
|
|
45
45
|
const BuildResultSchema = Schema.Struct({
|
|
46
46
|
/** Whether the overall build succeeded. */
|
package/services/config-live.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigInvalid, ConfigLoadFailed, ConfigNotFound, MainEntryMissing } from "../errors.js";
|
|
1
|
+
import { ConfigInvalid, ConfigLoadFailed, ConfigNotFound, MainEntryMissing, WorkerEntryInvalidName, WorkerEntryMissing } from "../errors.js";
|
|
2
2
|
import { defineConfig } from "../schemas/config.js";
|
|
3
3
|
import { ConfigService } from "./config.js";
|
|
4
4
|
import { Effect, Layer } from "effect";
|
|
@@ -21,6 +21,12 @@ const DEFAULT_ENTRIES = {
|
|
|
21
21
|
pre: "src/pre.ts",
|
|
22
22
|
post: "src/post.ts"
|
|
23
23
|
};
|
|
24
|
+
/** Lifecycle bundle names a worker entry must not reuse — they own `dist/main.js` etc. */
|
|
25
|
+
const RESERVED_ENTRY_NAMES = /* @__PURE__ */ new Set([
|
|
26
|
+
"main",
|
|
27
|
+
"pre",
|
|
28
|
+
"post"
|
|
29
|
+
]);
|
|
24
30
|
/**
|
|
25
31
|
* Find config file in the given directory.
|
|
26
32
|
*/
|
|
@@ -100,6 +106,27 @@ const ConfigServiceLive = Layer.succeed(ConfigService, {
|
|
|
100
106
|
if (preEntry) detected.push(preEntry);
|
|
101
107
|
const postEntry = detectOptionalEntry(cwd, "post", entries?.post);
|
|
102
108
|
if (postEntry) detected.push(postEntry);
|
|
109
|
+
for (const [name, workerPath] of Object.entries(entries?.workers ?? {})) {
|
|
110
|
+
if (RESERVED_ENTRY_NAMES.has(name)) return yield* Effect.fail(new WorkerEntryInvalidName({
|
|
111
|
+
workerName: name,
|
|
112
|
+
reason: `"${name}" is a reserved lifecycle bundle name (main/pre/post)`
|
|
113
|
+
}));
|
|
114
|
+
if (name.length === 0 || name.includes("/") || name.includes("\\") || name.includes("..")) return yield* Effect.fail(new WorkerEntryInvalidName({
|
|
115
|
+
workerName: name,
|
|
116
|
+
reason: "worker names must be non-empty and free of path separators"
|
|
117
|
+
}));
|
|
118
|
+
const absoluteWorkerPath = resolve(cwd, workerPath);
|
|
119
|
+
if (!existsSync(absoluteWorkerPath)) return yield* Effect.fail(new WorkerEntryMissing({
|
|
120
|
+
workerName: name,
|
|
121
|
+
expectedPath: workerPath,
|
|
122
|
+
cwd
|
|
123
|
+
}));
|
|
124
|
+
detected.push({
|
|
125
|
+
type: name,
|
|
126
|
+
path: absoluteWorkerPath,
|
|
127
|
+
output: `dist/${name}.js`
|
|
128
|
+
});
|
|
129
|
+
}
|
|
103
130
|
return {
|
|
104
131
|
success: true,
|
|
105
132
|
entries: detected
|
package/services/config.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Context, Schema } from "effect";
|
|
|
5
5
|
//#region src/services/config.ts
|
|
6
6
|
/**
|
|
7
7
|
* Options for loading configuration.
|
|
8
|
-
* @
|
|
8
|
+
* @public
|
|
9
9
|
*/
|
|
10
10
|
const LoadConfigOptionsSchema = Schema.Struct({
|
|
11
11
|
/** Working directory to search for config. Accepts string, Buffer, or URL. */
|
|
@@ -20,11 +20,11 @@ const LoadConfigOptionsSchema = Schema.Struct({
|
|
|
20
20
|
const EntryTypeSchema = Schema.Literal("main", "pre", "post");
|
|
21
21
|
/**
|
|
22
22
|
* Detected entry point information.
|
|
23
|
-
* @
|
|
23
|
+
* @public
|
|
24
24
|
*/
|
|
25
25
|
const DetectedEntrySchema = Schema.Struct({
|
|
26
|
-
/** Entry type
|
|
27
|
-
type:
|
|
26
|
+
/** Entry type: "main"|"pre"|"post" for lifecycle entries, or the worker name. */
|
|
27
|
+
type: Schema.String,
|
|
28
28
|
/** Absolute path to the entry file. */
|
|
29
29
|
path: Schema.String,
|
|
30
30
|
/** Output path for the bundled file. */
|
|
@@ -32,7 +32,7 @@ const DetectedEntrySchema = Schema.Struct({
|
|
|
32
32
|
});
|
|
33
33
|
/**
|
|
34
34
|
* Result of entry detection.
|
|
35
|
-
* @
|
|
35
|
+
* @public
|
|
36
36
|
*/
|
|
37
37
|
const DetectEntriesResultSchema = Schema.Struct({
|
|
38
38
|
/** Whether detection was successful. */
|
|
@@ -3,14 +3,14 @@ import { Context, Schema } from "effect";
|
|
|
3
3
|
//#region src/services/persist-local.ts
|
|
4
4
|
/**
|
|
5
5
|
* Options for the persist operation.
|
|
6
|
-
* @
|
|
6
|
+
* @public
|
|
7
7
|
*/
|
|
8
8
|
const PersistLocalRunnerOptionsSchema = Schema.Struct({
|
|
9
9
|
/** Working directory. Accepts string. */
|
|
10
10
|
cwd: Schema.optional(Schema.String) });
|
|
11
11
|
/**
|
|
12
12
|
* Result of the persist-local operation.
|
|
13
|
-
* @
|
|
13
|
+
* @public
|
|
14
14
|
*/
|
|
15
15
|
const PersistLocalResultSchema = Schema.Struct({
|
|
16
16
|
/** Whether the operation completed successfully. */
|
package/services/validation.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Context, Schema } from "effect";
|
|
|
4
4
|
//#region src/services/validation.ts
|
|
5
5
|
/**
|
|
6
6
|
* Options for validation.
|
|
7
|
-
* @
|
|
7
|
+
* @public
|
|
8
8
|
*/
|
|
9
9
|
const ValidateOptionsSchema = Schema.Struct({
|
|
10
10
|
/** Working directory for file operations. Accepts string, Buffer, or URL. */
|
|
@@ -14,7 +14,7 @@ const ValidateOptionsSchema = Schema.Struct({
|
|
|
14
14
|
});
|
|
15
15
|
/**
|
|
16
16
|
* A validation error item.
|
|
17
|
-
* @
|
|
17
|
+
* @public
|
|
18
18
|
*/
|
|
19
19
|
const ValidationErrorSchema = Schema.Struct({
|
|
20
20
|
/** Error code for categorization. */
|
|
@@ -28,7 +28,7 @@ const ValidationErrorSchema = Schema.Struct({
|
|
|
28
28
|
});
|
|
29
29
|
/**
|
|
30
30
|
* A validation warning.
|
|
31
|
-
* @
|
|
31
|
+
* @public
|
|
32
32
|
*/
|
|
33
33
|
const ValidationWarningSchema = Schema.Struct({
|
|
34
34
|
/** Warning code for categorization. */
|
|
@@ -42,7 +42,7 @@ const ValidationWarningSchema = Schema.Struct({
|
|
|
42
42
|
});
|
|
43
43
|
/**
|
|
44
44
|
* Validation result with errors and warnings.
|
|
45
|
-
* @
|
|
45
|
+
* @public
|
|
46
46
|
*/
|
|
47
47
|
const ValidationResultSchema = Schema.Struct({
|
|
48
48
|
/** Whether validation passed (no errors, or only warnings in non-strict mode). */
|
|
@@ -54,7 +54,7 @@ const ValidationResultSchema = Schema.Struct({
|
|
|
54
54
|
});
|
|
55
55
|
/**
|
|
56
56
|
* Result of action.yml validation.
|
|
57
|
-
* @
|
|
57
|
+
* @public
|
|
58
58
|
*/
|
|
59
59
|
const ActionYmlResultSchema = Schema.Struct({
|
|
60
60
|
/** Whether the action.yml is valid. */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|