itiger 0.1.1 → 0.1.4

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 CHANGED
@@ -6,23 +6,42 @@ all work to the locally installed CLIs and never stores or manages credentials.
6
6
  ```bash
7
7
  npx itiger skills add fed/skills
8
8
  npx itiger install -g @tiger/example
9
+ npx itiger app publish -p my-app -d ./dist
10
+ npx itiger app rollback -p my-app -t v1
9
11
  ```
10
12
 
11
13
  `skills add owner/repo` is translated to
12
14
  `https://git.tigerbrokers.net/owner/repo.git`; Git authentication remains under
13
- the user's normal SSH keys or Git credential helper. Other `skills` arguments
14
- and output are passed through unchanged.
15
+ the user's normal SSH keys or Git credential helper. All other `skills`
16
+ commands, arguments, output, and exit codes are passed through unchanged.
15
17
 
16
18
  When installing an `@tiger/*` package, `itiger` adds
17
19
  `--@tiger:registry=http://r.npm.tigerfintech.com` unless `--registry` or an
18
20
  explicit `--@tiger:registry` option is already present. Non-Tiger packages are
19
- delegated without registry changes.
21
+ delegated without registry changes. Other npm commands are delegated with all
22
+ arguments, output, and exit codes unchanged.
20
23
 
21
24
  Requirements: Node.js 18 or newer, plus npm for package installation. For
22
25
  `skills` commands, the locally installed `skills` CLI is used when available;
23
26
  otherwise `npx --yes skills` downloads and runs the public CLI without
24
27
  persisting credentials or changing the user's global installation.
25
28
 
29
+ ## App publishing
30
+
31
+ `itiger app ...` runs the private `@tiger/oss-publish` CLI through `npx`, using
32
+ the Tiger scope registry. It does not whitelist or reinterpret commands: every
33
+ argument after `app` is forwarded unchanged. Therefore it supports all current
34
+ and future `oss-publish` commands and options, including the default publish
35
+ form, `access` subcommands, and any `--`-separated arguments:
36
+
37
+ ```bash
38
+ npx itiger app -p my-app -d ./dist
39
+ npx itiger app publish -p my-app -d ./dist
40
+ npx itiger app rollback -p my-app -t v1
41
+ npx itiger app history -p my-app --json
42
+ npx itiger app access add -p my-app -m teammate
43
+ ```
44
+
26
45
  ## Development
27
46
 
28
47
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itiger",
3
- "version": "0.1.1",
3
+ "version": "0.1.4",
4
4
  "description": "A thin adapter for internal skills and @tiger npm packages.",
5
5
  "type": "commonjs",
6
6
  "bin": {
@@ -0,0 +1,19 @@
1
+ const { runCommand } = require('./process');
2
+ const { TIGER_REGISTRY } = require('./npm-adapter');
3
+
4
+ const OSS_PUBLISH_PACKAGE = '@tiger/oss-publish';
5
+
6
+ function transformArgs(args) {
7
+ return [
8
+ '--yes',
9
+ `--@tiger:registry=${TIGER_REGISTRY}`,
10
+ OSS_PUBLISH_PACKAGE,
11
+ ...args,
12
+ ];
13
+ }
14
+
15
+ function runApp(args) {
16
+ return runCommand('npx', transformArgs(args));
17
+ }
18
+
19
+ module.exports = { OSS_PUBLISH_PACKAGE, transformArgs, runApp };
package/src/cli.js CHANGED
@@ -2,18 +2,23 @@
2
2
 
3
3
  const { runSkills } = require('./skills-adapter');
4
4
  const { runNpm } = require('./npm-adapter');
5
+ const { runApp } = require('./app-adapter');
5
6
 
6
7
  async function main() {
7
8
  const args = process.argv.slice(2);
8
9
  if (args[0] === 'skills') {
9
10
  return runSkills(args.slice(1));
10
11
  }
11
- if (args[0] === 'install' || args[0] === 'i') {
12
+ if (args[0] === 'app') {
13
+ return runApp(args.slice(1));
14
+ }
15
+ if (args.length > 0) {
12
16
  return runNpm(args);
13
17
  }
14
18
 
15
- process.stderr.write('Usage: itiger skills add <owner/repo> [skills options...]\n');
16
- process.stderr.write(' itiger install [npm options...] <package...>\n');
19
+ process.stderr.write('Usage: itiger skills <skills command> [skills options...]\n');
20
+ process.stderr.write(' itiger app [oss-publish command] [app options...]\n');
21
+ process.stderr.write(' itiger <npm command> [npm options...]\n');
17
22
  return 2;
18
23
  }
19
24
 
@@ -16,6 +16,7 @@ function hasTigerPackage(args) {
16
16
  }
17
17
 
18
18
  function transformArgs(args) {
19
+ if (args[0] !== 'install' && args[0] !== 'i') return [...args];
19
20
  if (!hasTigerPackage(args) || hasExplicitRegistry(args)) return [...args];
20
21
  return [...args, `--@tiger:registry=${TIGER_REGISTRY}`];
21
22
  }
@@ -28,10 +28,6 @@ function transformArgs(args) {
28
28
  }
29
29
 
30
30
  function runSkills(args) {
31
- if (args.length === 0 || args[0] !== 'add') {
32
- process.stderr.write('itiger: only "skills add" is supported through this adapter\n');
33
- return Promise.resolve(2);
34
- }
35
31
  const transformedArgs = transformArgs(args);
36
32
  return runCommand('skills', transformedArgs, {
37
33
  command: 'npx',