From e9468bad0a1e2a5863b25f77ea9b6ce0d19f5e41 Mon Sep 17 00:00:00 2001 From: Shiying Chen Date: Wed, 27 Mar 2024 17:42:11 +0800 Subject: [PATCH] use ncc to compile (#428) --- action.yml | 6 +++--- package-lock.json | 14 ++++++++++++-- package.json | 9 ++++++--- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/action.yml b/action.yml index 98fadf6fd..af6c2739b 100644 --- a/action.yml +++ b/action.yml @@ -39,6 +39,6 @@ branding: color: 'blue' runs: using: 'node20' - pre: 'lib/cleanup.js' - main: 'lib/main.js' - post: 'lib/cleanup.js' + pre: 'lib/cleanup/index.js' + main: 'lib/main/index.js' + post: 'lib/cleanup/index.js' diff --git a/package-lock.json b/package-lock.json index ed0e7700c..0e67af0a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "login", - "version": "1.0.0", + "version": "2.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "login", - "version": "1.0.0", + "version": "2.0.0", "license": "MIT", "dependencies": { "@actions/core": "1.9.1", @@ -17,6 +17,7 @@ "devDependencies": { "@types/jest": "^29.2.4", "@types/node": "^20.11.1", + "@vercel/ncc": "^0.38.1", "jest": "^29.3.1", "jest-circus": "^29.3.1", "ts-jest": "^29.0.3", @@ -1106,6 +1107,15 @@ "dev": true, "license": "MIT" }, + "node_modules/@vercel/ncc": { + "version": "0.38.1", + "resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.1.tgz", + "integrity": "sha512-IBBb+iI2NLu4VQn3Vwldyi2QwaXt5+hTyh58ggAMoCGE6DJmPvwL3KPBWcJl1m9LYPChBLE980Jw+CS4Wokqxw==", + "dev": true, + "bin": { + "ncc": "dist/ncc/cli.js" + } + }, "node_modules/ansi-escapes": { "version": "4.3.2", "dev": true, diff --git a/package.json b/package.json index eca636d28..aba816b19 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,12 @@ { "name": "login", - "version": "1.0.0", + "version": "2.0.0", "description": "Login Azure wraps the az login, allowing for Azure actions to log into Azure", - "main": "lib/main.js", + "main": "lib/main/index.js", "scripts": { - "build": "tsc", + "build:main": "ncc build src/main.ts -o lib/main", + "build:cleanup": "ncc build src/cleanup.ts -o lib/cleanup", + "build": "npm run build:main && npm run build:cleanup", "test": "jest" }, "author": "Microsoft", @@ -12,6 +14,7 @@ "devDependencies": { "@types/jest": "^29.2.4", "@types/node": "^20.11.1", + "@vercel/ncc": "^0.38.1", "jest": "^29.3.1", "jest-circus": "^29.3.1", "ts-jest": "^29.0.3",