mirror of
https://github.com/morten-olsen/with-ssm.git
synced 2026-02-08 00:46:23 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef32edcb29 | ||
|
|
e2dfb3491d |
@@ -1 +0,0 @@
|
||||
PASSWORD=SSM:/test/hfd/rds/DB_USER
|
||||
@@ -1,2 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
import '../dist/start.js';
|
||||
import '../dist/index.js';
|
||||
|
||||
19
package.json
19
package.json
@@ -6,8 +6,8 @@
|
||||
"license": "GPL-3.0",
|
||||
"scripts": {
|
||||
"test:lint": "eslint",
|
||||
"build": "tsc --build",
|
||||
"build:dev": "tsc --build --watch",
|
||||
"build": "ncc build src/start.ts -o dist",
|
||||
"build:dev": "ncc build src/start.ts -o dist --watch",
|
||||
"test:unit": "vitest --run --passWithNoTests",
|
||||
"test": "pnpm run \"/^test:/\""
|
||||
},
|
||||
@@ -16,27 +16,26 @@
|
||||
"dist"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@aws-sdk/client-ssm": "^3.863.0",
|
||||
"@eslint/eslintrc": "3.3.1",
|
||||
"@eslint/js": "9.32.0",
|
||||
"@pnpm/find-workspace-packages": "6.0.9",
|
||||
"@types/node": "24.2.0",
|
||||
"@types/yargs": "^17.0.33",
|
||||
"@vercel/ncc": "^0.38.3",
|
||||
"@vitest/coverage-v8": "3.2.4",
|
||||
"dotenv": "^17.2.1",
|
||||
"eslint": "9.32.0",
|
||||
"eslint-config-prettier": "10.1.8",
|
||||
"eslint-plugin-import": "2.32.0",
|
||||
"eslint-plugin-prettier": "5.5.4",
|
||||
"execa": "^9.6.0",
|
||||
"prettier": "3.6.2",
|
||||
"typescript": "5.9.2",
|
||||
"typescript-eslint": "8.39.0",
|
||||
"vitest": "3.2.4"
|
||||
"vitest": "3.2.4",
|
||||
"yargs": "^18.0.0"
|
||||
},
|
||||
"name": "@morten-olsen/with-ssm",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-ssm": "^3.859.0",
|
||||
"dotenv": "^17.2.1",
|
||||
"execa": "^9.6.0",
|
||||
"yargs": "^18.0.0"
|
||||
}
|
||||
"version": "1.0.0"
|
||||
}
|
||||
|
||||
957
pnpm-lock.yaml
generated
957
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
25
src/start.ts
25
src/start.ts
@@ -5,7 +5,8 @@ import { exec } from './utils/exec.js';
|
||||
import { getEnv } from './utils/env.js';
|
||||
import { replaceParams } from './utils/ssm.js';
|
||||
|
||||
const argv = await yargs(hideBin(process.argv))
|
||||
const main = async () => {
|
||||
const argv = await yargs(hideBin(process.argv))
|
||||
.usage('Usage: $0 [options] -- <command>')
|
||||
.option('region', {
|
||||
type: 'string',
|
||||
@@ -26,20 +27,26 @@ const argv = await yargs(hideBin(process.argv))
|
||||
.epilogue('For more information, check the documentation.')
|
||||
.parse();
|
||||
|
||||
const command = argv._[0] as string;
|
||||
const commandArgs = argv._.slice(1).map(String);
|
||||
const command = argv._[0] as string;
|
||||
const commandArgs = argv._.slice(1).map(String);
|
||||
|
||||
if (!command) {
|
||||
if (!command) {
|
||||
console.error('No command provided');
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
const files = argv.file && Array.isArray(argv.file) ? argv.file : [argv.file];
|
||||
const hostEnv = await getEnv(files);
|
||||
const env = await replaceParams(hostEnv);
|
||||
const files = argv.file && Array.isArray(argv.file) ? argv.file : [argv.file];
|
||||
const hostEnv = await getEnv(files);
|
||||
const env = await replaceParams(hostEnv);
|
||||
|
||||
exec({
|
||||
exec({
|
||||
command,
|
||||
env,
|
||||
args: commandArgs,
|
||||
});
|
||||
};
|
||||
|
||||
main().catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"resolveJsonModule": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"skipLibCheck": true,
|
||||
"noEmit": true,
|
||||
"outDir": "dist",
|
||||
"jsx": "react-jsx",
|
||||
"isolatedModules": true,
|
||||
|
||||
Reference in New Issue
Block a user