Skip to content

Commit

Permalink
Merge pull request #379 from vscheuber/main
Browse files Browse the repository at this point in the history
fixes #377 and fixes #378
  • Loading branch information
vscheuber authored Mar 23, 2024
2 parents fa8ce64 + 76cd028 commit 302e1b6
Show file tree
Hide file tree
Showing 425 changed files with 80,734 additions and 45,873 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@ jobs:
run: echo "version=$(echo '${{ steps.version-bump.outputs.newTag }}' | sed 's/v//')" >> "$GITHUB_OUTPUT"

- name: Build frodo-cli esm
run: npm run transpile-esm
run: |
npm run transpile-esm
npm run resources-esm
- name: Build frodo-cli cjs
run: npm run transpile-cjs
run: |
npm run transpile-cjs
npm run resources-cjs
- name: Lint
run: npm run lint
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- \#378: `--llt` option of `frodo admin create-oauth2-client-with-admin-privileges` now works properly again
- \#377: Frodo CLI now properly handles FrodoErrors thrown by frodo-lib

## [2.0.0-51] - 2024-02-10

## [2.0.0-50] - 2024-02-07
Expand Down
209 changes: 203 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@
"build": "tsc && npm run build:local && npm run build:binary",
"clean-esm": "rimraf esm",
"transpile-esm": "babel --out-dir esm --extensions \".ts\" --source-maps --config-file ./babel.config.esm.json src",
"build:local": "tsc && npm run clean-esm && npm run transpile-esm && npm run clean-cjs && npm run transpile-cjs",
"resources-esm": "copyfiles -u 1 \"src/**/*.json\" esm",
"build:local": "tsc && npm run clean-esm && npm run transpile-esm && npm run resources-esm && npm run clean-cjs && npm run transpile-cjs && npm run resources-cjs",
"clean-cjs": "rimraf cjs",
"transpile-cjs": "babel --out-dir cjs --extensions \".ts\" --source-maps --config-file ./babel.config.cjs.json src && echo {\\\"type\\\": \\\"commonjs\\\"} > cjs/package.json",
"resources-cjs": "copyfiles -u 1 \"src/**/*.json\" cjs",
"dist-pkg": "pkg -C Gzip -t node18 --config package.json -o frodo cjs/app.js",
"dist-pkg-linux": "pkg -C Gzip -t node18-linux --config package.json -o frodo-linux cjs/app.js",
"dist-pkg-macos": "pkg -C Gzip -t node18-macos --config package.json -o frodo-macos cjs/app.js",
"dist-pkg-win": "pkg -C Gzip -t node18-win --config package.json -o frodo.exe cjs/app.js",
"build:binary": "tsc && npm run clean-cjs && npm run transpile-cjs && npm run dist-pkg",
"build:binary": "tsc && npm run clean-cjs && npm run transpile-cjs && npm run resources-cjs && npm run dist-pkg",
"link-frodo-lib": "npm link ../frodo-lib",
"watch": "npm run link-frodo-lib && babel --watch --out-dir esm --extensions \".ts\" --source-maps --config-file ./babel.config.esm.json src"
},
Expand Down Expand Up @@ -104,9 +106,10 @@
"pkg": {
"assets": [
"package.json",
"cjs/ops/templates/*.json",
"cjs/ops/templates/**/*.json",
"node_modules/@rockcarver/frodo-lib/cjs/ops/templates/*.json",
"node_modules/@rockcarver/frodo-lib/cjs/ops/templates/**/*.json",
"node_modules/@rockcarver/frodo-lib/mocks/**/*.har"
"node_modules/@rockcarver/frodo-lib/cjs/ops/templates/**/*.json"
],
"scripts": [
"cjs/cli/**/*.js",
Expand All @@ -116,7 +119,7 @@
]
},
"dependencies": {
"@rockcarver/frodo-lib": "2.0.0-72",
"@rockcarver/frodo-lib": "2.0.0-73",
"chokidar": "^3.5.3",
"cli-progress": "^3.11.2",
"cli-table3": "^0.6.3",
Expand Down Expand Up @@ -151,6 +154,7 @@
"@typescript-eslint/parser": "^6.5.0",
"@yao-pkg/pkg": "^5.11.0",
"babel-plugin-transform-import-meta": "^2.1.1",
"copyfiles": "^2.4.1",
"del": "^6.0.0",
"eslint": "^8.28.0",
"eslint-config-prettier": "^9.0.0",
Expand Down
15 changes: 13 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { frodo } from '@rockcarver/frodo-lib';
import { frodo, state } from '@rockcarver/frodo-lib';
import { Command } from 'commander';

// commands
Expand All @@ -25,14 +25,25 @@ import shell from './cli/shell/shell';
// enable sample command template.
// import something from './cli/_template/something';
import theme from './cli/theme/theme';
import { printMessage } from './utils/Console';
import {
debugMessage,
printError,
printMessage,
verboseMessage,
} from './utils/Console';
import { getVersions } from './utils/Version';

const { initConnectionProfiles } = frodo.conn;
const { initTokenCache } = frodo.cache;

(async () => {
try {
// override default library output handlers with our own
state.setPrintHandler(printMessage);
state.setErrorHandler(printError);
state.setDebugHandler(debugMessage);
state.setVerboseHandler(verboseMessage);

const program = new Command('frodo').version(
await getVersions(false),
'-v, --version'
Expand Down
9 changes: 3 additions & 6 deletions src/cli/admin/admin-add-autoid-static-user-mapping.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { frodo } from '@rockcarver/frodo-lib';

import { addAutoIdStaticUserMapping } from '../../ops/AdminOps';
import { getTokens } from '../../ops/AuthenticateOps';
import { printMessage } from '../../utils/Console.js';
import { FrodoCommand } from '../FrodoCommand';

const { addAutoIdStaticUserMapping } = frodo.admin;

const program = new FrodoCommand('frodo admin add-autoid-static-user-mapping');

program
Expand All @@ -25,8 +22,8 @@ program
);
if (await getTokens()) {
printMessage(`Adding AutoId static user mapping...`);
await addAutoIdStaticUserMapping();
printMessage('Done.');
const outcome = await addAutoIdStaticUserMapping();
if (!outcome) process.exitCode = 1;
} else {
process.exitCode = 1;
}
Expand Down
Loading

0 comments on commit 302e1b6

Please sign in to comment.