@sdlcai/setup 1.0.0 → 1.1.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 +3 -0
- package/bin/cli.mjs +17 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,6 +30,9 @@ security boundary remains each private package's own access control.
|
|
|
30
30
|
|---|---|
|
|
31
31
|
| `ava-custom-agents` (alias `ava-agents`) | `@avanade-region-iceg/ava-agents install` |
|
|
32
32
|
| `mnemo` | `@avanade-region-iceg/mnemo-setup` |
|
|
33
|
+
| `gh-mnemo` | `@avanade-region-iceg/gh-mnemo` |
|
|
34
|
+
| `ba-agents` | `@fsabatini82/ba-agents install` |
|
|
35
|
+
| `meet2spec` | `@avanade-region-iceg/meet2spec` |
|
|
33
36
|
|
|
34
37
|
Everything after the asset name is passed through to its installer (use `--` to separate).
|
|
35
38
|
Add a new asset by adding one line to `ASSETS` in `bin/cli.mjs`.
|
package/bin/cli.mjs
CHANGED
|
@@ -13,17 +13,19 @@ import { readFileSync, writeFileSync, existsSync } from 'node:fs';
|
|
|
13
13
|
import { homedir } from 'node:os';
|
|
14
14
|
import { join } from 'node:path';
|
|
15
15
|
|
|
16
|
-
const ORG = 'Avanade-Region-ICEG'; // membership gate
|
|
17
|
-
const REGISTRY = 'https://npm.pkg.github.com'; // where
|
|
18
|
-
const
|
|
16
|
+
const ORG = 'Avanade-Region-ICEG'; // membership gate (Avanade assets only)
|
|
17
|
+
const REGISTRY = 'https://npm.pkg.github.com'; // where all assets live
|
|
18
|
+
const DEFAULT_SCOPE = '@avanade-region-iceg';
|
|
19
19
|
|
|
20
|
-
// asset name ->
|
|
20
|
+
// asset name -> installer package + args; gated:false skips the Avanade org check
|
|
21
21
|
const ASSETS = {
|
|
22
22
|
'ava-custom-agents': { pkg: '@avanade-region-iceg/ava-agents', args: ['install'], label: 'AVA custom agents' },
|
|
23
23
|
'ava-agents': { pkg: '@avanade-region-iceg/ava-agents', args: ['install'], label: 'AVA custom agents' },
|
|
24
24
|
'mnemo': { pkg: '@avanade-region-iceg/mnemo-setup', args: [], label: 'mnemo (AVA memory)' },
|
|
25
25
|
'ava-mem': { pkg: '@avanade-region-iceg/mnemo-setup', args: [], label: 'mnemo (AVA memory)' },
|
|
26
26
|
'gh-mnemo': { pkg: '@avanade-region-iceg/gh-mnemo', args: [], label: 'mnemo gh extension' },
|
|
27
|
+
'ba-agents': { pkg: '@fsabatini82/ba-agents', scope: '@fsabatini82', args: ['install'], label: 'BA Expert agents', gated: false },
|
|
28
|
+
'meet2spec': { pkg: '@avanade-region-iceg/meet2spec', args: [], label: 'meet2spec (meeting recorder)' },
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
const WIN = process.platform === 'win32';
|
|
@@ -75,14 +77,15 @@ function gateOrg() {
|
|
|
75
77
|
info(`✓ Access to ${ORG} confirmed.`);
|
|
76
78
|
}
|
|
77
79
|
|
|
78
|
-
function configureNpmAuth(token) {
|
|
80
|
+
function configureNpmAuth(token, scope = DEFAULT_SCOPE) {
|
|
79
81
|
const rc = join(homedir(), '.npmrc');
|
|
80
82
|
let lines = existsSync(rc) ? readFileSync(rc, 'utf8').split(/\r?\n/) : [];
|
|
81
|
-
|
|
82
|
-
lines.
|
|
83
|
+
// Remove stale entries for this scope and the shared token line; re-add below.
|
|
84
|
+
lines = lines.filter((l) => !l.startsWith(`${scope}:registry=`) && !l.includes('//npm.pkg.github.com/:_authToken='));
|
|
85
|
+
lines.push(`${scope}:registry=${REGISTRY}`);
|
|
83
86
|
lines.push(`//npm.pkg.github.com/:_authToken=${token}`);
|
|
84
87
|
writeFileSync(rc, lines.filter(Boolean).join('\n') + '\n');
|
|
85
|
-
info(`✓ Configured GitHub Packages auth (${rc}).`);
|
|
88
|
+
info(`✓ Configured GitHub Packages auth for ${scope} (${rc}).`);
|
|
86
89
|
}
|
|
87
90
|
|
|
88
91
|
function help(exit) {
|
|
@@ -102,7 +105,8 @@ configures GitHub Packages auth, then runs the asset's installer.
|
|
|
102
105
|
Examples:
|
|
103
106
|
sdlcai ava-custom-agents
|
|
104
107
|
sdlcai mnemo -- --local --scope user --project acme --yes
|
|
105
|
-
sdlcai gh-mnemo
|
|
108
|
+
sdlcai gh-mnemo
|
|
109
|
+
sdlcai meet2spec`);
|
|
106
110
|
process.exit(exit);
|
|
107
111
|
}
|
|
108
112
|
|
|
@@ -123,10 +127,12 @@ function main() {
|
|
|
123
127
|
const rest = argv.slice(1);
|
|
124
128
|
const passthrough = rest[0] === '--' ? rest.slice(1) : rest;
|
|
125
129
|
|
|
130
|
+
const scope = target.scope || DEFAULT_SCOPE;
|
|
131
|
+
|
|
126
132
|
ensureGh();
|
|
127
133
|
const token = ensureAuth();
|
|
128
|
-
gateOrg();
|
|
129
|
-
configureNpmAuth(token);
|
|
134
|
+
if (target.gated !== false) gateOrg();
|
|
135
|
+
configureNpmAuth(token, scope);
|
|
130
136
|
|
|
131
137
|
info(`\n→ Installing ${target.label} (${target.pkg})…\n`);
|
|
132
138
|
// Install to a known dir then invoke the bin file directly with node.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdlcai/setup",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "One-command bootstrap for private Avanade dev-tool assets (AVA agents, mnemo, …): GitHub browser login + Avanade-Region-ICEG access gate + install.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|