@norrix/cli 0.0.21 → 0.0.25
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 +102 -0
- package/dist/cli.js +36 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/amplify-config.d.ts +14 -1
- package/dist/lib/amplify-config.js +82 -53
- package/dist/lib/amplify-config.js.map +1 -1
- package/dist/lib/commands.d.ts +40 -2
- package/dist/lib/commands.js +636 -95
- package/dist/lib/commands.js.map +1 -1
- package/dist/lib/config-helpers.spec.d.ts +1 -0
- package/dist/lib/config.d.ts +147 -0
- package/dist/lib/config.js +210 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/defaults.d.ts +14 -0
- package/dist/lib/defaults.js +9 -0
- package/dist/lib/defaults.js.map +1 -0
- package/dist/lib/dev-defaults.d.ts +7 -0
- package/dist/lib/dev-defaults.js +18 -0
- package/dist/lib/dev-defaults.js.map +1 -0
- package/dist/lib/fingerprinting.d.ts +8 -0
- package/dist/lib/fingerprinting.js +4 -1
- package/dist/lib/fingerprinting.js.map +1 -1
- package/dist/lib/prod-defaults.d.ts +8 -0
- package/dist/lib/prod-defaults.js +13 -0
- package/dist/lib/prod-defaults.js.map +1 -0
- package/dist/lib/workspace.d.ts +121 -0
- package/dist/lib/workspace.js +472 -0
- package/dist/lib/workspace.js.map +1 -0
- package/package.json +2 -3
- package/.env.local +0 -9
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
## 0.0.24 (2025-12-28)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **cli:** pass verbose flag usage to cloud commands ([c22a326](https://github.com/norrixnet/norrix/commit/c22a326))
|
|
6
|
+
- **cli:** distribution type for appstore, adhoc and enterprise ([0ef7f14](https://github.com/norrixnet/norrix/commit/0ef7f14))
|
|
7
|
+
- **norrix-cli:** add prod/dev profiles via --env/--dev ([94779f7](https://github.com/norrixnet/norrix/commit/94779f7))
|
|
8
|
+
- **norrix-cli:** add prod/dev profiles via --env/--dev ([a56e612](https://github.com/norrixnet/norrix/commit/a56e612))
|
|
9
|
+
- **next-app,norrix-cli,workflows:** expose norrixEnv routing info ([7d321e0](https://github.com/norrixnet/norrix/commit/7d321e0))
|
|
10
|
+
- **workflows,norrix-cli,next-app:** split dev/prod execution context and harden CLI env loading ([0cbf369](https://github.com/norrixnet/norrix/commit/0cbf369))
|
|
11
|
+
- **cli:** improve success output ([5e63a08](https://github.com/norrixnet/norrix/commit/5e63a08))
|
|
12
|
+
- **cli:** improve success output to include version/build ([df6c98e](https://github.com/norrixnet/norrix/commit/df6c98e))
|
|
13
|
+
- **cli:** fingerprint handling ([e8c8a81](https://github.com/norrixnet/norrix/commit/e8c8a81))
|
|
14
|
+
|
|
15
|
+
### ❤️ Thank You
|
|
16
|
+
|
|
17
|
+
- Nathan Walker
|
|
18
|
+
- Owen Carey @owenthcarey
|
|
19
|
+
|
|
20
|
+
## 0.0.21 (2025-12-18)
|
|
21
|
+
|
|
22
|
+
### 🚀 Features
|
|
23
|
+
|
|
24
|
+
- **cli:** improve success output ([81b870b](https://github.com/norrixnet/norrix/commit/81b870b))
|
|
25
|
+
- **cli:** improve success output to include version/build ([22448a3](https://github.com/norrixnet/norrix/commit/22448a3))
|
|
26
|
+
- **cli:** fingerprint handling ([15297b0](https://github.com/norrixnet/norrix/commit/15297b0))
|
|
27
|
+
|
|
28
|
+
### ❤️ Thank You
|
|
29
|
+
|
|
30
|
+
- Nathan Walker
|
|
31
|
+
|
|
32
|
+
## 0.0.17 (2025-12-09)
|
|
33
|
+
|
|
34
|
+
### 🚀 Features
|
|
35
|
+
|
|
36
|
+
- **cli:** fingerprint improvements and better error handling ([1dba307](https://github.com/norrixnet/norrix/commit/1dba307))
|
|
37
|
+
|
|
38
|
+
### ❤️ Thank You
|
|
39
|
+
|
|
40
|
+
- Nathan Walker
|
|
41
|
+
|
|
42
|
+
## 0.0.12 (2025-12-08)
|
|
43
|
+
|
|
44
|
+
### 🩹 Fixes
|
|
45
|
+
|
|
46
|
+
- **cli:** allow version to be inferred during update ([7616e6c](https://github.com/norrixnet/norrix/commit/7616e6c))
|
|
47
|
+
|
|
48
|
+
### ❤️ Thank You
|
|
49
|
+
|
|
50
|
+
- Nathan Walker
|
|
51
|
+
|
|
52
|
+
## 0.0.10 (2025-12-08)
|
|
53
|
+
|
|
54
|
+
### 🚀 Features
|
|
55
|
+
|
|
56
|
+
- **cli:** allow subcommands for fast action without user prompts ([0e32d3e](https://github.com/norrixnet/norrix/commit/0e32d3e))
|
|
57
|
+
|
|
58
|
+
### ❤️ Thank You
|
|
59
|
+
|
|
60
|
+
- Nathan Walker
|
|
61
|
+
|
|
62
|
+
## 0.0.8 (2025-12-08)
|
|
63
|
+
|
|
64
|
+
### 🚀 Features
|
|
65
|
+
|
|
66
|
+
- fingerprint commands ([e967cad](https://github.com/norrixnet/norrix/commit/e967cad))
|
|
67
|
+
- fingerprinting ([e23579a](https://github.com/norrixnet/norrix/commit/e23579a))
|
|
68
|
+
- **cli:** platform prompt, auto id parsing, flow improvements ([#36](https://github.com/norrixnet/norrix/pull/36))
|
|
69
|
+
- **cli:** user input validation on version and build num ([cb86939](https://github.com/norrixnet/norrix/commit/cb86939))
|
|
70
|
+
- **cli:** prompt for android build number and adjust prompt order ([cebbae4](https://github.com/norrixnet/norrix/commit/cebbae4))
|
|
71
|
+
- **cli:** version handling ([5d3b0d1](https://github.com/norrixnet/norrix/commit/5d3b0d1))
|
|
72
|
+
- **workflows,norrix-cli:** support Apple Team ID for iOS auto-provision ([db15216](https://github.com/norrixnet/norrix/commit/db15216))
|
|
73
|
+
- **cli:** login & logout aliases ([e74ee07](https://github.com/norrixnet/norrix/commit/e74ee07))
|
|
74
|
+
- secure plumbing for release signing credentials to WarpBuild ([7ef66e3](https://github.com/norrixnet/norrix/commit/7ef66e3))
|
|
75
|
+
- update CLI build to use WarpBuild ([74f4959](https://github.com/norrixnet/norrix/commit/74f4959))
|
|
76
|
+
- update CLI Amplify storage config and Amplify storage bucket ([a996a54](https://github.com/norrixnet/norrix/commit/a996a54))
|
|
77
|
+
- update CLI auth ([b4adb62](https://github.com/norrixnet/norrix/commit/b4adb62))
|
|
78
|
+
- add CLI auth ([d53cf46](https://github.com/norrixnet/norrix/commit/d53cf46))
|
|
79
|
+
|
|
80
|
+
### 🩹 Fixes
|
|
81
|
+
|
|
82
|
+
- **norrix-cli:** shim global crypto for amplify auth in node ([147d6e1](https://github.com/norrixnet/norrix/commit/147d6e1))
|
|
83
|
+
- **cli:** remove deprecated uploadData in favor of direct s3 handling ([ef60453](https://github.com/norrixnet/norrix/commit/ef60453))
|
|
84
|
+
- **cli:** appPath detection for what folder to zip ([eeb977b](https://github.com/norrixnet/norrix/commit/eeb977b))
|
|
85
|
+
- **cli:** normalize file paths and names ([0cd074a](https://github.com/norrixnet/norrix/commit/0cd074a))
|
|
86
|
+
- **norrix-cli:** close axios.post headers config in build command ([ccdfc05](https://github.com/norrixnet/norrix/commit/ccdfc05))
|
|
87
|
+
|
|
88
|
+
### ❤️ Thank You
|
|
89
|
+
|
|
90
|
+
- Nathan Walker
|
|
91
|
+
- Owen Carey @owenthcarey
|
|
92
|
+
|
|
93
|
+
## 0.0.7 (2025-12-03)
|
|
94
|
+
|
|
95
|
+
### 🚀 Features
|
|
96
|
+
|
|
97
|
+
- **cli:** improved ux prompts ([3fcca7c](https://github.com/norrixnet/norrix/commit/3fcca7c))
|
|
98
|
+
|
|
99
|
+
### ❤️ Thank You
|
|
100
|
+
|
|
101
|
+
- Nathan Walker
|
|
102
|
+
- Owen Carey
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,8 @@ import { Command } from 'commander';
|
|
|
3
3
|
import { readFileSync } from 'fs';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import path from 'path';
|
|
6
|
-
import { build, submit, update, buildStatus, submitStatus, updateStatus, signIn, signOut, uploadFile, currentUser, billingCheckout, billingPortal, printFingerprint, compareFingerprint, } from './lib/commands.js';
|
|
6
|
+
import { build, submit, update, buildStatus, submitStatus, updateStatus, initNorrixCli, signIn, signOut, uploadFile, currentUser, billingCheckout, billingPortal, printFingerprint, compareFingerprint, } from './lib/commands.js';
|
|
7
|
+
import { assertNorrixCliEnv } from './lib/defaults.js';
|
|
7
8
|
/**
|
|
8
9
|
* Norrix CLI
|
|
9
10
|
*
|
|
@@ -33,19 +34,41 @@ program
|
|
|
33
34
|
.name('norrix')
|
|
34
35
|
.description('Norrix CLI - NativeScript build and deployment tool')
|
|
35
36
|
.version(pkgVersion)
|
|
36
|
-
.option('--verbose', 'Enable verbose error output (stack traces)')
|
|
37
|
+
.option('--verbose', 'Enable verbose error output (stack traces)')
|
|
38
|
+
.option('--env <env>', 'Target Norrix environment (prod or dev)', 'prod')
|
|
39
|
+
.option('--dev', 'Shortcut for --env dev');
|
|
37
40
|
// Ensure the global verbose flag is set before any command action runs
|
|
38
41
|
// so that all commands receive the correct "verbose" boolean.
|
|
39
42
|
program.hook('preAction', (thisCommand) => {
|
|
40
43
|
const opts = thisCommand.opts();
|
|
41
44
|
isVerbose = Boolean(opts.verbose);
|
|
45
|
+
// Environment routing:
|
|
46
|
+
// - Default: prod
|
|
47
|
+
// - --dev forces dev
|
|
48
|
+
// - --env validates to dev|prod
|
|
49
|
+
const selectedEnv = opts.dev
|
|
50
|
+
? 'dev'
|
|
51
|
+
: assertNorrixCliEnv(opts.env);
|
|
52
|
+
initNorrixCli(selectedEnv);
|
|
42
53
|
});
|
|
43
54
|
program
|
|
44
55
|
.command('build')
|
|
45
56
|
.description('Build your NativeScript app')
|
|
46
57
|
.argument('[platform]', 'Target platform (android, ios or visionos)')
|
|
47
58
|
.argument('[configuration]', 'Build configuration (debug or release)')
|
|
48
|
-
.
|
|
59
|
+
.argument('[distribution]', 'iOS distribution type for release builds (appstore, adhoc, or enterprise)')
|
|
60
|
+
.option('-p, --project <name>', 'Nx project name (for workspace builds from root)')
|
|
61
|
+
.option('-t, --team-id <id>', 'Apple Developer Team ID (for iOS signing)')
|
|
62
|
+
.option('-v, --version <version>', 'App version (e.g., 1.0.0)')
|
|
63
|
+
.option('-b, --build-number <number>', 'Build number')
|
|
64
|
+
.option('-n, --non-interactive', 'Run without prompts (use defaults/config file)')
|
|
65
|
+
.action((platform, configuration, distribution, options) => build(platform, configuration, distribution, isVerbose, {
|
|
66
|
+
project: options?.project,
|
|
67
|
+
teamId: options?.teamId,
|
|
68
|
+
version: options?.version,
|
|
69
|
+
buildNumber: options?.buildNumber,
|
|
70
|
+
nonInteractive: options?.nonInteractive,
|
|
71
|
+
}));
|
|
49
72
|
program
|
|
50
73
|
.command('build-status')
|
|
51
74
|
.description('Check the status of a build')
|
|
@@ -67,7 +90,16 @@ program
|
|
|
67
90
|
.description('Publish over-the-air updates to deployed apps')
|
|
68
91
|
.argument('[platform]', 'Target platform (android, ios or visionos)')
|
|
69
92
|
.argument('[version]', 'Update version (e.g. 2.0.0)')
|
|
70
|
-
.
|
|
93
|
+
.option('-p, --project <name>', 'Nx project name (for workspace builds from root)')
|
|
94
|
+
.option('-a, --app-id <id>', 'App identifier (bundle ID)')
|
|
95
|
+
.option('-b, --build-number <number>', 'Build number')
|
|
96
|
+
.option('-n, --non-interactive', 'Run without prompts (use defaults/config file)')
|
|
97
|
+
.action((platform, version, options) => update(platform, version, isVerbose, {
|
|
98
|
+
project: options?.project,
|
|
99
|
+
appId: options?.appId,
|
|
100
|
+
buildNumber: options?.buildNumber,
|
|
101
|
+
nonInteractive: options?.nonInteractive,
|
|
102
|
+
}));
|
|
71
103
|
program
|
|
72
104
|
.command('update-status')
|
|
73
105
|
.description('Check the status of an update')
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,E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SAAS,CAAC,CAAC,CAAC;AAExC,mBAAmB;AACnB,OAAO;KACJ,OAAO,CAAC,kBAAkB,CAAC;KAC3B,WAAW,CAAC,mDAAmD,CAAC;KAChE,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;KACxC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AAE5D,OAAO;KACJ,OAAO,CAAC,gBAAgB,CAAC;KACzB,WAAW,CAAC,yDAAyD,CAAC;KACtE,MAAM,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC;AAC1C,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC"}
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import type { NorrixCliEnv } from './defaults.js';
|
|
2
|
+
/**
|
|
3
|
+
* Load environment variables for the CLI.
|
|
4
|
+
*
|
|
5
|
+
* IMPORTANT: We intentionally DO NOT read `.env` / `.env.local` from `process.cwd()`.
|
|
6
|
+
* The CLI is often run inside customer NativeScript repos, and we must not accidentally
|
|
7
|
+
* inherit their local env files.
|
|
8
|
+
*
|
|
9
|
+
* Final precedence:
|
|
10
|
+
* - Explicit process env vars always win (dotenv does not overwrite by default unless override=true).
|
|
11
|
+
* - Selected in-code defaults (dev/prod) are the ultimate fallback.
|
|
12
|
+
*/
|
|
13
|
+
export declare function loadCliEnvFiles(env: NorrixCliEnv): void;
|
|
14
|
+
export declare function configureAmplify(env?: NorrixCliEnv): void;
|
|
@@ -5,25 +5,46 @@ import { fileURLToPath } from 'url';
|
|
|
5
5
|
import { cognitoUserPoolsTokenProvider } from 'aws-amplify/auth/cognito';
|
|
6
6
|
import os from 'os';
|
|
7
7
|
import crypto from 'crypto';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
dotenvConfig();
|
|
11
|
-
// 2. If .env.local exists, load it and override existing variables
|
|
12
|
-
const envLocalPath = path.resolve(process.cwd(), '.env.local');
|
|
13
|
-
if (fs.existsSync(envLocalPath)) {
|
|
14
|
-
dotenvConfig({ path: envLocalPath, override: true });
|
|
15
|
-
}
|
|
16
|
-
// 3. Fallback: look for env files relative to this package (useful when running from monorepo root)
|
|
8
|
+
import { PROD_DEFAULTS } from './prod-defaults.js';
|
|
9
|
+
import { DEV_DEFAULTS } from './dev-defaults.js';
|
|
17
10
|
const __filename = fileURLToPath(import.meta.url);
|
|
18
11
|
const __dirnameResolved = path.dirname(__filename);
|
|
19
12
|
const packageRoot = path.resolve(__dirnameResolved, '..', '..');
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
function loadEnvFile(filePath, override) {
|
|
14
|
+
try {
|
|
15
|
+
if (fs.existsSync(filePath)) {
|
|
16
|
+
dotenvConfig({ path: filePath, override });
|
|
17
|
+
}
|
|
24
18
|
}
|
|
25
|
-
|
|
19
|
+
catch {
|
|
20
|
+
// ignore env file read failures
|
|
21
|
+
}
|
|
22
|
+
}
|
|
26
23
|
import { Amplify } from 'aws-amplify';
|
|
24
|
+
/**
|
|
25
|
+
* Load environment variables for the CLI.
|
|
26
|
+
*
|
|
27
|
+
* IMPORTANT: We intentionally DO NOT read `.env` / `.env.local` from `process.cwd()`.
|
|
28
|
+
* The CLI is often run inside customer NativeScript repos, and we must not accidentally
|
|
29
|
+
* inherit their local env files.
|
|
30
|
+
*
|
|
31
|
+
* Final precedence:
|
|
32
|
+
* - Explicit process env vars always win (dotenv does not overwrite by default unless override=true).
|
|
33
|
+
* - Selected in-code defaults (dev/prod) are the ultimate fallback.
|
|
34
|
+
*/
|
|
35
|
+
export function loadCliEnvFiles(env) {
|
|
36
|
+
const USER_CONFIG_DIR = path.join(os.homedir(), '.config', 'norrix');
|
|
37
|
+
// Always allow user-level overrides via ~/.config/norrix
|
|
38
|
+
loadEnvFile(path.join(USER_CONFIG_DIR, '.env'), false);
|
|
39
|
+
loadEnvFile(path.join(USER_CONFIG_DIR, '.env.local'), true);
|
|
40
|
+
// Only load package-root env files when explicitly running in dev mode.
|
|
41
|
+
// This avoids surprising behavior when the CLI is installed via `npm link`
|
|
42
|
+
// from a monorepo that has `packages/norrix-cli/.env.local`.
|
|
43
|
+
if (env === 'dev') {
|
|
44
|
+
loadEnvFile(path.join(packageRoot, '.env'), false);
|
|
45
|
+
loadEnvFile(path.join(packageRoot, '.env.local'), true);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
27
48
|
// Ensure a Web Crypto–compatible `crypto` is available for Amplify when running
|
|
28
49
|
// in Node.js. Some Amplify internals expect `globalThis.crypto` to exist and
|
|
29
50
|
// will throw "Cannot resolve the `crypto` function from the environment"
|
|
@@ -56,43 +77,40 @@ function ensureGlobalCrypto() {
|
|
|
56
77
|
//
|
|
57
78
|
// Environment variable precedence:
|
|
58
79
|
// 1. NORRIX_* variables (CLI-specific)
|
|
59
|
-
// 2. NEXT_PUBLIC_* variables (shared with next-app)
|
|
60
80
|
//
|
|
61
81
|
// Only the minimum settings required for email/password auth (Cognito) and S3 storage are included.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
process.env.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
loginWith: {
|
|
80
|
-
email: true,
|
|
82
|
+
function getDefaultsForEnv(env) {
|
|
83
|
+
return env === 'dev' ? DEV_DEFAULTS : PROD_DEFAULTS;
|
|
84
|
+
}
|
|
85
|
+
function buildAmplifyConfig(defaults) {
|
|
86
|
+
return {
|
|
87
|
+
Auth: {
|
|
88
|
+
Cognito: {
|
|
89
|
+
userPoolId: process.env.NORRIX_AUTH_COGNITO_USER_POOL_ID || defaults.userPoolId,
|
|
90
|
+
userPoolClientId: process.env.NORRIX_AUTH_COGNITO_ID || defaults.userPoolClientId,
|
|
91
|
+
// Required for AWS credentials (S3 access)
|
|
92
|
+
identityPoolId: process.env.NORRIX_AUTH_COGNITO_IDENTITY_POOL_ID ||
|
|
93
|
+
defaults.identityPoolId,
|
|
94
|
+
region: process.env.NORRIX_AUTH_COGNITO_REGION || defaults.region,
|
|
95
|
+
// We only enable email login for the CLI
|
|
96
|
+
loginWith: {
|
|
97
|
+
email: true,
|
|
98
|
+
},
|
|
81
99
|
},
|
|
82
100
|
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
'
|
|
92
|
-
|
|
101
|
+
Storage: {
|
|
102
|
+
S3: {
|
|
103
|
+
bucket: process.env.NORRIX_STORAGE_BUCKET_NAME ||
|
|
104
|
+
process.env.NORRIX_S3_BUCKET ||
|
|
105
|
+
defaults.s3Bucket,
|
|
106
|
+
region: process.env.NORRIX_STORAGE_BUCKET_REGION ||
|
|
107
|
+
process.env.NORRIX_AWS_REGION ||
|
|
108
|
+
defaults.s3Region,
|
|
109
|
+
defaultAccessLevel: 'private',
|
|
110
|
+
},
|
|
93
111
|
},
|
|
94
|
-
}
|
|
95
|
-
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
96
114
|
// -----------------------------------------------------------------------------
|
|
97
115
|
// Persistent storage for AWS Amplify tokens (Node-only)
|
|
98
116
|
// -----------------------------------------------------------------------------
|
|
@@ -106,11 +124,19 @@ const amplifyConfig = {
|
|
|
106
124
|
// (e.g. ~/.config/norrix/cli-auth.json).
|
|
107
125
|
// -----------------------------------------------------------------------------
|
|
108
126
|
const CONFIG_DIR = path.join(os.homedir(), '.config', 'norrix');
|
|
109
|
-
|
|
127
|
+
function tokenStorageFileForEnv(env) {
|
|
128
|
+
// Keep dev/prod sessions isolated to avoid accidentally reusing tokens
|
|
129
|
+
// across different Cognito user pools.
|
|
130
|
+
return path.join(CONFIG_DIR, `cli-auth.${env}.json`);
|
|
131
|
+
}
|
|
110
132
|
/**
|
|
111
133
|
* Minimal file-backed key/value store compatible with Amplify v6
|
|
112
134
|
*/
|
|
113
135
|
class FileKeyValueStorage {
|
|
136
|
+
storageFile;
|
|
137
|
+
constructor(storageFile) {
|
|
138
|
+
this.storageFile = storageFile;
|
|
139
|
+
}
|
|
114
140
|
/** Ensure ~/.config/norrix exists */
|
|
115
141
|
ensureDir() {
|
|
116
142
|
fs.mkdirSync(CONFIG_DIR, { recursive: true });
|
|
@@ -118,8 +144,8 @@ class FileKeyValueStorage {
|
|
|
118
144
|
/** Read the entire JSON blob (returns empty object if missing / invalid) */
|
|
119
145
|
read() {
|
|
120
146
|
try {
|
|
121
|
-
if (fs.existsSync(
|
|
122
|
-
return JSON.parse(fs.readFileSync(
|
|
147
|
+
if (fs.existsSync(this.storageFile)) {
|
|
148
|
+
return JSON.parse(fs.readFileSync(this.storageFile, 'utf-8'));
|
|
123
149
|
}
|
|
124
150
|
}
|
|
125
151
|
catch {
|
|
@@ -130,7 +156,7 @@ class FileKeyValueStorage {
|
|
|
130
156
|
/** Write the supplied object back to disk */
|
|
131
157
|
write(data) {
|
|
132
158
|
this.ensureDir();
|
|
133
|
-
fs.writeFileSync(
|
|
159
|
+
fs.writeFileSync(this.storageFile, JSON.stringify(data, null, 2), 'utf-8');
|
|
134
160
|
}
|
|
135
161
|
async getItem(key) {
|
|
136
162
|
const data = this.read();
|
|
@@ -150,12 +176,15 @@ class FileKeyValueStorage {
|
|
|
150
176
|
this.write({});
|
|
151
177
|
}
|
|
152
178
|
}
|
|
153
|
-
// Instantiate
|
|
154
|
-
const
|
|
155
|
-
export function configureAmplify() {
|
|
179
|
+
// Instantiate storage per env so a single CLI process can be safely configured.
|
|
180
|
+
const storageByEnv = {};
|
|
181
|
+
export function configureAmplify(env = 'prod') {
|
|
156
182
|
// Make sure Amplify can always find a `crypto` implementation in Node.
|
|
157
183
|
ensureGlobalCrypto();
|
|
158
184
|
// Configure is idempotent; calling it multiple times is safe
|
|
185
|
+
const defaults = getDefaultsForEnv(env);
|
|
186
|
+
const amplifyConfig = buildAmplifyConfig(defaults);
|
|
187
|
+
const persistentStorage = storageByEnv[env] || (storageByEnv[env] = new FileKeyValueStorage(tokenStorageFileForEnv(env)));
|
|
159
188
|
Amplify.configure({
|
|
160
189
|
...amplifyConfig,
|
|
161
190
|
// Expose the storage at the root level as well (belt & suspenders)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amplify-config.js","sourceRoot":"","sources":["../../src/lib/amplify-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,MAAM,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"amplify-config.js","sourceRoot":"","sources":["../../src/lib/amplify-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,EAA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AK,CAAC,UAAU,CAAC,GAAW;QAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACjB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;CACF;AAED,gFAAgF;AAChF,MAAM,YAAY,GAAuD,EAAE,CAAC;AAE5E,MAAM,UAAU,gBAAgB,CAAC,MAAoB,MAAM;IACzD,uEAAuE;IACvE,kBAAkB,EAAE,CAAC;IAErB,6DAA6D;IAC7D,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,aAAa,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,iBAAiB,GACrB,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,IAAI,mBAAmB,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAElG,OAAO,CAAC,SAAS,CAAC;QAChB,GAAG,aAAa;QAChB,mEAAmE;QACnE,OAAO,EAAE,iBAAiB;KAC3B,CAAC,CAAC;IAEH,0EAA0E;IAC1E,2EAA2E;IAC3E,0EAA0E;IAC1E,6BAA6B,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAC;AACtE,CAAC"}
|
package/dist/lib/commands.d.ts
CHANGED
|
@@ -1,20 +1,58 @@
|
|
|
1
|
+
import type { NorrixCliEnv } from './defaults.js';
|
|
2
|
+
/**
|
|
3
|
+
* Initialize runtime config for this CLI process.
|
|
4
|
+
*
|
|
5
|
+
* - Loads env files (user config always; package-root only in dev)
|
|
6
|
+
* - Selects dev/prod in-code defaults
|
|
7
|
+
* - Configures Amplify Auth/Storage
|
|
8
|
+
* - Computes the API base URL used by commands
|
|
9
|
+
*/
|
|
10
|
+
export declare function initNorrixCli(env?: NorrixCliEnv): void;
|
|
1
11
|
export declare function printFingerprint(cliPlatformArg?: string, appId?: string, verbose?: boolean): Promise<void>;
|
|
2
12
|
export declare function compareFingerprint(fromId: string, toArg?: string, verbose?: boolean): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Build command options passed from CLI flags
|
|
15
|
+
*/
|
|
16
|
+
export interface BuildOptions {
|
|
17
|
+
/** Nx project name (for workspace builds from root) */
|
|
18
|
+
project?: string;
|
|
19
|
+
/** Apple Developer Team ID (for iOS signing) */
|
|
20
|
+
teamId?: string;
|
|
21
|
+
/** App version override */
|
|
22
|
+
version?: string;
|
|
23
|
+
/** Build number override */
|
|
24
|
+
buildNumber?: string;
|
|
25
|
+
/** Skip confirmation prompts (use defaults/config file) */
|
|
26
|
+
nonInteractive?: boolean;
|
|
27
|
+
}
|
|
3
28
|
/**
|
|
4
29
|
* Build command implementation
|
|
5
30
|
* Uploads project to S3 and triggers build via the Next.js API gateway -> WarpBuild
|
|
6
31
|
*/
|
|
7
|
-
export declare function build(cliPlatformArg?: string, cliConfigurationArg?: string, verbose?: boolean): Promise<void>;
|
|
32
|
+
export declare function build(cliPlatformArg?: string, cliConfigurationArg?: string, cliDistributionArg?: string, verbose?: boolean, options?: BuildOptions | string): Promise<void>;
|
|
8
33
|
/**
|
|
9
34
|
* Submit command implementation
|
|
10
35
|
* Submits the built app to app stores via the Next.js API gateway
|
|
11
36
|
*/
|
|
12
37
|
export declare function submit(cliPlatformArg?: string, cliTrackArg?: string, verbose?: boolean): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Update command options passed from CLI flags
|
|
40
|
+
*/
|
|
41
|
+
export interface UpdateOptions {
|
|
42
|
+
/** Nx project name (for workspace builds from root) */
|
|
43
|
+
project?: string;
|
|
44
|
+
/** App identifier (bundle ID) */
|
|
45
|
+
appId?: string;
|
|
46
|
+
/** Build number override */
|
|
47
|
+
buildNumber?: string;
|
|
48
|
+
/** Skip confirmation prompts (use defaults/config file) */
|
|
49
|
+
nonInteractive?: boolean;
|
|
50
|
+
}
|
|
13
51
|
/**
|
|
14
52
|
* Update command implementation
|
|
15
53
|
* Publishes over-the-air updates to deployed apps via the Next.js API gateway
|
|
16
54
|
*/
|
|
17
|
-
export declare function update(cliPlatformArg?: string, cliVersionArg?: string, verbose?: boolean): Promise<void>;
|
|
55
|
+
export declare function update(cliPlatformArg?: string, cliVersionArg?: string, verbose?: boolean, options?: UpdateOptions | string): Promise<void>;
|
|
18
56
|
/**
|
|
19
57
|
* Build Status command implementation
|
|
20
58
|
* Checks the status of a build via the Next.js API gateway
|