@sequenceholdings/artifact-studio 0.1.10 → 0.1.12
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/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import { existsSync } from 'node:fs';
|
|
|
3
3
|
import { dirname, join, relative, resolve } from 'node:path';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { getJson, getJsonOr404, postJson } from './api.js';
|
|
6
|
-
import { readLocalConfig, resolveEnvironment, writeLocalConfig, writeTokenConfig, } from './config.js';
|
|
6
|
+
import { ENV_URLS, readLocalConfig, resolveEnvironment, writeLocalConfig, writeTokenConfig, } from './config.js';
|
|
7
7
|
import { buildArtifactStudioProject, writeBuildArtifact } from './build.js';
|
|
8
8
|
import { buildArtifactStudioProjectIsolated } from './build-subprocess.js';
|
|
9
9
|
import { prepareArtifactBuildRoot } from './prepare-build.js';
|
|
@@ -116,7 +116,7 @@ async function initCommand(args) {
|
|
|
116
116
|
await replaceInFile(join(dir, 'artifact.bundle.yml'), /\{\{title\}\}/g, titleize(slug));
|
|
117
117
|
await replaceInFile(join(dir, 'package.json'), /\{\{slug\}\}/g, slug);
|
|
118
118
|
console.log(`[seq-studio] initialized ${dir}`);
|
|
119
|
-
console.log('Next: seq-studio login && seq-studio artifact dev --env
|
|
119
|
+
console.log('Next: seq-studio login && seq-studio artifact dev --env <env> (see: seq-studio envs list)');
|
|
120
120
|
return 0;
|
|
121
121
|
}
|
|
122
122
|
async function loginCommand(args) {
|
|
@@ -204,7 +204,9 @@ async function linkCommand(args) {
|
|
|
204
204
|
async function envCommand(args) {
|
|
205
205
|
const [subcommand, value] = args.positional;
|
|
206
206
|
if (subcommand === 'list') {
|
|
207
|
-
|
|
207
|
+
for (const name of Object.keys(ENV_URLS))
|
|
208
|
+
console.log(name);
|
|
209
|
+
console.log('(deployed environments are discovered per-identity — run: seq-studio envs list)');
|
|
208
210
|
return 0;
|
|
209
211
|
}
|
|
210
212
|
if (subcommand === 'use') {
|
|
@@ -229,7 +231,7 @@ async function statusCommand(args) {
|
|
|
229
231
|
if (env.name === 'local') {
|
|
230
232
|
await fetch(`${env.url}/api/health`)
|
|
231
233
|
.then((response) => console.log(`local Atlas: ${response.ok ? 'ready' : `HTTP ${response.status}`}`))
|
|
232
|
-
.catch(() => console.log('local Atlas: not reachable (start Atlas on port 5001 or pass --env
|
|
234
|
+
.catch(() => console.log('local Atlas: not reachable (start Atlas on port 5001 or pass --env <env>)'));
|
|
233
235
|
}
|
|
234
236
|
return 0;
|
|
235
237
|
}
|
package/dist/config.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Only `local` ships in the published package. Deployed-environment URLs
|
|
3
|
+
* are resolved by the embedding CLI (seq-studio), which discovers the
|
|
4
|
+
* environments visible to the caller's identity and injects the resolved
|
|
5
|
+
* URL via ARTIFACT_STUDIO_BASE_URL (see resolveEnvironment below).
|
|
6
|
+
*/
|
|
1
7
|
export declare const ENV_URLS: Record<string, string>;
|
|
2
8
|
export interface LocalProjectConfig {
|
|
3
9
|
projectId?: string;
|
|
@@ -18,6 +24,7 @@ export declare function readLocalConfig(cwd?: string): Promise<LocalProjectConfi
|
|
|
18
24
|
export declare function writeLocalConfig(config: LocalProjectConfig, cwd?: string): Promise<void>;
|
|
19
25
|
export declare function readTokenConfig(): Promise<TokenConfig>;
|
|
20
26
|
export declare function writeTokenConfig(config: TokenConfig): Promise<void>;
|
|
27
|
+
export declare function knownEnvUrls(): Record<string, string>;
|
|
21
28
|
export declare function resolveEnvironment(name: string | undefined, fallback?: string): {
|
|
22
29
|
name: string;
|
|
23
30
|
url: string;
|
package/dist/config.js
CHANGED
|
@@ -2,11 +2,14 @@ import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
3
|
import { dirname, join, resolve } from 'node:path';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
|
+
/**
|
|
6
|
+
* Only `local` ships in the published package. Deployed-environment URLs
|
|
7
|
+
* are resolved by the embedding CLI (seq-studio), which discovers the
|
|
8
|
+
* environments visible to the caller's identity and injects the resolved
|
|
9
|
+
* URL via ARTIFACT_STUDIO_BASE_URL (see resolveEnvironment below).
|
|
10
|
+
*/
|
|
5
11
|
export const ENV_URLS = {
|
|
6
12
|
local: 'http://localhost:5001',
|
|
7
|
-
staging: 'https://staging.atlas.seqholdings.com',
|
|
8
|
-
production: 'https://atlas.seqholdings.com',
|
|
9
|
-
banksouth: 'https://banksouth.seqholdings.com',
|
|
10
13
|
};
|
|
11
14
|
export function globalConfigDir() {
|
|
12
15
|
return join(homedir(), '.config', 'sequence-artifact-studio');
|
|
@@ -42,6 +45,35 @@ export async function writeTokenConfig(config) {
|
|
|
42
45
|
await mkdir(dirname(path), { recursive: true });
|
|
43
46
|
await writeFile(path, JSON.stringify(config, null, 2) + '\n', { encoding: 'utf8', mode: 0o600 });
|
|
44
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Environment map injected by the embedding CLI (seq-studio sets
|
|
50
|
+
* ARTIFACT_STUDIO_ENV_URLS to the JSON name→url map of environments visible
|
|
51
|
+
* to the caller's identity). Lets commands that resolve an env *name* without
|
|
52
|
+
* an explicit --env flag — the stored `defaultEnv`, `artifact env set` —
|
|
53
|
+
* reach deployed environments, not just the built-in `local`.
|
|
54
|
+
*/
|
|
55
|
+
function embedderEnvUrls() {
|
|
56
|
+
const raw = process.env['ARTIFACT_STUDIO_ENV_URLS']?.trim();
|
|
57
|
+
if (!raw)
|
|
58
|
+
return {};
|
|
59
|
+
try {
|
|
60
|
+
const parsed = JSON.parse(raw);
|
|
61
|
+
if (typeof parsed !== 'object' || parsed === null)
|
|
62
|
+
return {};
|
|
63
|
+
const out = {};
|
|
64
|
+
for (const [name, url] of Object.entries(parsed)) {
|
|
65
|
+
if (typeof url === 'string' && url)
|
|
66
|
+
out[name] = url;
|
|
67
|
+
}
|
|
68
|
+
return out;
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return {};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export function knownEnvUrls() {
|
|
75
|
+
return { ...ENV_URLS, ...embedderEnvUrls() };
|
|
76
|
+
}
|
|
45
77
|
export function resolveEnvironment(name, fallback) {
|
|
46
78
|
const envName = name ?? fallback;
|
|
47
79
|
// Allow `seq-studio artifact` (and any other embedder that wants to
|
|
@@ -52,11 +84,18 @@ export function resolveEnvironment(name, fallback) {
|
|
|
52
84
|
const overrideUrl = process.env['ARTIFACT_STUDIO_BASE_URL']?.trim() || undefined;
|
|
53
85
|
if (overrideUrl) {
|
|
54
86
|
if (!envName)
|
|
55
|
-
throw new Error(
|
|
87
|
+
throw new Error(unknownEnvMessage(envName));
|
|
56
88
|
return { name: envName, url: overrideUrl };
|
|
57
89
|
}
|
|
58
|
-
const
|
|
90
|
+
const envUrls = knownEnvUrls();
|
|
91
|
+
const url = envName ? envUrls[envName] : undefined;
|
|
59
92
|
if (!envName || !url)
|
|
60
|
-
throw new Error(
|
|
93
|
+
throw new Error(unknownEnvMessage(envName));
|
|
61
94
|
return { name: envName, url };
|
|
62
95
|
}
|
|
96
|
+
function unknownEnvMessage(envName) {
|
|
97
|
+
const known = Object.keys(knownEnvUrls()).join(', ');
|
|
98
|
+
return (`--env ${envName ? `"${envName}" is not available here` : 'is required'} ` +
|
|
99
|
+
`(known: ${known}). Deployed environments are resolved through ` +
|
|
100
|
+
`seq-studio (run: seq-studio envs list), or set ARTIFACT_STUDIO_BASE_URL.`);
|
|
101
|
+
}
|
|
@@ -24,7 +24,9 @@ capabilities:
|
|
|
24
24
|
functions:
|
|
25
25
|
invoke: []
|
|
26
26
|
|
|
27
|
+
# Point each target at an Atlas deployment you can access.
|
|
28
|
+
# Run `seq-studio envs list` to see the environments visible to your identity.
|
|
27
29
|
targets:
|
|
28
|
-
|
|
29
|
-
url:
|
|
30
|
+
local:
|
|
31
|
+
url: http://localhost:5001
|
|
30
32
|
visibility: private
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"access": "public"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.1.
|
|
12
|
+
"version": "0.1.12",
|
|
13
13
|
"description": "SDK types and CLI library for building Artifact Studio apps. Driven via `seq-studio artifact <sub>` (@sequenceholdings/studio-cli), which runs the `./cli` runCli export.",
|
|
14
14
|
"type": "module",
|
|
15
15
|
"exports": {
|
|
@@ -32,6 +32,22 @@
|
|
|
32
32
|
"./git-clone": {
|
|
33
33
|
"types": "./dist/git-clone.d.ts",
|
|
34
34
|
"default": "./dist/git-clone.js"
|
|
35
|
+
},
|
|
36
|
+
"./prepare-build": {
|
|
37
|
+
"types": "./dist/prepare-build.d.ts",
|
|
38
|
+
"default": "./dist/prepare-build.js"
|
|
39
|
+
},
|
|
40
|
+
"./sanitize-remote-tree": {
|
|
41
|
+
"types": "./dist/sanitize-remote-tree.d.ts",
|
|
42
|
+
"default": "./dist/sanitize-remote-tree.js"
|
|
43
|
+
},
|
|
44
|
+
"./lockfile-origin": {
|
|
45
|
+
"types": "./dist/lockfile-origin.d.ts",
|
|
46
|
+
"default": "./dist/lockfile-origin.js"
|
|
47
|
+
},
|
|
48
|
+
"./trusted-install": {
|
|
49
|
+
"types": "./dist/trusted-install.d.ts",
|
|
50
|
+
"default": "./dist/trusted-install.js"
|
|
35
51
|
}
|
|
36
52
|
},
|
|
37
53
|
"files": [
|
|
@@ -51,8 +67,8 @@
|
|
|
51
67
|
"tw-animate-css": "^1.4.0",
|
|
52
68
|
"vite": "8.0.16",
|
|
53
69
|
"zod": "^4.1.13",
|
|
54
|
-
"@sequenceholdings/
|
|
55
|
-
"@sequenceholdings/
|
|
70
|
+
"@sequenceholdings/atlas-ui": "0.1.3",
|
|
71
|
+
"@sequenceholdings/lattice-form-renderer": "0.1.0"
|
|
56
72
|
},
|
|
57
73
|
"devDependencies": {
|
|
58
74
|
"@types/js-yaml": "^4.0.9",
|
|
@@ -24,7 +24,9 @@ capabilities:
|
|
|
24
24
|
functions:
|
|
25
25
|
invoke: []
|
|
26
26
|
|
|
27
|
+
# Point each target at an Atlas deployment you can access.
|
|
28
|
+
# Run `seq-studio envs list` to see the environments visible to your identity.
|
|
27
29
|
targets:
|
|
28
|
-
|
|
29
|
-
url:
|
|
30
|
+
local:
|
|
31
|
+
url: http://localhost:5001
|
|
30
32
|
visibility: private
|