@sanity/runtime-cli 17.15.0 → 17.16.0-next.g8d59d6f
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 +19 -19
- package/dist/actions/blueprints/assets.d.ts +3 -3
- package/dist/actions/blueprints/assets.js +3 -3
- package/dist/actions/blueprints/blueprint.d.ts +20 -9
- package/dist/actions/blueprints/blueprint.js +25 -79
- package/dist/actions/blueprints/config.d.ts +1 -0
- package/dist/actions/blueprints/config.js +7 -1
- package/dist/actions/blueprints/pre-deploy.js +3 -3
- package/dist/actions/blueprints/process-assets.js +3 -2
- package/dist/baseCommands.js +3 -3
- package/dist/config.d.ts +1 -2
- package/dist/config.js +1 -2
- package/dist/cores/blueprints/doctor.js +2 -2
- package/dist/cores/blueprints/init.js +11 -2
- package/dist/cores/functions/test.js +29 -6
- package/dist/server/app.js +4 -4
- package/dist/server/static/components/app.css +8 -1
- package/dist/utils/blueprints/group-resources.d.ts +2 -1
- package/dist/utils/blueprints/group-resources.js +3 -3
- package/dist/utils/blueprints/resolve-deployed-resources.d.ts +2 -2
- package/dist/utils/blueprints/resolve-deployed-resources.js +4 -4
- package/dist/utils/bundles/prepare-asset.d.ts +3 -3
- package/dist/utils/bundles/prepare-asset.js +8 -7
- package/dist/utils/functions/child-process-wrapper.js +1 -1
- package/dist/utils/functions/child-runtime/invoke.d.ts +1 -0
- package/dist/utils/functions/child-runtime/invoke.js +26 -9
- package/dist/utils/functions/extract-durable-config.js +1 -4
- package/dist/utils/functions/invoke/local.js +11 -5
- package/dist/utils/functions/invoke/nested.js +2 -1
- package/dist/utils/functions/invoke/resolve-invoke-type.d.ts +2 -2
- package/dist/utils/functions/invoke/resolve-invoke-type.js +2 -2
- package/dist/utils/types.d.ts +20 -13
- package/dist/utils/types.js +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
- package/dist/actions/blueprints/resolve.d.ts +0 -51
- package/dist/actions/blueprints/resolve.js +0 -52
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { env as processEnv } from 'node:process';
|
|
2
|
-
/**
|
|
3
|
-
* Resolve organization, project, and stack IDs from a prioritized set of sources.
|
|
4
|
-
* Precedence: flags > env > module > config.
|
|
5
|
-
* Derives scopeType/scopeId from the resolved IDs (project > organization).
|
|
6
|
-
*
|
|
7
|
-
* Env vars are read from process.env by default (SANITY_ORGANIZATION_ID,
|
|
8
|
-
* SANITY_PROJECT_ID, SANITY_BLUEPRINT_STACK_ID). Pass `env` explicitly to
|
|
9
|
-
* override, or `null` to skip.
|
|
10
|
-
*/
|
|
11
|
-
export function resolveIds(sources = {}) {
|
|
12
|
-
const envValues = sources.env !== undefined
|
|
13
|
-
? sources.env
|
|
14
|
-
: {
|
|
15
|
-
organizationId: processEnv.SANITY_ORGANIZATION_ID,
|
|
16
|
-
projectId: processEnv.SANITY_PROJECT_ID,
|
|
17
|
-
stackId: processEnv.SANITY_BLUEPRINT_STACK_ID,
|
|
18
|
-
};
|
|
19
|
-
const ordered = [
|
|
20
|
-
{ source: 'flags', values: sources.flags },
|
|
21
|
-
{ source: 'env', values: envValues },
|
|
22
|
-
{ source: 'module', values: sources.module },
|
|
23
|
-
{ source: 'config', values: sources.config },
|
|
24
|
-
];
|
|
25
|
-
const result = { sources: {} };
|
|
26
|
-
for (const { source, values } of ordered) {
|
|
27
|
-
if (values === null || values === undefined)
|
|
28
|
-
continue;
|
|
29
|
-
if (!result.organizationId && values.organizationId) {
|
|
30
|
-
result.organizationId = values.organizationId;
|
|
31
|
-
result.sources.organizationId = source;
|
|
32
|
-
}
|
|
33
|
-
if (!result.projectId && values.projectId) {
|
|
34
|
-
result.projectId = values.projectId;
|
|
35
|
-
result.sources.projectId = source;
|
|
36
|
-
}
|
|
37
|
-
if (!result.stackId && values.stackId) {
|
|
38
|
-
result.stackId = values.stackId;
|
|
39
|
-
result.sources.stackId = source;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
// Scope is as specific as possible; project > organization
|
|
43
|
-
if (result.projectId) {
|
|
44
|
-
result.scopeType = 'project';
|
|
45
|
-
result.scopeId = result.projectId;
|
|
46
|
-
}
|
|
47
|
-
else if (result.organizationId) {
|
|
48
|
-
result.scopeType = 'organization';
|
|
49
|
-
result.scopeId = result.organizationId;
|
|
50
|
-
}
|
|
51
|
-
return result;
|
|
52
|
-
}
|