@pbuilder/sdk 0.13.0 → 0.15.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/README.md +57 -42
- package/dist/{transport → acl/irwire}/frame-reader.d.ts +2 -0
- package/dist/{transport → acl/irwire}/frame-reader.js +57 -5
- package/dist/{transport → acl/irwire}/stdio-engine-client.d.ts +2 -2
- package/dist/{transport → acl/irwire}/stdio-engine-client.js +4 -4
- package/dist/bin/pbuilder-codegen.js +30 -35
- package/dist/bin/pbuilder-runner.js +6 -6
- package/dist/bounded-contexts/authoring/application/usecases/authoring-verbs/index.d.ts +106 -0
- package/dist/bounded-contexts/authoring/application/usecases/authoring-verbs/index.js +202 -0
- package/dist/{pending-directives → bounded-contexts/authoring/application/usecases/pending-directives}/render.d.ts +2 -2
- package/dist/{core → bounded-contexts/authoring/application/usecases/run-factory}/context.d.ts +12 -9
- package/dist/{core → bounded-contexts/authoring/application/usecases/run-factory}/context.js +59 -120
- package/dist/bounded-contexts/authoring/application/usecases/run-factory/driving.d.ts +5 -0
- package/dist/bounded-contexts/authoring/application/usecases/run-factory/driving.js +15 -0
- package/dist/bounded-contexts/authoring/application/usecases/scaffold/classify-transport.d.ts +51 -0
- package/dist/bounded-contexts/authoring/application/usecases/scaffold/classify-transport.js +105 -0
- package/dist/{scaffold → bounded-contexts/authoring/application/usecases/scaffold}/expander.d.ts +2 -1
- package/dist/{scaffold → bounded-contexts/authoring/application/usecases/scaffold}/expander.js +16 -7
- package/dist/{scaffold → bounded-contexts/authoring/application/usecases/scaffold}/index.d.ts +1 -1
- package/dist/{scaffold → bounded-contexts/authoring/application/usecases/scaffold}/index.js +7 -6
- package/dist/{scaffold → bounded-contexts/authoring/application/usecases/scaffold}/path-guards.d.ts +11 -10
- package/dist/{scaffold → bounded-contexts/authoring/application/usecases/scaffold}/path-guards.js +21 -48
- package/dist/{scaffold → bounded-contexts/authoring/application/usecases/scaffold}/walk.d.ts +2 -3
- package/dist/{scaffold → bounded-contexts/authoring/application/usecases/scaffold}/walk.js +37 -56
- package/dist/{core → bounded-contexts/authoring/domain/aggregates/session}/session.d.ts +2 -2
- package/dist/{core → bounded-contexts/authoring/domain/aggregates/session}/session.js +1 -1
- package/dist/{core → bounded-contexts/authoring/domain/entities}/dialect-handle.d.ts +1 -1
- package/dist/{core → bounded-contexts/authoring/domain/entities}/dialect-handle.js +10 -10
- package/dist/{core → bounded-contexts/authoring/domain/ports}/engine-client.d.ts +1 -1
- package/dist/bounded-contexts/authoring/domain/ports/package-files.d.ts +53 -0
- package/dist/bounded-contexts/authoring/domain/ports/package-files.js +11 -0
- package/dist/{core → bounded-contexts/authoring/domain/services}/define-dialect.d.ts +2 -2
- package/dist/{core → bounded-contexts/authoring/domain/services}/define-dialect.js +3 -3
- package/dist/{core → bounded-contexts/authoring/domain/services}/directive-factory.d.ts +2 -2
- package/dist/{core → bounded-contexts/authoring/domain/services}/directive-factory.js +37 -12
- package/dist/{scaffold → bounded-contexts/authoring/domain/services}/filename-pipeline.d.ts +11 -1
- package/dist/{scaffold → bounded-contexts/authoring/domain/services}/filename-pipeline.js +94 -3
- package/dist/{core/jsx-name-validator.d.ts → bounded-contexts/authoring/domain/services/identifier-names.d.ts} +8 -4
- package/dist/{core/jsx-name-validator.js → bounded-contexts/authoring/domain/services/identifier-names.js} +21 -28
- package/dist/bounded-contexts/authoring/domain/services/reject-tail.d.ts +9 -0
- package/dist/bounded-contexts/authoring/domain/services/reject-tail.js +30 -0
- package/dist/bounded-contexts/authoring/domain/services/run-context.d.ts +5 -0
- package/dist/bounded-contexts/authoring/domain/services/run-context.js +70 -0
- package/dist/{core → bounded-contexts/authoring/domain/services}/schema/input-rejection.d.ts +1 -1
- package/dist/{core → bounded-contexts/authoring/domain/services}/schema/input-rejection.js +1 -1
- package/dist/bounded-contexts/authoring/domain/services/schema/schema-files.d.ts +2 -0
- package/dist/bounded-contexts/authoring/domain/services/schema/schema-files.js +6 -0
- package/dist/{core → bounded-contexts/authoring/domain/services}/schema/schema-locate.d.ts +2 -1
- package/dist/{core → bounded-contexts/authoring/domain/services}/schema/schema-locate.js +13 -2
- package/dist/{core → bounded-contexts/authoring/domain/services}/schema/schema-parse.d.ts +1 -1
- package/dist/{core → bounded-contexts/authoring/domain/services}/schema/schema-parse.js +2 -14
- package/dist/{core → bounded-contexts/authoring/domain/services}/schema/schema-sufficiency.d.ts +4 -3
- package/dist/{core → bounded-contexts/authoring/domain/services}/schema/schema-sufficiency.js +8 -4
- package/dist/{core → bounded-contexts/authoring/domain/services}/schema/schema-validate.d.ts +1 -1
- package/dist/{core → bounded-contexts/authoring/domain/services}/schema/schema-validate.js +1 -1
- package/dist/{core → bounded-contexts/authoring/domain/valueobjects}/authoring-error.js +1 -1
- package/dist/{core → bounded-contexts/authoring/domain/valueobjects}/wire.d.ts +0 -3
- package/dist/bounded-contexts/authoring/domain/valueobjects/wire.js +28 -0
- package/dist/bounded-contexts/authoring/infrastructure/in/codegen/cli.d.ts +27 -0
- package/dist/bounded-contexts/authoring/infrastructure/in/codegen/cli.js +306 -0
- package/dist/bounded-contexts/authoring/infrastructure/in/codegen/emit-type.d.ts +7 -0
- package/dist/bounded-contexts/authoring/infrastructure/in/codegen/emit-type.js +68 -0
- package/dist/bounded-contexts/authoring/infrastructure/in/codegen/project-codegen.d.ts +19 -0
- package/dist/bounded-contexts/authoring/infrastructure/in/codegen/project-codegen.js +131 -0
- package/dist/bounded-contexts/authoring/infrastructure/in/commons/index.d.ts +182 -0
- package/dist/bounded-contexts/authoring/infrastructure/in/commons/index.js +94 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/angular/index.d.ts +63 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/angular/index.js +68 -0
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/angular/ops.js +9 -9
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/css/index.d.ts +40 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/css/index.js +38 -0
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/css/ops.js +2 -2
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/json/index.d.ts +55 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/json/index.js +54 -0
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/json/ops.d.ts +1 -1
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/json/ops.js +35 -8
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/nestjs/index.d.ts +43 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/nestjs/index.js +46 -0
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/nestjs/ops.js +7 -7
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/react/index.d.ts +52 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/react/index.js +73 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/react/jsx-names.d.ts +4 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/react/jsx-names.js +18 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/react/match-tails.d.ts +4 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/react/match-tails.js +25 -0
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/react/ops.js +5 -3
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/typescript/array-element.d.ts +7 -2
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/typescript/array-element.js +29 -15
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/typescript/ast.d.ts +5 -1
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/typescript/ast.js +22 -4
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/typescript/class-property.js +14 -19
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/typescript/index.d.ts +53 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/typescript/index.js +37 -0
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/typescript/ops.d.ts +6 -1
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/typescript/ops.js +90 -54
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/yaml/index.d.ts +69 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/yaml/index.js +70 -0
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/yaml/paths.d.ts +1 -1
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/yaml/paths.js +2 -2
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/yaml/presentation.js +1 -1
- package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/yaml/structural.js +2 -2
- package/dist/bounded-contexts/authoring/infrastructure/out/fs/package-files.d.ts +8 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/fs/package-files.js +133 -0
- package/dist/bounded-contexts/authoring/testing/conformance/index.d.ts +157 -0
- package/dist/bounded-contexts/authoring/testing/conformance/index.js +261 -0
- package/dist/{testing → bounded-contexts/authoring/testing}/contract-fake.d.ts +2 -2
- package/dist/{testing → bounded-contexts/authoring/testing}/contract-fake.js +4 -3
- package/dist/bounded-contexts/authoring/testing/harness/index.d.ts +89 -0
- package/dist/bounded-contexts/authoring/testing/harness/index.js +85 -0
- package/dist/{conformance → bounded-contexts/authoring/testing}/run-vehicle.d.ts +1 -1
- package/dist/{transport → bounded-contexts/runner-hosting/infrastructure/in}/bootstrap-bridge.js +2 -2
- package/dist/{transport → bounded-contexts/runner-hosting/infrastructure/in}/exit-codes.js +5 -4
- package/dist/{transport → bounded-contexts/runner-hosting/infrastructure/in}/factory-pointer.js +1 -1
- package/dist/{transport → bounded-contexts/runner-hosting/infrastructure/in}/runner.d.ts +4 -0
- package/dist/{transport → bounded-contexts/runner-hosting/infrastructure/in}/runner.js +49 -23
- package/dist/{transport → bounded-contexts/runner-hosting/infrastructure/in}/single-instance-probe.js +1 -1
- package/dist/commons/index.d.ts +1 -278
- package/dist/commons/index.js +1 -286
- package/dist/conformance/index.d.ts +1 -157
- package/dist/conformance/index.js +1 -261
- package/dist/dialects/angular/index.d.ts +1 -63
- package/dist/dialects/angular/index.js +1 -68
- package/dist/dialects/css/index.d.ts +1 -40
- package/dist/dialects/css/index.js +1 -38
- package/dist/dialects/json/index.d.ts +1 -55
- package/dist/dialects/json/index.js +1 -54
- package/dist/dialects/nestjs/index.d.ts +1 -43
- package/dist/dialects/nestjs/index.js +1 -46
- package/dist/dialects/react/index.d.ts +1 -52
- package/dist/dialects/react/index.js +1 -73
- package/dist/dialects/typescript/index.d.ts +1 -53
- package/dist/dialects/typescript/index.js +1 -37
- package/dist/dialects/yaml/index.d.ts +1 -69
- package/dist/dialects/yaml/index.js +1 -70
- package/dist/{core → platform}/deep-equal.js +2 -2
- package/dist/{transport → platform}/error-text.js +2 -2
- package/dist/runner-manifest.json +66 -46
- package/dist/shared-kernel/batch-cap.d.ts +4 -0
- package/dist/{core/wire.js → shared-kernel/batch-cap.js} +9 -26
- package/dist/{transport → shared-kernel}/framing.js +2 -2
- package/dist/{transport → shared-kernel}/wire-protocol.js +1 -1
- package/dist/testing/index.d.ts +1 -84
- package/dist/testing/index.js +1 -82
- package/package.json +9 -3
- package/dist/core/index.d.ts +0 -10
- package/dist/core/index.js +0 -6
- package/dist/core/reject-tail.d.ts +0 -13
- package/dist/core/reject-tail.js +0 -52
- package/dist/core/schema/schema-discovery.d.ts +0 -13
- package/dist/core/schema/schema-discovery.js +0 -51
- package/dist/scaffold/classify-transport.d.ts +0 -54
- package/dist/scaffold/classify-transport.js +0 -119
- /package/dist/{pending-directives → bounded-contexts/authoring/application/usecases/pending-directives}/index.d.ts +0 -0
- /package/dist/{pending-directives → bounded-contexts/authoring/application/usecases/pending-directives}/index.js +0 -0
- /package/dist/{pending-directives → bounded-contexts/authoring/application/usecases/pending-directives}/render.js +0 -0
- /package/dist/{core → bounded-contexts/authoring/domain/entities}/base-handle.d.ts +0 -0
- /package/dist/{core → bounded-contexts/authoring/domain/entities}/base-handle.js +0 -0
- /package/dist/{core → bounded-contexts/authoring/domain/entities}/handle-state.d.ts +0 -0
- /package/dist/{core → bounded-contexts/authoring/domain/entities}/handle-state.js +0 -0
- /package/dist/{core → bounded-contexts/authoring/domain/ports}/emit-rejection.d.ts +0 -0
- /package/dist/{core → bounded-contexts/authoring/domain/ports}/emit-rejection.js +0 -0
- /package/dist/{core → bounded-contexts/authoring/domain/ports}/engine-client.js +0 -0
- /package/dist/{commons → bounded-contexts/authoring/domain/services}/classify-content.d.ts +0 -0
- /package/dist/{commons → bounded-contexts/authoring/domain/services}/classify-content.js +0 -0
- /package/dist/{core → bounded-contexts/authoring/domain/services}/schema/schema-digest.d.ts +0 -0
- /package/dist/{core → bounded-contexts/authoring/domain/services}/schema/schema-digest.js +0 -0
- /package/dist/{core → bounded-contexts/authoring/domain/valueobjects}/authoring-error.d.ts +0 -0
- /package/dist/{core → bounded-contexts/authoring/domain/valueobjects}/dialect-error.d.ts +0 -0
- /package/dist/{core → bounded-contexts/authoring/domain/valueobjects}/dialect-error.js +0 -0
- /package/dist/{core → bounded-contexts/authoring/domain/valueobjects}/json-value.d.ts +0 -0
- /package/dist/{core → bounded-contexts/authoring/domain/valueobjects}/json-value.js +0 -0
- /package/dist/{core/schema → bounded-contexts/authoring/domain/valueobjects}/schema-model.d.ts +0 -0
- /package/dist/{core/schema → bounded-contexts/authoring/domain/valueobjects}/schema-model.js +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/angular/ops.d.ts +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/css/ast.d.ts +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/css/ast.js +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/css/ops.d.ts +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/json/ast.d.ts +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/json/ast.js +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/nestjs/ops.d.ts +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/react/ast.d.ts +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/react/ast.js +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/react/ops.d.ts +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/typescript/class-property.d.ts +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/typescript/import-order.d.ts +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/typescript/import-order.js +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/typescript/pack.d.ts +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/typescript/pack.js +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/yaml/ast.d.ts +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/yaml/ast.js +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/yaml/documents.d.ts +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/yaml/documents.js +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/yaml/presentation.d.ts +0 -0
- /package/dist/{dialects → bounded-contexts/authoring/infrastructure/out/dialects}/yaml/structural.d.ts +0 -0
- /package/dist/{testing → bounded-contexts/authoring/testing}/rejection-messages.d.ts +0 -0
- /package/dist/{testing → bounded-contexts/authoring/testing}/rejection-messages.js +0 -0
- /package/dist/{conformance → bounded-contexts/authoring/testing}/run-vehicle.js +0 -0
- /package/dist/{transport → bounded-contexts/runner-hosting/infrastructure/in}/bootstrap-bridge.d.ts +0 -0
- /package/dist/{transport → bounded-contexts/runner-hosting/infrastructure/in}/exit-codes.d.ts +0 -0
- /package/dist/{transport → bounded-contexts/runner-hosting/infrastructure/in}/factory-pointer.d.ts +0 -0
- /package/dist/{transport → bounded-contexts/runner-hosting/infrastructure/in}/single-instance-probe.d.ts +0 -0
- /package/dist/{core → platform}/deep-equal.d.ts +0 -0
- /package/dist/{transport → platform}/error-text.d.ts +0 -0
- /package/dist/{core → platform}/fs-errors.d.ts +0 -0
- /package/dist/{core → platform}/fs-errors.js +0 -0
- /package/dist/{transport → shared-kernel}/framing.d.ts +0 -0
- /package/dist/{transport → shared-kernel}/wire-protocol.d.ts +0 -0
|
@@ -1,46 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { parse, print } from "../typescript/ast.js";
|
|
3
|
-
import { typescriptOps } from "../typescript/pack.js";
|
|
4
|
-
import { addController, addExport, addModuleImport, addProvider } from "./ops.js";
|
|
5
|
-
export * as astLibrary from "ts-morph";
|
|
6
|
-
const moduleOps = defineOpPack({ addProvider, addController, addModuleImport, addExport });
|
|
7
|
-
const baseDialect = defineDialect({
|
|
8
|
-
extensions: [".ts"],
|
|
9
|
-
ast: { parse, print },
|
|
10
|
-
ops: {},
|
|
11
|
-
});
|
|
12
|
-
const nestjsDialect = withOps(baseDialect, typescriptOps, moduleOps);
|
|
13
|
-
/**
|
|
14
|
-
* Opens a `.ts` file of a NestJS project for editing. The handle carries every
|
|
15
|
-
* `@pbuilder/sdk/typescript` op plus the `@Module` ops below, chained on one handle and
|
|
16
|
-
* written once.
|
|
17
|
-
*
|
|
18
|
-
* `addProvider`, `addController`, `addModuleImport` and `addExport` each take
|
|
19
|
-
* `(name, from)`: they add `import { name } from "from"` with the same rules as `addImport`,
|
|
20
|
-
* then append `name` to the `providers`, `controllers`, `imports` or `exports` array of the
|
|
21
|
-
* file's only `@Module` class, creating the metadata object or the array when missing. They
|
|
22
|
-
* reject, leaving the file unchanged, when the file has no `@Module` class or more than one,
|
|
23
|
-
* or when the metadata or the array is not a literal. Use `.modify(fn)` for those files and
|
|
24
|
-
* for entries that are not a plain class name, such as `ConfigModule.forRoot()`.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* import * as nestjs from "@pbuilder/sdk/nestjs";
|
|
28
|
-
*
|
|
29
|
-
* // src/app.module.ts before:
|
|
30
|
-
* // @Module({ providers: [AppService] })
|
|
31
|
-
* // export class AppModule {}
|
|
32
|
-
* export const run = async () => {
|
|
33
|
-
* await nestjs
|
|
34
|
-
* .find("src/app.module.ts")
|
|
35
|
-
* .addModuleImport("UsersModule", "./users/users.module")
|
|
36
|
-
* .addProvider("UsersService", "./users/users.service");
|
|
37
|
-
* };
|
|
38
|
-
* // -> import { UsersModule } from "./users/users.module";
|
|
39
|
-
* // -> import { UsersService } from "./users/users.service";
|
|
40
|
-
* // ->
|
|
41
|
-
* // -> @Module({ providers: [AppService, UsersService], imports: [UsersModule] })
|
|
42
|
-
* // -> export class AppModule {}
|
|
43
|
-
*/
|
|
44
|
-
export function find(path) {
|
|
45
|
-
return nestjsDialect.find(path);
|
|
46
|
-
}
|
|
1
|
+
export * from "../../bounded-contexts/authoring/infrastructure/out/dialects/nestjs/index.js";
|
|
@@ -1,52 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { type Handle } from "../../core/define-dialect.ts";
|
|
3
|
-
import { typescriptOps } from "../typescript/pack.ts";
|
|
4
|
-
import { type JsxTarget } from "./ops.ts";
|
|
5
|
-
export * as astLibrary from "ts-morph";
|
|
6
|
-
export type { JsxTarget };
|
|
7
|
-
type JsxOps = {
|
|
8
|
-
setJsxProp: (ast: SourceFile, target: JsxTarget, propName: string, value?: string) => void;
|
|
9
|
-
removeJsxProp: (ast: SourceFile, target: JsxTarget, propName: string) => void;
|
|
10
|
-
addJsxChild: (ast: SourceFile, target: JsxTarget, jsx: string) => void;
|
|
11
|
-
wrapJsxElement: (ast: SourceFile, target: JsxTarget, wrapper: string) => void;
|
|
12
|
-
addHookCall: (ast: SourceFile, component: string, statement: string) => void;
|
|
13
|
-
addComponentProp: (ast: SourceFile, component: string, name: string, type: string, options?: {
|
|
14
|
-
optional?: boolean;
|
|
15
|
-
}) => void;
|
|
16
|
-
renameJsxElement: (ast: SourceFile, target: JsxTarget, tag: string) => void;
|
|
17
|
-
};
|
|
18
|
-
type ReactOps = typeof typescriptOps & JsxOps;
|
|
19
|
-
/**
|
|
20
|
-
* Opens a `.tsx` or `.jsx` file for React-dialect-aware editing — the dialect's entry verb into
|
|
21
|
-
* a Session that carries every `@pbuilder/sdk/typescript` op plus the JSX ops, chained on one
|
|
22
|
-
* handle (REQ-DG-01.2). Both extensions get the same handle: on `.jsx`, which parses as plain
|
|
23
|
-
* JavaScript with JSX, `addTypeImport`, `addComponentProp` and `addClassProperty`'s `scope`/
|
|
24
|
-
* `readonly` reject at call time because they write TypeScript syntax, leaving the file
|
|
25
|
-
* unchanged. The gate below runs SYNCHRONOUSLY, before any op is chained and before any run
|
|
26
|
-
* flush, so a rejected path throws on the bare `find()` call itself. `.ts` files are TypeScript,
|
|
27
|
-
* not this dialect — use `@pbuilder/sdk/typescript`. Every other extension, dotfile basename,
|
|
28
|
-
* trailing-dot basename, and extensionless path is rejected the same way —
|
|
29
|
-
* no normalization, always an explicit `.tsx` or `.jsx`, so neither extension is ever assumed.
|
|
30
|
-
* Every gate rejection throws via `dialectError`, so its message carries the standard
|
|
31
|
-
* `dialect operation failed: ` prefix.
|
|
32
|
-
*
|
|
33
|
-
* Trust boundary: a value handed to a structured mutation (e.g. `setJsxProp`'s `value`
|
|
34
|
-
* argument) is emitted verbatim into the output and becomes executable code — the SDK
|
|
35
|
-
* performs no validation, escaping, or sanitisation on it; the author is solely responsible
|
|
36
|
-
* for any untrusted input reaching that channel.
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* import * as react from "@pbuilder/sdk/react";
|
|
40
|
-
*
|
|
41
|
-
* // src/Button.tsx before: const el = <Button />;
|
|
42
|
-
* export const run = async () => {
|
|
43
|
-
* await react
|
|
44
|
-
* .find("src/Button.tsx")
|
|
45
|
-
* .addImport("handleClick", "./handlers")
|
|
46
|
-
* .setJsxProp("Button", "onClick", "{handleClick}");
|
|
47
|
-
* };
|
|
48
|
-
* // -> import { handleClick } from "./handlers";
|
|
49
|
-
* // ->
|
|
50
|
-
* // -> const el = <Button onClick={handleClick} />;
|
|
51
|
-
*/
|
|
52
|
-
export declare function find(path: string): Handle<"found", SourceFile, ReactOps>;
|
|
1
|
+
export * from "../../bounded-contexts/authoring/infrastructure/out/dialects/react/index.ts";
|
|
@@ -1,73 +1 @@
|
|
|
1
|
-
|
|
2
|
-
// Composes the sanctioned kit surface ONLY (`defineDialect`/`defineOpPack`/`withOps` from
|
|
3
|
-
// ../../core/define-dialect.ts) — mirrors src/dialects/typescript/index.ts's shape exactly,
|
|
4
|
-
// no port-internal machinery imported anywhere in this tree (REQ-DG-04.1, fit-08/fit-10).
|
|
5
|
-
// The parser stays local: typescript/ast.ts parses as `.ts`, which rejects JSX syntax.
|
|
6
|
-
import { basename } from "node:path";
|
|
7
|
-
import { byExtension, defineDialect, defineOpPack, overrideOps, withOps, withoutOps } from "../../core/define-dialect.js";
|
|
8
|
-
import { dialectError } from "../../core/dialect-error.js";
|
|
9
|
-
import { addClassProperty } from "../typescript/class-property.js";
|
|
10
|
-
import { typescriptOps } from "../typescript/pack.js";
|
|
11
|
-
import { parse, parseJsx, print } from "./ast.js";
|
|
12
|
-
import { addComponentProp, addHookCall, addJsxChild, removeJsxProp, renameJsxElement, setJsxProp, wrapJsxElement, } from "./ops.js";
|
|
13
|
-
export * as astLibrary from "ts-morph";
|
|
14
|
-
const jsxOps = defineOpPack({ setJsxProp, removeJsxProp, addJsxChild, wrapJsxElement, addHookCall, addComponentProp, renameJsxElement });
|
|
15
|
-
const tsxDialect = withOps(defineDialect({ extensions: [".tsx"], ast: { parse, print }, ops: {} }), typescriptOps, jsxOps);
|
|
16
|
-
const jsxDialect = overrideOps(withoutOps(defineDialect({ extensions: [".jsx"], ast: { parse: parseJsx, print }, ops: tsxDialect.ops }), ["addTypeImport", "addComponentProp"], "they write TypeScript type syntax, which a .jsx file cannot hold"), {
|
|
17
|
-
addClassProperty: (ast, className, name, initializer, options) => {
|
|
18
|
-
if (options?.scope !== undefined || options?.readonly !== undefined) {
|
|
19
|
-
throw dialectError("addClassProperty's `scope` and `readonly` are TypeScript modifiers, which a .jsx file cannot hold — " +
|
|
20
|
-
"omit them, or use .modify() to make this edit directly.");
|
|
21
|
-
}
|
|
22
|
-
addClassProperty(ast, className, name, initializer);
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
const reactDialect = byExtension({ ".tsx": tsxDialect, ".jsx": jsxDialect });
|
|
26
|
-
/**
|
|
27
|
-
* Opens a `.tsx` or `.jsx` file for React-dialect-aware editing — the dialect's entry verb into
|
|
28
|
-
* a Session that carries every `@pbuilder/sdk/typescript` op plus the JSX ops, chained on one
|
|
29
|
-
* handle (REQ-DG-01.2). Both extensions get the same handle: on `.jsx`, which parses as plain
|
|
30
|
-
* JavaScript with JSX, `addTypeImport`, `addComponentProp` and `addClassProperty`'s `scope`/
|
|
31
|
-
* `readonly` reject at call time because they write TypeScript syntax, leaving the file
|
|
32
|
-
* unchanged. The gate below runs SYNCHRONOUSLY, before any op is chained and before any run
|
|
33
|
-
* flush, so a rejected path throws on the bare `find()` call itself. `.ts` files are TypeScript,
|
|
34
|
-
* not this dialect — use `@pbuilder/sdk/typescript`. Every other extension, dotfile basename,
|
|
35
|
-
* trailing-dot basename, and extensionless path is rejected the same way —
|
|
36
|
-
* no normalization, always an explicit `.tsx` or `.jsx`, so neither extension is ever assumed.
|
|
37
|
-
* Every gate rejection throws via `dialectError`, so its message carries the standard
|
|
38
|
-
* `dialect operation failed: ` prefix.
|
|
39
|
-
*
|
|
40
|
-
* Trust boundary: a value handed to a structured mutation (e.g. `setJsxProp`'s `value`
|
|
41
|
-
* argument) is emitted verbatim into the output and becomes executable code — the SDK
|
|
42
|
-
* performs no validation, escaping, or sanitisation on it; the author is solely responsible
|
|
43
|
-
* for any untrusted input reaching that channel.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* import * as react from "@pbuilder/sdk/react";
|
|
47
|
-
*
|
|
48
|
-
* // src/Button.tsx before: const el = <Button />;
|
|
49
|
-
* export const run = async () => {
|
|
50
|
-
* await react
|
|
51
|
-
* .find("src/Button.tsx")
|
|
52
|
-
* .addImport("handleClick", "./handlers")
|
|
53
|
-
* .setJsxProp("Button", "onClick", "{handleClick}");
|
|
54
|
-
* };
|
|
55
|
-
* // -> import { handleClick } from "./handlers";
|
|
56
|
-
* // ->
|
|
57
|
-
* // -> const el = <Button onClick={handleClick} />;
|
|
58
|
-
*/
|
|
59
|
-
export function find(path) {
|
|
60
|
-
const base = basename(path);
|
|
61
|
-
// A non-empty stem that does not end in a dot: `.tsx` and `a..tsx` name no file of that type.
|
|
62
|
-
const routed = reactDialect.extensions.some((extension) => base.endsWith(extension) && base.length > extension.length && !base.endsWith(`.${extension}`));
|
|
63
|
-
if (routed) {
|
|
64
|
-
return reactDialect.find(path);
|
|
65
|
-
}
|
|
66
|
-
if (!base.includes(".")) {
|
|
67
|
-
throw dialectError("find(path) — the React dialect requires an explicit .tsx or .jsx extension; received a path with no extension. Append .tsx or .jsx to the path.");
|
|
68
|
-
}
|
|
69
|
-
if (base.endsWith(".ts")) {
|
|
70
|
-
throw dialectError("find(path) — .ts is not a React file; use @pbuilder/sdk/typescript for TypeScript sources.");
|
|
71
|
-
}
|
|
72
|
-
throw dialectError("find(path) — .tsx and .jsx are the only extensions the React dialect supports.");
|
|
73
|
-
}
|
|
1
|
+
export * from "../../bounded-contexts/authoring/infrastructure/out/dialects/react/index.js";
|
|
@@ -1,53 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { type Handle } from "../../core/define-dialect.ts";
|
|
3
|
-
import type { ArrayElement, ArrayLocator } from "./array-element.ts";
|
|
4
|
-
import type { ClassPropertyOptions } from "./class-property.ts";
|
|
5
|
-
export * as astLibrary from "ts-morph";
|
|
6
|
-
type TypeScriptOps = {
|
|
7
|
-
addImport: (ast: SourceFile, name: string, from: string, options?: {
|
|
8
|
-
position?: "sorted";
|
|
9
|
-
}) => void;
|
|
10
|
-
addDefaultImport: (ast: SourceFile, name: string, from: string) => void;
|
|
11
|
-
addNamespaceImport: (ast: SourceFile, name: string, from: string) => void;
|
|
12
|
-
addTypeImport: (ast: SourceFile, name: string, from: string) => void;
|
|
13
|
-
addSideEffectImport: (ast: SourceFile, from: string) => void;
|
|
14
|
-
addReExport: (ast: SourceFile, name: string, from: string) => void;
|
|
15
|
-
addExportAll: (ast: SourceFile, from: string, options?: {
|
|
16
|
-
as?: string;
|
|
17
|
-
}) => void;
|
|
18
|
-
addFunction: (ast: SourceFile, name: string, source: string, options?: {
|
|
19
|
-
export?: boolean;
|
|
20
|
-
}) => void;
|
|
21
|
-
addVariable: (ast: SourceFile, name: string, initializer: string, options?: {
|
|
22
|
-
export?: boolean;
|
|
23
|
-
kind?: "const" | "let" | "var";
|
|
24
|
-
}) => void;
|
|
25
|
-
addClass: (ast: SourceFile, name: string, source: string, options?: {
|
|
26
|
-
export?: boolean;
|
|
27
|
-
}) => void;
|
|
28
|
-
removeImport: (ast: SourceFile, name: string, from: string) => void;
|
|
29
|
-
removeExport: (ast: SourceFile, name: string, from: string) => void;
|
|
30
|
-
removeExportAll: (ast: SourceFile, from: string, options?: {
|
|
31
|
-
as?: string;
|
|
32
|
-
}) => void;
|
|
33
|
-
addArrayElement: (ast: SourceFile, locator: ArrayLocator, element: ArrayElement) => void;
|
|
34
|
-
addClassProperty: (ast: SourceFile, className: string, name: string, initializer: string, options?: ClassPropertyOptions) => void;
|
|
35
|
-
sortImports: (ast: SourceFile) => void;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Opens a TypeScript file for dialect-aware editing — the dialect's entry verb into a Session
|
|
39
|
-
* (REQ-DG-01.2). Returns an awaitable, chainable `Handle` exposing the universal `.modify()`
|
|
40
|
-
* escape hatch plus the dialect's named ops (`addImport`, `addDefaultImport`,
|
|
41
|
-
* `addNamespaceImport`, `addTypeImport`, `addSideEffectImport`, `addReExport`, `addExportAll`,
|
|
42
|
-
* `addFunction`, `addVariable`, `addClass`, `removeImport`, `removeExport`, `removeExportAll`,
|
|
43
|
-
* `addArrayElement`, `addClassProperty`). Reads route through `Session.read` only (REQ-MC-03); edits
|
|
44
|
-
* coalesce into a single `modify` at flush (REQ-MC-01/02).
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* import * as ts from "@pbuilder/sdk/typescript";
|
|
48
|
-
*
|
|
49
|
-
* export const run = async () => {
|
|
50
|
-
* await ts.find("src/index.ts").addImport("readFileSync", "node:fs");
|
|
51
|
-
* };
|
|
52
|
-
*/
|
|
53
|
-
export declare function find(path: string): Handle<"found", SourceFile, TypeScriptOps>;
|
|
1
|
+
export * from "../../bounded-contexts/authoring/infrastructure/out/dialects/typescript/index.ts";
|
|
@@ -1,37 +1 @@
|
|
|
1
|
-
|
|
2
|
-
// subpath, ADR-0014 amendment). Composes the sanctioned kit surface ONLY
|
|
3
|
-
// (`defineDialect`/`defineOpPack`/`withOps` from `../../core/define-dialect.ts`) — no
|
|
4
|
-
// port-internal machinery is imported anywhere in this tree (REQ-DG-04.1, see
|
|
5
|
-
// test/fitness/fit-08-no-kit-bleed.test.ts and fit-10-engine-client-port-guard.test.ts).
|
|
6
|
-
// Namespace import surface (ADR-0003): `import * as ts from "@pbuilder/sdk/typescript"`,
|
|
7
|
-
// then `ts.find(path)`.
|
|
8
|
-
import { defineDialect, defineOpPack, withOps } from "../../core/define-dialect.js";
|
|
9
|
-
import { parse, print } from "./ast.js";
|
|
10
|
-
import { typescriptOps } from "./pack.js";
|
|
11
|
-
export * as astLibrary from "ts-morph";
|
|
12
|
-
const opsPack = defineOpPack(typescriptOps);
|
|
13
|
-
const baseDialect = defineDialect({
|
|
14
|
-
extensions: [".ts"],
|
|
15
|
-
ast: { parse, print },
|
|
16
|
-
ops: {},
|
|
17
|
-
});
|
|
18
|
-
const typescriptDialect = withOps(baseDialect, opsPack);
|
|
19
|
-
/**
|
|
20
|
-
* Opens a TypeScript file for dialect-aware editing — the dialect's entry verb into a Session
|
|
21
|
-
* (REQ-DG-01.2). Returns an awaitable, chainable `Handle` exposing the universal `.modify()`
|
|
22
|
-
* escape hatch plus the dialect's named ops (`addImport`, `addDefaultImport`,
|
|
23
|
-
* `addNamespaceImport`, `addTypeImport`, `addSideEffectImport`, `addReExport`, `addExportAll`,
|
|
24
|
-
* `addFunction`, `addVariable`, `addClass`, `removeImport`, `removeExport`, `removeExportAll`,
|
|
25
|
-
* `addArrayElement`, `addClassProperty`). Reads route through `Session.read` only (REQ-MC-03); edits
|
|
26
|
-
* coalesce into a single `modify` at flush (REQ-MC-01/02).
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* import * as ts from "@pbuilder/sdk/typescript";
|
|
30
|
-
*
|
|
31
|
-
* export const run = async () => {
|
|
32
|
-
* await ts.find("src/index.ts").addImport("readFileSync", "node:fs");
|
|
33
|
-
* };
|
|
34
|
-
*/
|
|
35
|
-
export function find(path) {
|
|
36
|
-
return typescriptDialect.find(path);
|
|
37
|
-
}
|
|
1
|
+
export * from "../../bounded-contexts/authoring/infrastructure/out/dialects/typescript/index.js";
|
|
@@ -1,69 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { type YamlStream } from "./ast.ts";
|
|
3
|
-
import type { DocumentOption, YamlPath, YamlValue } from "./paths.ts";
|
|
4
|
-
import { type CollectionStyle, type CommentOptions, type ScalarStyle } from "./presentation.ts";
|
|
5
|
-
import { type KeyOptions } from "./structural.ts";
|
|
6
|
-
export * as astLibrary from "yaml";
|
|
7
|
-
export type { YamlStream, YamlPath, YamlValue };
|
|
8
|
-
type YamlOps = {
|
|
9
|
-
setValue: (ast: YamlStream, path: YamlPath, value: YamlValue, options?: KeyOptions) => void;
|
|
10
|
-
addKey: (ast: YamlStream, path: YamlPath, value: YamlValue, options?: KeyOptions) => void;
|
|
11
|
-
removeKey: (ast: YamlStream, path: YamlPath, options?: DocumentOption) => void;
|
|
12
|
-
renameKey: (ast: YamlStream, path: YamlPath, newKey: string, options?: DocumentOption) => void;
|
|
13
|
-
insertItem: (ast: YamlStream, path: YamlPath, index: number, value: YamlValue, options?: DocumentOption) => void;
|
|
14
|
-
appendItem: (ast: YamlStream, path: YamlPath, value: YamlValue, options?: DocumentOption & {
|
|
15
|
-
unique?: boolean;
|
|
16
|
-
}) => void;
|
|
17
|
-
removeItem: (ast: YamlStream, path: YamlPath, index: number, options?: DocumentOption) => void;
|
|
18
|
-
removeValue: (ast: YamlStream, path: YamlPath, value: YamlValue, options?: DocumentOption) => void;
|
|
19
|
-
replaceItem: (ast: YamlStream, path: YamlPath, index: number, value: YamlValue, options?: DocumentOption) => void;
|
|
20
|
-
moveItem: (ast: YamlStream, path: YamlPath, from: number, to: number, options?: DocumentOption) => void;
|
|
21
|
-
merge: (ast: YamlStream, path: YamlPath, value: {
|
|
22
|
-
[key: string]: YamlValue;
|
|
23
|
-
}, options?: DocumentOption) => void;
|
|
24
|
-
updateValue: (ast: YamlStream, path: YamlPath, fn: (current: YamlValue | undefined) => YamlValue, options?: DocumentOption) => void;
|
|
25
|
-
setComment: (ast: YamlStream, path: YamlPath, comment: string, options?: CommentOptions) => void;
|
|
26
|
-
removeComment: (ast: YamlStream, path: YamlPath, options?: CommentOptions) => void;
|
|
27
|
-
setAnchor: (ast: YamlStream, path: YamlPath, name: string, options?: DocumentOption) => void;
|
|
28
|
-
removeAnchor: (ast: YamlStream, path: YamlPath, options?: DocumentOption) => void;
|
|
29
|
-
setAlias: (ast: YamlStream, path: YamlPath, anchor: string, options?: DocumentOption) => void;
|
|
30
|
-
addMergeKey: (ast: YamlStream, path: YamlPath, anchor: string, options?: DocumentOption) => void;
|
|
31
|
-
setStyle: (ast: YamlStream, path: YamlPath, style: CollectionStyle | ScalarStyle, options?: DocumentOption) => void;
|
|
32
|
-
addDocument: (ast: YamlStream, value: YamlValue, options?: {
|
|
33
|
-
index?: number;
|
|
34
|
-
}) => void;
|
|
35
|
-
removeDocument: (ast: YamlStream, index: number) => void;
|
|
36
|
-
moveValue: (ast: YamlStream, from: YamlPath, to: YamlPath, options?: DocumentOption) => void;
|
|
37
|
-
copyValue: (ast: YamlStream, from: YamlPath, to: YamlPath, options?: DocumentOption) => void;
|
|
38
|
-
sortKeys: (ast: YamlStream, path: YamlPath, options?: DocumentOption & {
|
|
39
|
-
recursive?: boolean;
|
|
40
|
-
}) => void;
|
|
41
|
-
setTag: (ast: YamlStream, path: YamlPath, tag: string | null, options?: DocumentOption) => void;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Opens a `.yaml` or `.yml` file for YAML-dialect editing. The basename must end in one of those
|
|
45
|
-
* extensions after a non-empty stem; every other path throws synchronously, before any op runs,
|
|
46
|
-
* with the `dialect operation failed: ` prefix.
|
|
47
|
-
*
|
|
48
|
-
* Every named op addresses a node by a path array (`["services", "web", "ports", 0]`) and takes
|
|
49
|
-
* an optional last `{ document }` option selecting a document of a multi-document file.
|
|
50
|
-
* Documents no op touched print byte-identical to their source.
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* import * as yaml from "@pbuilder/sdk/yaml";
|
|
54
|
-
*
|
|
55
|
-
* // compose.yaml before: services:\n web:\n image: node\n
|
|
56
|
-
* export const run = async () => {
|
|
57
|
-
* await yaml
|
|
58
|
-
* .find("compose.yaml")
|
|
59
|
-
* .setValue(["services", "web", "ports"], ["3000:3000"])
|
|
60
|
-
* .setComment(["services", "web"], "Frontend");
|
|
61
|
-
* };
|
|
62
|
-
* // -> services:
|
|
63
|
-
* // -> # Frontend
|
|
64
|
-
* // -> web:
|
|
65
|
-
* // -> image: node
|
|
66
|
-
* // -> ports:
|
|
67
|
-
* // -> - 3000:3000
|
|
68
|
-
*/
|
|
69
|
-
export declare function find(path: string): Handle<"found", YamlStream, YamlOps>;
|
|
1
|
+
export * from "../../bounded-contexts/authoring/infrastructure/out/dialects/yaml/index.ts";
|
|
@@ -1,70 +1 @@
|
|
|
1
|
-
|
|
2
|
-
// (`defineDialect`/`defineOpPack`/`withOps`), mirroring the other dialect modules.
|
|
3
|
-
import { defineDialect, defineOpPack, withOps } from "../../core/define-dialect.js";
|
|
4
|
-
import { parse, print } from "./ast.js";
|
|
5
|
-
import { addDocument, removeDocument } from "./documents.js";
|
|
6
|
-
import { addMergeKey, removeAnchor, removeComment, setAlias, setAnchor, setComment, setStyle, setTag, } from "./presentation.js";
|
|
7
|
-
import { addKey, appendItem, copyValue, insertItem, merge, moveItem, moveValue, removeItem, removeKey, removeValue, renameKey, replaceItem, setValue, sortKeys, updateValue, } from "./structural.js";
|
|
8
|
-
export * as astLibrary from "yaml";
|
|
9
|
-
const opsPack = defineOpPack({
|
|
10
|
-
setValue,
|
|
11
|
-
addKey,
|
|
12
|
-
removeKey,
|
|
13
|
-
renameKey,
|
|
14
|
-
insertItem,
|
|
15
|
-
appendItem,
|
|
16
|
-
removeItem,
|
|
17
|
-
removeValue,
|
|
18
|
-
replaceItem,
|
|
19
|
-
moveItem,
|
|
20
|
-
merge,
|
|
21
|
-
updateValue,
|
|
22
|
-
setComment,
|
|
23
|
-
removeComment,
|
|
24
|
-
setAnchor,
|
|
25
|
-
removeAnchor,
|
|
26
|
-
setAlias,
|
|
27
|
-
addMergeKey,
|
|
28
|
-
setStyle,
|
|
29
|
-
addDocument,
|
|
30
|
-
removeDocument,
|
|
31
|
-
moveValue,
|
|
32
|
-
copyValue,
|
|
33
|
-
sortKeys,
|
|
34
|
-
setTag,
|
|
35
|
-
});
|
|
36
|
-
const baseDialect = defineDialect({
|
|
37
|
-
extensions: [".yaml", ".yml"],
|
|
38
|
-
ast: { parse, print },
|
|
39
|
-
ops: {},
|
|
40
|
-
});
|
|
41
|
-
const yamlDialect = withOps(baseDialect, opsPack);
|
|
42
|
-
/**
|
|
43
|
-
* Opens a `.yaml` or `.yml` file for YAML-dialect editing. The basename must end in one of those
|
|
44
|
-
* extensions after a non-empty stem; every other path throws synchronously, before any op runs,
|
|
45
|
-
* with the `dialect operation failed: ` prefix.
|
|
46
|
-
*
|
|
47
|
-
* Every named op addresses a node by a path array (`["services", "web", "ports", 0]`) and takes
|
|
48
|
-
* an optional last `{ document }` option selecting a document of a multi-document file.
|
|
49
|
-
* Documents no op touched print byte-identical to their source.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* import * as yaml from "@pbuilder/sdk/yaml";
|
|
53
|
-
*
|
|
54
|
-
* // compose.yaml before: services:\n web:\n image: node\n
|
|
55
|
-
* export const run = async () => {
|
|
56
|
-
* await yaml
|
|
57
|
-
* .find("compose.yaml")
|
|
58
|
-
* .setValue(["services", "web", "ports"], ["3000:3000"])
|
|
59
|
-
* .setComment(["services", "web"], "Frontend");
|
|
60
|
-
* };
|
|
61
|
-
* // -> services:
|
|
62
|
-
* // -> # Frontend
|
|
63
|
-
* // -> web:
|
|
64
|
-
* // -> image: node
|
|
65
|
-
* // -> ports:
|
|
66
|
-
* // -> - 3000:3000
|
|
67
|
-
*/
|
|
68
|
-
export function find(path) {
|
|
69
|
-
return yamlDialect.find(path);
|
|
70
|
-
}
|
|
1
|
+
export * from "../../bounded-contexts/authoring/infrastructure/out/dialects/yaml/index.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// S-000: kit-internal shared structural-equality helper (row-146, ADR-0012 amendment clause
|
|
2
2
|
// 4). Sibling of ./dialect-error.ts — same kit-internal-shared-in-core pattern, one decision
|
|
3
|
-
// covers both, no separate ADR. Not re-exported from
|
|
4
|
-
// no public symbol. src/conformance/index.ts and src/testing/contract-fake.ts each carry
|
|
3
|
+
// covers both, no separate ADR. Not re-exported from any barrel or subpath:
|
|
4
|
+
// no public symbol. src/bounded-contexts/authoring/testing/conformance/index.ts and src/bounded-contexts/authoring/testing/contract-fake.ts each carry
|
|
5
5
|
// their OWN duplicated copy today (FIT-17 forbids ./conformance -> ./testing); extracting
|
|
6
6
|
// both onto this shared module is S-005's task, not this one's.
|
|
7
7
|
function isKeyedObject(value) {
|
|
@@ -14,7 +14,7 @@ export const TOKEN_CEILING_CHARS = 200;
|
|
|
14
14
|
export const OUTSIDE_PROJECT_TOKEN = "<outside-project>";
|
|
15
15
|
// REQ-WPS-07.3: an echoed host-controlled identifier (e.g. an unrecognized argv flag, a
|
|
16
16
|
// malformed export name) is truncated to this per-token max BEFORE composition — names
|
|
17
|
-
// surface, values never (
|
|
17
|
+
// surface, values never (the codegen adapter's describeSufficiencyFinding precedent).
|
|
18
18
|
export function truncateToken(token) {
|
|
19
19
|
return token.length > TOKEN_CEILING_CHARS ? token.slice(0, TOKEN_CEILING_CHARS) : token;
|
|
20
20
|
}
|
|
@@ -44,7 +44,7 @@ export function toProjectRelativePath(subjectPath, projectRoot = process.cwd())
|
|
|
44
44
|
export function composeWithToken(prefix, token, suffix = "") {
|
|
45
45
|
return boundMessage(`${prefix}${truncateToken(token)}${suffix}`);
|
|
46
46
|
}
|
|
47
|
-
// This module sits at <sdk>/src/
|
|
47
|
+
// This module sits at <sdk>/src/platform/ in source and <sdk>/dist/platform/ in the build.
|
|
48
48
|
// dirname rather than a "../.." URL: that form keeps a trailing slash, which never matches
|
|
49
49
|
// as a whole segment.
|
|
50
50
|
const SDK_ROOT = dirname(dirname(dirname(fileURLToPath(import.meta.url))));
|
|
@@ -2,103 +2,123 @@
|
|
|
2
2
|
"manifestVersion": 1,
|
|
3
3
|
"algorithm": "sha256",
|
|
4
4
|
"entry": "dist/bin/pbuilder-runner.js",
|
|
5
|
-
"packageVersion": "0.
|
|
5
|
+
"packageVersion": "0.15.0",
|
|
6
6
|
"files": [
|
|
7
|
+
{
|
|
8
|
+
"path": "dist/acl/irwire/frame-reader.js",
|
|
9
|
+
"sha256": "00c9639b0c563e8ff4c1c2c87c6da11dc6bbd9c649c50fd0a2d2c2af8584d554"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"path": "dist/acl/irwire/stdio-engine-client.js",
|
|
13
|
+
"sha256": "ce4192c2d177ef64c9931b99b34d4b7c5cd9c87aaab80e7495e333a09dbac039"
|
|
14
|
+
},
|
|
7
15
|
{
|
|
8
16
|
"path": "dist/bin/pbuilder-runner.js",
|
|
9
|
-
"sha256": "
|
|
17
|
+
"sha256": "69c0eda11093fe7c2a83d792bf4c67a63874dbc8098fadb65a35b62f96cfd852"
|
|
10
18
|
},
|
|
11
19
|
{
|
|
12
|
-
"path": "dist/
|
|
13
|
-
"sha256": "
|
|
20
|
+
"path": "dist/bounded-contexts/authoring/application/usecases/run-factory/context.js",
|
|
21
|
+
"sha256": "cbc476d322490393fb20524017748ec2392c30b3f19208c07f0dbc80e04c5903"
|
|
14
22
|
},
|
|
15
23
|
{
|
|
16
|
-
"path": "dist/
|
|
17
|
-
"sha256": "
|
|
24
|
+
"path": "dist/bounded-contexts/authoring/application/usecases/run-factory/driving.js",
|
|
25
|
+
"sha256": "48f0846d5d34269293b9bc4ff1634917a1a3460f4e492ea40f1f3c6e9d21501e"
|
|
18
26
|
},
|
|
19
27
|
{
|
|
20
|
-
"path": "dist/
|
|
21
|
-
"sha256": "
|
|
28
|
+
"path": "dist/bounded-contexts/authoring/domain/aggregates/session/session.js",
|
|
29
|
+
"sha256": "6d38cebbed54516ad508eb096e7248a53da911e5b1dbad9e7118d93541712cf2"
|
|
22
30
|
},
|
|
23
31
|
{
|
|
24
|
-
"path": "dist/
|
|
32
|
+
"path": "dist/bounded-contexts/authoring/domain/ports/emit-rejection.js",
|
|
25
33
|
"sha256": "c81b169f05ecc251a374c593d3d3a86eaef79d5fbddbb379c3db0b8cc62ad962"
|
|
26
34
|
},
|
|
27
35
|
{
|
|
28
|
-
"path": "dist/
|
|
29
|
-
"sha256": "
|
|
36
|
+
"path": "dist/bounded-contexts/authoring/domain/ports/package-files.js",
|
|
37
|
+
"sha256": "47058c2a9e1571e35b11d1395bc14652e62169823ec5f20f47b1a8df1689f0a7"
|
|
30
38
|
},
|
|
31
39
|
{
|
|
32
|
-
"path": "dist/
|
|
33
|
-
"sha256": "
|
|
40
|
+
"path": "dist/bounded-contexts/authoring/domain/services/directive-factory.js",
|
|
41
|
+
"sha256": "e3718b19c6609139f36d562daa44a4727d0d6d279a90736aa24722ab5df93d92"
|
|
34
42
|
},
|
|
35
43
|
{
|
|
36
|
-
"path": "dist/
|
|
37
|
-
"sha256": "
|
|
44
|
+
"path": "dist/bounded-contexts/authoring/domain/services/run-context.js",
|
|
45
|
+
"sha256": "4c45aa26aa81b2ec59a6b09dbaf14da7be6d034bfc46e2b35aba2bfe0e641a49"
|
|
38
46
|
},
|
|
39
47
|
{
|
|
40
|
-
"path": "dist/
|
|
41
|
-
"sha256": "
|
|
48
|
+
"path": "dist/bounded-contexts/authoring/domain/services/schema/input-rejection.js",
|
|
49
|
+
"sha256": "b99aab6adaf706442f472b50a66ac10e2c57dd39de8b8c553dad40f69555ac38"
|
|
42
50
|
},
|
|
43
51
|
{
|
|
44
|
-
"path": "dist/
|
|
45
|
-
"sha256": "
|
|
52
|
+
"path": "dist/bounded-contexts/authoring/domain/services/schema/schema-files.js",
|
|
53
|
+
"sha256": "14c067650a31428ae09d2292da0128ff13cf9c9bf87bb09aa2b03fbd2f741f0e"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"path": "dist/bounded-contexts/authoring/domain/services/schema/schema-locate.js",
|
|
57
|
+
"sha256": "2d324909c9ccaeff7d69d3670198c2beaf72a5653b51a60aa3994772425ff883"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"path": "dist/bounded-contexts/authoring/domain/services/schema/schema-parse.js",
|
|
61
|
+
"sha256": "b38e93759275c6f544b6d45b6fca2f1ffd95054ff9fd0bbba338f9c3ad82c427"
|
|
46
62
|
},
|
|
47
63
|
{
|
|
48
|
-
"path": "dist/
|
|
49
|
-
"sha256": "
|
|
64
|
+
"path": "dist/bounded-contexts/authoring/domain/services/schema/schema-validate.js",
|
|
65
|
+
"sha256": "377f028c80bf44999efed5318784e74930bd6eda1c1f0e6d3532be9d4fa7af57"
|
|
50
66
|
},
|
|
51
67
|
{
|
|
52
|
-
"path": "dist/
|
|
53
|
-
"sha256": "
|
|
68
|
+
"path": "dist/bounded-contexts/authoring/domain/valueobjects/authoring-error.js",
|
|
69
|
+
"sha256": "3c0d3a5c62c2f679acba2e0cae2a4e73fda65f46eddff1c243b8ed9b073bc950"
|
|
54
70
|
},
|
|
55
71
|
{
|
|
56
|
-
"path": "dist/
|
|
57
|
-
"sha256": "
|
|
72
|
+
"path": "dist/bounded-contexts/authoring/domain/valueobjects/schema-model.js",
|
|
73
|
+
"sha256": "7e9e3077326d3aa54ac431d1b6243d2f1302178f095be073ddc2caf365d2600d"
|
|
58
74
|
},
|
|
59
75
|
{
|
|
60
|
-
"path": "dist/
|
|
61
|
-
"sha256": "
|
|
76
|
+
"path": "dist/bounded-contexts/authoring/domain/valueobjects/wire.js",
|
|
77
|
+
"sha256": "965bd72c7ec6f914edc717cf2fd4aaff6395857fb486f0301e2fb4e0977e0616"
|
|
62
78
|
},
|
|
63
79
|
{
|
|
64
|
-
"path": "dist/
|
|
65
|
-
"sha256": "
|
|
80
|
+
"path": "dist/bounded-contexts/authoring/infrastructure/out/fs/package-files.js",
|
|
81
|
+
"sha256": "58a0bef6c4a7649dbbd5b5890f5cdeacb85bfdf9f805d973b22f2ce2e09e79da"
|
|
66
82
|
},
|
|
67
83
|
{
|
|
68
|
-
"path": "dist/
|
|
69
|
-
"sha256": "
|
|
84
|
+
"path": "dist/bounded-contexts/runner-hosting/infrastructure/in/exit-codes.js",
|
|
85
|
+
"sha256": "973108239a15c98d6f577f374f52523fac81757383f998dbc4230432f2daa427"
|
|
70
86
|
},
|
|
71
87
|
{
|
|
72
|
-
"path": "dist/
|
|
73
|
-
"sha256": "
|
|
88
|
+
"path": "dist/bounded-contexts/runner-hosting/infrastructure/in/factory-pointer.js",
|
|
89
|
+
"sha256": "11fb66ca794315113b8eedfbc7815753a98ccd58a249593f087a6b4bca19bc11"
|
|
74
90
|
},
|
|
75
91
|
{
|
|
76
|
-
"path": "dist/
|
|
77
|
-
"sha256": "
|
|
92
|
+
"path": "dist/bounded-contexts/runner-hosting/infrastructure/in/runner.js",
|
|
93
|
+
"sha256": "7cbd24c7cd55f307ed6a99281973a67d964f2ed56890422a17477a1e2f80ce73"
|
|
78
94
|
},
|
|
79
95
|
{
|
|
80
|
-
"path": "dist/
|
|
81
|
-
"sha256": "
|
|
96
|
+
"path": "dist/bounded-contexts/runner-hosting/infrastructure/in/single-instance-probe.js",
|
|
97
|
+
"sha256": "345639841efda1cb206951bc8c6c251bc0d5c17451d22a22210cc8e80dff06b5"
|
|
82
98
|
},
|
|
83
99
|
{
|
|
84
|
-
"path": "dist/
|
|
85
|
-
"sha256": "
|
|
100
|
+
"path": "dist/platform/error-text.js",
|
|
101
|
+
"sha256": "dc223fc58507dc2935811f82e1303683dd1dd991479b1904ef914205cf0ee108"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"path": "dist/platform/fs-errors.js",
|
|
105
|
+
"sha256": "2b94dc59e783947a812980ed8f95d4ff45a983feafef0cdcbd47a3f6eaf67326"
|
|
86
106
|
},
|
|
87
107
|
{
|
|
88
|
-
"path": "dist/
|
|
89
|
-
"sha256": "
|
|
108
|
+
"path": "dist/shared-kernel/batch-cap.js",
|
|
109
|
+
"sha256": "6da3dc42d5436b10d3e95529fe92ca26de044f8fbdb9bfbe651aa3a3292b6f5c"
|
|
90
110
|
},
|
|
91
111
|
{
|
|
92
|
-
"path": "dist/
|
|
93
|
-
"sha256": "
|
|
112
|
+
"path": "dist/shared-kernel/framing.js",
|
|
113
|
+
"sha256": "9fd7e34f743280a88686f0d83a02e9782d90e3aa5d9cc6fa66ff90107bbd6d0f"
|
|
94
114
|
},
|
|
95
115
|
{
|
|
96
|
-
"path": "dist/
|
|
97
|
-
"sha256": "
|
|
116
|
+
"path": "dist/shared-kernel/wire-protocol.js",
|
|
117
|
+
"sha256": "99f9965f655042b8724f04de798894bad7f2b4d517f3f9c2f61acc5bfe4be457"
|
|
98
118
|
},
|
|
99
119
|
{
|
|
100
120
|
"path": "package.json",
|
|
101
|
-
"sha256": "
|
|
121
|
+
"sha256": "12f657b65a3c477f52380214722085d3d776080e2670d17d4c86432ca63dca27"
|
|
102
122
|
}
|
|
103
123
|
]
|
|
104
124
|
}
|