@assemblyline/al-orc 0.3.0 → 0.4.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/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/cli/config-store.js +25 -4
- package/src/cli/index.js +7 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.4.0] - 2026-11-05
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- The config root is `~/.al`, not `~/.assemblyline`. The first run moves the folder and leaves a
|
|
15
|
+
`~/.assemblyline` symlink for tools not yet updated.
|
|
16
|
+
|
|
17
|
+
## [0.3.1] - 2026-10-26
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- `al-orc --version` shows al-orc's own version when installed from npm. It printed the
|
|
21
|
+
version of whatever `package.json` was nearest to the install (`unknown`, or e.g. `1.0.0`),
|
|
22
|
+
because yargs looked it up from the bin link instead of from this package.
|
|
23
|
+
|
|
10
24
|
## [0.3.0] - 2026-10-26
|
|
11
25
|
|
|
12
26
|
### Added
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ printed link on any device). Orgs you already have a profile for show as connect
|
|
|
18
18
|
profile changes only when there was none. To add a key by hand instead:
|
|
19
19
|
`al-orc config profiles add acme --api-key <key> --api-secret <secret>`.
|
|
20
20
|
|
|
21
|
-
Profiles live in `~/.
|
|
21
|
+
Profiles live in `~/.al/al-orc/config.yml` (mode 0600; override the folder with
|
|
22
22
|
`AL_ORC_CONFIG_DIR`). The CLI never reads `.env`.
|
|
23
23
|
|
|
24
24
|
## Library
|
package/package.json
CHANGED
package/src/cli/config-store.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
/**
|
|
3
|
-
* CLI credential store — reads/writes ~/.
|
|
3
|
+
* CLI credential store — reads/writes ~/.al/al-orc/config.yml (mode 0600) and
|
|
4
4
|
* resolves which credentials the current command uses.
|
|
5
5
|
*
|
|
6
|
-
* Config lives under the shared family root ~/.
|
|
6
|
+
* Config lives under the shared family root ~/.al/ so every al-<tool>
|
|
7
7
|
* keeps its config in one place. Path is home-dir based (os.homedir()) for
|
|
8
8
|
* multi-OS support; not XDG. Override the whole dir with AL_ORC_CONFIG_DIR.
|
|
9
9
|
*
|
|
@@ -12,12 +12,33 @@
|
|
|
12
12
|
* `credentials`. Single tool, per-org (no per-app nesting).
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'node:fs';
|
|
15
|
+
import { readFileSync, writeFileSync, mkdirSync, existsSync, renameSync, symlinkSync } from 'node:fs';
|
|
16
16
|
import { homedir } from 'node:os';
|
|
17
17
|
import { join } from 'node:path';
|
|
18
18
|
import yaml from 'js-yaml';
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* The family root, ~/.al. On the first run after the rename from ~/.al
|
|
22
|
+
* the whole folder moves here, keeping a symlink for tools not yet updated.
|
|
23
|
+
* Same move as al-control's familyRoot (its decision 0007).
|
|
24
|
+
* @param {string} [home]
|
|
25
|
+
* @returns {string}
|
|
26
|
+
*/
|
|
27
|
+
export function familyRoot(home = homedir()) {
|
|
28
|
+
const root = join(home, '.al');
|
|
29
|
+
const legacy = join(home, '.assemblyline');
|
|
30
|
+
if (!existsSync(root) && existsSync(legacy)) {
|
|
31
|
+
try {
|
|
32
|
+
renameSync(legacy, root);
|
|
33
|
+
symlinkSync('.al', legacy);
|
|
34
|
+
} catch {
|
|
35
|
+
// Another process moved it first, or the OS refused the symlink.
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return root;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const CONFIG_DIR = process.env.AL_ORC_CONFIG_DIR || join(familyRoot(), 'al-orc');
|
|
21
42
|
const CONFIG_PATH = join(CONFIG_DIR, 'config.yml');
|
|
22
43
|
|
|
23
44
|
let org_override = null;
|
package/src/cli/index.js
CHANGED
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
* al-orc <resource> <action> [target] [options]
|
|
6
6
|
*
|
|
7
7
|
* The orchestrator control plane (canonical line and station definitions, work
|
|
8
|
-
* records, tags, supporting docs). Credentials come from ~/.
|
|
8
|
+
* records, tags, supporting docs). Credentials come from ~/.al/al-orc/config.yml;
|
|
9
9
|
* `config` manages them. (Bins and pm2 live in `al-control`; running a step
|
|
10
10
|
* is lib-factory's `factory` command. Not here.)
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import { readFileSync } from 'node:fs';
|
|
13
14
|
import yargs from 'yargs';
|
|
14
15
|
|
|
15
16
|
import { setOrgOverride } from './config-store.js';
|
|
@@ -25,6 +26,10 @@ import { statusHandler } from './status.js';
|
|
|
25
26
|
import { loginHandler } from './login.js';
|
|
26
27
|
import { DEFAULT_API_URL } from '../http.js';
|
|
27
28
|
|
|
29
|
+
// Read from this package, not found by yargs: an installed `al-orc` runs through a bin link,
|
|
30
|
+
// and the walk up from there never reaches this package.json.
|
|
31
|
+
const { version } = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf8'));
|
|
32
|
+
|
|
28
33
|
export function run(argv) {
|
|
29
34
|
return yargs(argv)
|
|
30
35
|
.scriptName('al-orc')
|
|
@@ -63,7 +68,7 @@ export function run(argv) {
|
|
|
63
68
|
.strict()
|
|
64
69
|
.help()
|
|
65
70
|
.alias('h', 'help')
|
|
66
|
-
.version()
|
|
71
|
+
.version(version)
|
|
67
72
|
.alias('v', 'version')
|
|
68
73
|
// Global options (inherited by every command) render under their own
|
|
69
74
|
// heading; each command's own options stay under "Options:", shown first
|