@effected/workspaces 0.42.0 → 0.44.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/PackedInstall.js +5 -7
- package/PnpmSettings.js +535 -0
- package/README.md +35 -1
- package/SourceBoundary.js +124 -2
- package/index.d.ts +321 -1
- package/index.js +2 -1
- package/package.json +9 -9
- package/testing.d.ts +53 -18
package/testing.d.ts
CHANGED
|
@@ -1302,14 +1302,13 @@ export type PackageManagerName = typeof PackageManagerName.Type;
|
|
|
1302
1302
|
* @remarks
|
|
1303
1303
|
* `{ directory }` runs `npm pack` in that subdirectory of each package, whose
|
|
1304
1304
|
* manifest must already be publish-ready. The default,
|
|
1305
|
-
* `{ directory: "dist/prod/npm/pkg" }`, is `@
|
|
1305
|
+
* `{ directory: "dist/prod/npm/pkg" }`, is `@effected/bundler`'s npm
|
|
1306
1306
|
* output: the same file list a release publishes.
|
|
1307
1307
|
*
|
|
1308
1308
|
* `"source"` runs `pnpm pack` in the package directory: pnpm honours
|
|
1309
1309
|
* `publishConfig.directory` and rewrites `workspace:` and `catalog:`
|
|
1310
|
-
* specifiers.
|
|
1311
|
-
*
|
|
1312
|
-
* published one. And pnpm can rewrite a `workspace:` specifier only in a
|
|
1310
|
+
* specifiers. A package that sets `publishConfig.directory` to anything but its
|
|
1311
|
+
* release output proves that directory, not the published one. And pnpm can rewrite a `workspace:` specifier only in a
|
|
1313
1312
|
* workspace that has been `pnpm install`ed: in a never-installed one the pack
|
|
1314
1313
|
* fails with `ERR_PNPM_CANNOT_RESOLVE_WORKSPACE_PROTOCOL`, which
|
|
1315
1314
|
* `PackedInstall.run` reports as a `PackFailed` error naming the missing
|
|
@@ -1348,7 +1347,7 @@ interface PackedInstallClosureOptions {
|
|
|
1348
1347
|
* For a closure member that imports a surface of a dependency existing
|
|
1349
1348
|
* only in a sibling checkout's unreleased build, which the registry's copy
|
|
1350
1349
|
* lacks. A directory is `npm pack`ed, so it must be
|
|
1351
|
-
* publish-ready (for a package built by `@
|
|
1350
|
+
* publish-ready (for a package built by `@effected/bundler`, its
|
|
1352
1351
|
* `dist/prod/npm/pkg`); a `.tgz` is used as it is. Either way the packed
|
|
1353
1352
|
* manifest must be named as its key, carry no specifier only a workspace
|
|
1354
1353
|
* could resolve, and it joins `PackedInstallResult.tarballs`. Each
|
|
@@ -1976,9 +1975,8 @@ export declare class PackedInstall {
|
|
|
1976
1975
|
* (default `{ directory: "dist/prod/npm/pkg" }`), the same file whose
|
|
1977
1976
|
* absence makes the run fail `PackSourceMissing`. Under `packFrom: "source"`
|
|
1978
1977
|
* the packer builds nothing of its own, so nothing is checked and the
|
|
1979
|
-
* result is ready.
|
|
1980
|
-
*
|
|
1981
|
-
* test job's usual `build:dev` pre-step does not run. Pair it with
|
|
1978
|
+
* result is ready. The output exists only after the build, which a test job
|
|
1979
|
+
* has to run first. Pair it with
|
|
1982
1980
|
* {@link PackedInstall.gate} to skip locally and fail under CI.
|
|
1983
1981
|
*
|
|
1984
1982
|
* Fails as `closure` does, plus `Io` when a path cannot be inspected.
|
|
@@ -2012,9 +2010,8 @@ export declare class PackedInstall {
|
|
|
2012
2010
|
* unreadable `CI` counts as unset. Ready is always `"run"`;
|
|
2013
2011
|
* missing is `"skip"` off CI and `"fail"` on it, so a CI job that never ran
|
|
2014
2012
|
* the prod build cannot pass by silently skipping the proof. The message
|
|
2015
|
-
* names every missing path. The test job must run the
|
|
2016
|
-
*
|
|
2017
|
-
* tests: a dev build leaves `dist/prod` absent.
|
|
2013
|
+
* names every missing path. The test job must run the build (`build` for an
|
|
2014
|
+
* `@effected/bundler` package) before the packed-install tests.
|
|
2018
2015
|
*
|
|
2019
2016
|
* @example
|
|
2020
2017
|
* ```ts
|
|
@@ -2067,8 +2064,18 @@ export declare class PackedInstall {
|
|
|
2067
2064
|
* re-export (`export { App } from ...`), an `export * from` of the module,
|
|
2068
2065
|
* and a member access on a namespace binding (`import * as m from ...` or the
|
|
2069
2066
|
* TypeScript `import m = require(...)`, then `m.App`). `from` must equal the specifier
|
|
2070
|
-
* exactly; a subpath is a different module.
|
|
2071
|
-
*
|
|
2067
|
+
* exactly; a subpath is a different module. `{ promiseInExclusive }` forbids
|
|
2068
|
+
* `Effect.promise(`, `Effect.runPromise(` and `Effect.runPromiseExit(` inside the argument span of a
|
|
2069
|
+
* `<lane>.run(` call, where `<lane>` is a name the same file binds from
|
|
2070
|
+
* `Exclusive.make` (`const lane = yield* Exclusive.make`) or one listed in
|
|
2071
|
+
* `lanes`. Core's `Effect.promise` abandons the promise when the lane's timeout
|
|
2072
|
+
* interrupts the body, so the permit is released while the work still runs;
|
|
2073
|
+
* `Exclusive.promise` aborts and waits. `Exclusive.promise` and
|
|
2074
|
+
* `Effect.tryPromise` are not flagged. The check is lexical: a helper called
|
|
2075
|
+
* from the body, a body bound to a variable before `run`, a member receiver
|
|
2076
|
+
* (`this.lane.run(`), an aliased import of `Effect`, a destructured `run` and a
|
|
2077
|
+
* call through a local alias of `Effect.promise` all pass. See
|
|
2078
|
+
* {@link SourceBoundary}'s remarks for what this lexer cannot see.
|
|
2072
2079
|
*
|
|
2073
2080
|
* To confine a token to named files rather than forbid it everywhere, forbid
|
|
2074
2081
|
* it and waive the rule for those files through
|
|
@@ -2084,7 +2091,8 @@ export declare class PackedInstall {
|
|
|
2084
2091
|
* `{ forbidImports: ["node:*", ...builtinModules] }` with `builtinModules`
|
|
2085
2092
|
* from `node:module`. That also forbids npm packages that share a built-in's
|
|
2086
2093
|
* name (`events`, `buffer`, `punycode`). No built-in list ships here: it
|
|
2087
|
-
* would drift with Node releases.
|
|
2094
|
+
* would drift with Node releases. {@link SourceBoundary.platformFree} builds
|
|
2095
|
+
* the rule from that list.
|
|
2088
2096
|
*
|
|
2089
2097
|
* @public
|
|
2090
2098
|
*/
|
|
@@ -2094,6 +2102,8 @@ type BoundaryRule = "process" | "node:process" | "stdout-write" | "console" | "c
|
|
|
2094
2102
|
readonly forbidTokens: ReadonlyArray<string>;
|
|
2095
2103
|
} | {
|
|
2096
2104
|
readonly forbidImportedNames: ForbiddenImportedNames;
|
|
2105
|
+
} | {
|
|
2106
|
+
readonly promiseInExclusive: PromiseInExclusiveOptions;
|
|
2097
2107
|
};
|
|
2098
2108
|
/**
|
|
2099
2109
|
* The names a `{ forbidImportedNames }` rule forbids, and the module they must
|
|
@@ -2107,6 +2117,15 @@ interface ForbiddenImportedNames {
|
|
|
2107
2117
|
/** The export names that must not be imported from it. `"default"` names the default export. */
|
|
2108
2118
|
readonly names: ReadonlyArray<string>;
|
|
2109
2119
|
}
|
|
2120
|
+
/**
|
|
2121
|
+
* The options of a `{ promiseInExclusive }` rule.
|
|
2122
|
+
*
|
|
2123
|
+
* @public
|
|
2124
|
+
*/
|
|
2125
|
+
interface PromiseInExclusiveOptions {
|
|
2126
|
+
/** Names of lanes this file receives rather than binds from `Exclusive.make`, such as a parameter. */
|
|
2127
|
+
readonly lanes?: ReadonlyArray<string> | undefined;
|
|
2128
|
+
}
|
|
2110
2129
|
/**
|
|
2111
2130
|
* Options for the `process` rule.
|
|
2112
2131
|
*
|
|
@@ -2145,7 +2164,7 @@ declare const Offence_base: Schema.Class<Offence, Schema.Struct<{
|
|
|
2145
2164
|
/** The 1-based column, in UTF-16 code units. */
|
|
2146
2165
|
readonly column: Schema.Number;
|
|
2147
2166
|
/** The rule broken. */
|
|
2148
|
-
readonly rule: Schema.Literals<readonly ["process", "node:process", "stdout-write", "console", "console-stdout", "forbidImports", "forbidTokens", "forbidImportedNames"]>;
|
|
2167
|
+
readonly rule: Schema.Literals<readonly ["process", "node:process", "stdout-write", "console", "console-stdout", "forbidImports", "forbidTokens", "forbidImportedNames", "promiseInExclusive"]>;
|
|
2149
2168
|
/**
|
|
2150
2169
|
* What matched: the identifier, the call, the import specifier, the token,
|
|
2151
2170
|
* or, for `forbidImportedNames`, `<name> from <specifier>` (`*` for an
|
|
@@ -2166,7 +2185,8 @@ export declare class Offence extends Offence_base {
|
|
|
2166
2185
|
* The rule an {@link Offence} names: every string {@link BoundaryRule}, plus
|
|
2167
2186
|
* `"forbidImports"` for any `{ forbidImports }` rule, `"forbidTokens"` for
|
|
2168
2187
|
* any `{ forbidTokens }` rule and `"forbidImportedNames"` for any
|
|
2169
|
-
* `{ forbidImportedNames }` rule
|
|
2188
|
+
* `{ forbidImportedNames }` rule and `"promiseInExclusive"` for any
|
|
2189
|
+
* `{ promiseInExclusive }` rule. These are the keys of
|
|
2170
2190
|
* {@link ScanOptions.allowRules}.
|
|
2171
2191
|
*
|
|
2172
2192
|
* @public
|
|
@@ -2298,8 +2318,23 @@ export declare class SourceBoundary {
|
|
|
2298
2318
|
static readonly stripComments: (text: string) => string;
|
|
2299
2319
|
/** Whether `text` reads the global `process` in code (see {@link BoundaryRule}). */
|
|
2300
2320
|
static readonly referencesProcess: (text: string, options?: ReferenceOptions) => boolean;
|
|
2301
|
-
/**
|
|
2321
|
+
/**
|
|
2322
|
+
* Every module specifier `text` imports: static, side-effect, re-export, type-only, `import(...)` with a literal, and `require(...)`.
|
|
2323
|
+
*
|
|
2324
|
+
* @remarks
|
|
2325
|
+
* One entry per occurrence, in source order: a module imported twice appears twice. Wrap the result in
|
|
2326
|
+
* `new Set(...)` for the set of modules.
|
|
2327
|
+
*/
|
|
2302
2328
|
static readonly importSpecifiers: (text: string) => ReadonlyArray<string>;
|
|
2329
|
+
/**
|
|
2330
|
+
* The rule for platform-free code: every Node built-in, bare or `node:`-prefixed, and `@effect/platform*`.
|
|
2331
|
+
*
|
|
2332
|
+
* @remarks
|
|
2333
|
+
* Pass `builtinModules` from `node:module` as `builtins`; no list ships here because it would drift with Node
|
|
2334
|
+
* releases. A bare-name list also forbids npm packages that share a built-in's name (`events`, `buffer`,
|
|
2335
|
+
* `punycode`).
|
|
2336
|
+
*/
|
|
2337
|
+
static readonly platformFree: (builtins: ReadonlyArray<string>) => BoundaryRule;
|
|
2303
2338
|
/** Whether `text` imports the Node built-in `module`, in either its `node:` or bare form. */
|
|
2304
2339
|
static readonly importsNode: (text: string, module: string) => boolean;
|
|
2305
2340
|
/**
|
|
@@ -2443,5 +2478,5 @@ export declare class WorkspaceLayering {
|
|
|
2443
2478
|
/** Discover the workspace and check it against `policy`. */
|
|
2444
2479
|
static readonly checkWorkspace: (policy: LayerPolicy) => Effect.Effect<LayeringReport, WorkspaceDiscoveryFailure, WorkspaceDiscovery>;
|
|
2445
2480
|
}
|
|
2446
|
-
export type { BinCommandOptions, BinProvenance, BoundaryFixture, BoundaryRule, DependencyDiff, FindWorkspaceRootOptions, ForbiddenImportedNames, LayeringGraph, OffenceRule, PackSource, PackedInstallBudget, PackedInstallClosureOptions, PackedInstallGate, PackedInstallOptions, PackedInstallPreflight, PackedInstallPreflightOptions, ReachabilityOptions, ReferenceOptions, RunBinOptions, ScanOptions, UndeclaredOptions, WorkspaceDiscoveryFailure, WorkspaceDiscoveryOptions, WorkspaceDiscoveryShape, WorkspaceLookupFailure, WorkspaceRootShape };
|
|
2481
|
+
export type { BinCommandOptions, BinProvenance, BoundaryFixture, BoundaryRule, DependencyDiff, FindWorkspaceRootOptions, ForbiddenImportedNames, LayeringGraph, OffenceRule, PackSource, PackedInstallBudget, PackedInstallClosureOptions, PackedInstallGate, PackedInstallOptions, PackedInstallPreflight, PackedInstallPreflightOptions, PromiseInExclusiveOptions, ReachabilityOptions, ReferenceOptions, RunBinOptions, ScanOptions, UndeclaredOptions, WorkspaceDiscoveryFailure, WorkspaceDiscoveryOptions, WorkspaceDiscoveryShape, WorkspaceLookupFailure, WorkspaceRootShape };
|
|
2447
2482
|
//# sourceMappingURL=testing.d.ts.map
|