@defrex/autobuild-vercel-sandbox 0.9.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 +34 -0
- package/package.json +34 -0
- package/src/index.ts +60 -0
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# @defrex/autobuild-vercel-sandbox
|
|
2
|
+
|
|
3
|
+
The Vercel Sandbox workspace provider as an Autobuild plugin package
|
|
4
|
+
(AUT-517).
|
|
5
|
+
|
|
6
|
+
## Transitional arrangement
|
|
7
|
+
|
|
8
|
+
Until the builtin provider is removed (AUT-505), the provider's
|
|
9
|
+
implementation stays **builtin-hosted** in `@defrex/autobuild`: its
|
|
10
|
+
implementation depends on core internals that are not on the
|
|
11
|
+
`@defrex/autobuild/plugin-sdk` surface, and moving it now would force the
|
|
12
|
+
root package to depend on this plugin, recreating a root ↔ provider
|
|
13
|
+
publish cycle.
|
|
14
|
+
|
|
15
|
+
This package therefore ships the plugin manifest with the full AUT-516
|
|
16
|
+
capability declarations — the exact shared `VERCEL_SANDBOX_CAPABILITIES`
|
|
17
|
+
object the builtin registration references — and a guarded factory that
|
|
18
|
+
throws naming AUT-505 if it is ever reached. While the builtin exists, the
|
|
19
|
+
plugin loader's duplicate-skip rule guarantees the factory is never
|
|
20
|
+
invoked: a configured plugin whose registrations all collide with builtin
|
|
21
|
+
workspace-provider registrations is skipped with a one-line notice, and the
|
|
22
|
+
builtin keeps serving the provider. After AUT-505 removes the builtin and
|
|
23
|
+
moves the implementation here, the skip rule retires itself (it keys on
|
|
24
|
+
builtin ownership) and a second plugin registering `vercel-sandbox`
|
|
25
|
+
collides and fails startup as today.
|
|
26
|
+
|
|
27
|
+
## Hosted deployment bundle
|
|
28
|
+
|
|
29
|
+
The hosted dispatcher's deploy-build stages a self-contained `bun build`
|
|
30
|
+
bundle of this package into the repository-root `node_modules` and appends
|
|
31
|
+
it to the dispatch route's trace, so a bare
|
|
32
|
+
`@defrex/autobuild-vercel-sandbox` specifier resolves inside the deployed
|
|
33
|
+
`/api/dispatch` function. The npm published package remains the real
|
|
34
|
+
`src`.
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@defrex/autobuild-vercel-sandbox",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "Vercel Sandbox workspace provider plugin for Autobuild (transitional: the implementation stays builtin-hosted until AUT-505)",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"engines": {
|
|
8
|
+
"bun": ">=1.4.0"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./src/index.ts",
|
|
13
|
+
"import": "./src/index.ts",
|
|
14
|
+
"default": "./src/index.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"src",
|
|
19
|
+
"README.md",
|
|
20
|
+
"!src/**/*.test.ts",
|
|
21
|
+
"!src/**/*.test.tsx",
|
|
22
|
+
"!src/**/*.spec.ts",
|
|
23
|
+
"!src/**/*.spec.tsx"
|
|
24
|
+
],
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@defrex/autobuild": ">=0.9.0"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@vercel/sandbox": "^3.1.0"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@defrex/autobuild-vercel-sandbox` — the Vercel Sandbox workspace provider
|
|
3
|
+
* as an Autobuild plugin (AUT-517).
|
|
4
|
+
*
|
|
5
|
+
* Transitional state: the provider's implementation is builtin-hosted in
|
|
6
|
+
* core, because it depends on core internals that are not on the plugin-sdk
|
|
7
|
+
* surface (`config/schema`, `distribution-archive`, `operator-sandbox`,
|
|
8
|
+
* `build-execution`, `harvest-execution`, `git-worktree`) and the package
|
|
9
|
+
* must typecheck with only `@defrex/autobuild/plugin-sdk` imports. The
|
|
10
|
+
* capabilities are the shared `VERCEL_SANDBOX_CAPABILITIES` object imported
|
|
11
|
+
* from the SDK — the same runtime value the builtin registration references,
|
|
12
|
+
* so the two declarations cannot drift.
|
|
13
|
+
*
|
|
14
|
+
* While the builtin exists, the loader's duplicate-skip rule guarantees this
|
|
15
|
+
* manifest's factory is never invoked: every declared registration collides
|
|
16
|
+
* with a builtin workspace-provider registration, so the whole module is
|
|
17
|
+
* skipped with a notice and the builtin keeps serving the name. After the
|
|
18
|
+
* builtin's removal (AUT-505) the skip rule retires itself and a moved-in
|
|
19
|
+
* implementation replaces the guarded factory below.
|
|
20
|
+
*/
|
|
21
|
+
import {
|
|
22
|
+
parsePluginManifest,
|
|
23
|
+
VERCEL_SANDBOX_CAPABILITIES,
|
|
24
|
+
type AutobuildPluginManifest,
|
|
25
|
+
type WorkspaceProviderPluginDescriptor,
|
|
26
|
+
type WorkspaceProviderPluginFactory,
|
|
27
|
+
} from '@defrex/autobuild/plugin-sdk'
|
|
28
|
+
|
|
29
|
+
// Typed against the extended workspace-provider factory context (AUT-560):
|
|
30
|
+
// when the host invokes a workspace-provider factory it passes the
|
|
31
|
+
// host-derived seams (`storeRef`, `storeToken`, `runtimeReferences`,
|
|
32
|
+
// `origin`, `remoteBranchHead`) beside the shared `{ config, env, repoRoot }`.
|
|
33
|
+
// The guard below stays until AUT-505 moves the implementation into this
|
|
34
|
+
// package; the moved-in factory will consume exactly those seams.
|
|
35
|
+
const vercelSandboxFactory: WorkspaceProviderPluginFactory = () => {
|
|
36
|
+
throw new Error(
|
|
37
|
+
'the vercel-sandbox implementation is builtin-hosted in this distribution; ' +
|
|
38
|
+
"plugin construction arrives with the builtin's removal (AUT-505)",
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const vercelSandboxRegistration: WorkspaceProviderPluginDescriptor = {
|
|
43
|
+
factory: vercelSandboxFactory,
|
|
44
|
+
capabilities: VERCEL_SANDBOX_CAPABILITIES,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const manifest: AutobuildPluginManifest = {
|
|
48
|
+
name: 'autobuild-vercel-sandbox',
|
|
49
|
+
apiVersion: '^1.7.0',
|
|
50
|
+
workspaceProviders: {
|
|
51
|
+
'vercel-sandbox': vercelSandboxRegistration,
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Evaluation-time validation keeps a malformed manifest from ever reaching a
|
|
56
|
+
// loader: the default export is parsed once here, so a broken package fails
|
|
57
|
+
// at its own import rather than at a distant dispatch startup.
|
|
58
|
+
parsePluginManifest(manifest)
|
|
59
|
+
|
|
60
|
+
export default manifest
|