Skip to content
This repository was archived by the owner on Jan 27, 2025. It is now read-only.

Commit 5f77c59

Browse files
authored
Switch from ncc to Rollup (#39)
1 parent 4c8eb29 commit 5f77c59

File tree

8 files changed

+2730
-650
lines changed

8 files changed

+2730
-650
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# awsx changelog
22

3+
## 1.3.0 (December 4, 2021)
4+
5+
- Build with Rollup instead of ncc
6+
- Upgrade from v2 to v3 of the AWS JavaScript SDK
7+
38
## 1.2.0 (October 16, 2021)
49

510
- Add `whoami` command

package-lock.json

Lines changed: 2514 additions & 518 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "awsx",
33
"description": "AWS CLI profile switcher with MFA support",
4-
"version": "1.2.0",
4+
"version": "1.3.0",
55
"author": "Neo Financial Engineering <engineering@neofinancial.com>",
66
"license": "MIT",
77
"repository": {
@@ -16,10 +16,10 @@
1616
"_awsx": "./bin/run.sh"
1717
},
1818
"scripts": {
19-
"start": "NODE_ENV=development ts-node src/app.ts",
19+
"start": "ts-node-script src/app.ts",
2020
"start:build": "node bin/awsx.js",
21-
"build": "NODE_ENV=production ncc build src/app.ts -o build --minify --external update-notifier",
22-
"watch": "NODE_ENV=production ncc build src/app.ts -o build --watch --external update-notifier",
21+
"build": "NODE_ENV=production rollup -c",
22+
"watch": "rollup -c -w",
2323
"test": "NODE_ENV=test jest",
2424
"clean": "rimraf build",
2525
"lint": "eslint \"**/*.{ts,js}\"",
@@ -44,26 +44,35 @@
4444
"update-notifier": "^4.1.3"
4545
},
4646
"devDependencies": {
47+
"@aws-sdk/client-iam": "^3.43.0",
48+
"@aws-sdk/client-sts": "^3.43.0",
49+
"@aws-sdk/credential-providers": "^3.43.0",
50+
"@rollup/plugin-commonjs": "^21.0.1",
51+
"@rollup/plugin-json": "^4.1.0",
52+
"@rollup/plugin-node-resolve": "^13.0.6",
53+
"@rollup/plugin-typescript": "^8.3.0",
4754
"@types/ini": "^1.3.31",
48-
"@types/inquirer": "^6.5.0",
4955
"@types/jest": "^27.0.2",
5056
"@types/node": "^13.13.52",
57+
"@types/prompts": "^2.0.14",
5158
"@types/update-notifier": "^2.5.2",
5259
"@types/yargs": "^15.0.14",
53-
"@zeit/ncc": "^0.21.0",
54-
"aws-sdk": "^2.1009.0",
5560
"chalk": "^4.1.2",
5661
"eslint": "^7.32.0",
5762
"eslint-config-neo": "^0.6.2",
5863
"husky": "7.0.2",
5964
"ini": "1.3.8",
60-
"inquirer": "7.3.3",
6165
"jest": "^27.2.5",
6266
"lint-staged": "11.2.3",
6367
"prettier": "2.4.1",
68+
"prompts": "^2.4.2",
6469
"rimraf": "3.0.2",
70+
"rollup": "^2.60.2",
71+
"rollup-plugin-terser": "^7.0.2",
72+
"rollup-plugin-uglify": "^6.0.4",
6573
"ts-jest": "^27.0.7",
6674
"ts-node": "10.3.0",
75+
"tslib": "^2.3.1",
6776
"typescript": "4.4.4",
6877
"yargs": "15.4.1"
6978
}

rollup.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import typescript from '@rollup/plugin-typescript';
2+
import json from '@rollup/plugin-json';
3+
import commonjs from '@rollup/plugin-commonjs';
4+
import { terser } from 'rollup-plugin-terser';
5+
import { nodeResolve } from '@rollup/plugin-node-resolve';
6+
7+
const watch = process.env.ROLLUP_WATCH === 'true';
8+
9+
export default {
10+
input: 'src/app.ts',
11+
output: {
12+
file: 'build/index.js',
13+
format: 'cjs',
14+
exports: 'named',
15+
},
16+
external: ['fs', 'path', 'util', 'update-notifier'],
17+
plugins: [typescript(), json(), commonjs(), nodeResolve(), !watch && terser()],
18+
};

0 commit comments

Comments
 (0)