From ca9ffdbc17d1a97bb22a2445f935799048682434 Mon Sep 17 00:00:00 2001 From: Trevor Moody Date: Fri, 12 Dec 2025 13:16:32 +0000 Subject: [PATCH] fix(build): pipeline node version upgrade and hardened security --- .gitattributes | 1 + .github/workflows/npmpublish.yml | 7 +++++-- .npmrc | 1 + package-lock.json | 10 ++++------ package.json | 9 +++------ 5 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 .gitattributes create mode 100644 .npmrc diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..94f480d --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf \ No newline at end of file diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 2150cef..1442df4 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - node-version: [lts/hydrogen] + node-version: [lts/iron] steps: - uses: actions/checkout@v2 @@ -23,7 +23,7 @@ jobs: with: node-version: ${{ matrix.node-version }} - # 2. Restore npm cache manually + # 2. Restore npm cache manually - name: Restore npm cache uses: actions/cache@v3 id: npm-cache @@ -42,6 +42,9 @@ jobs: - name: Build Project run: npm run build + - name: Clean up ready for publishing + run: npm run publishInit + - name: Semantic Release uses: cycjimmy/semantic-release-action@v3 env: diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..537f81f --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +ignore-scripts=true \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index fa7eb12..972d77d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,10 +5,9 @@ "packages": { "": { "name": "@sasjs/adapter", - "hasInstallScript": true, "license": "ISC", "dependencies": { - "@sasjs/utils": "3.5.2", + "@sasjs/utils": "3.5.4", "axios": "1.12.2", "axios-cookiejar-support": "5.0.5", "form-data": "4.0.4", @@ -2424,10 +2423,9 @@ } }, "node_modules/@sasjs/utils": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/@sasjs/utils/-/utils-3.5.2.tgz", - "integrity": "sha512-LBpBDx0T7G/eO15Gb+r3DR1LfBnoqagWT3HiHabojFziA4ej4ePORo8chrk0zHLIzrjI2ljAnDabyJEwC5KtIA==", - "hasInstallScript": true, + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/@sasjs/utils/-/utils-3.5.4.tgz", + "integrity": "sha512-e7sXalk9VG/V7nGdMczheGfiXbK3eDzfJXB8/RexxtZGUTdEjUU3XErle7h2rkz47xgqnAr1kMFn3yOf8qD5Gw==", "license": "ISC", "dependencies": { "@fast-csv/format": "4.3.5", diff --git a/package.json b/package.json index d3a239f..c6bb4fc 100644 --- a/package.json +++ b/package.json @@ -4,17 +4,14 @@ "homepage": "https://adapter.sasjs.io", "scripts": { "nodeVersionMessage": "echo \u001b[33m make sure you are running node lts version \u001b[0m", - "preinstall": "npm run nodeVersionMessage", - "prebuild": "npm run nodeVersionMessage", - "build": "npx rimraf build && npx rimraf node && mkdir node && copyfiles -u 1 \"./src/**/*\" ./node && webpack && npx rimraf build/src && npx rimraf node", + "build": "npm run nodeVersionMessage && npx rimraf build && npx rimraf node && mkdir node && copyfiles -u 1 \"./src/**/*\" ./node && webpack && npx rimraf build/src && npx rimraf node", "package:lib": "npm run build && copyfiles ./package.json build && cd build && npm version \"5.0.0\" && npm pack", "publish:lib": "npm run build && cd build && npm publish", "lint:fix": "npx prettier --loglevel silent --write \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\" && npx prettier --loglevel silent --write \"sasjs-tests/src/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\" && npx prettier --loglevel silent --write \"cypress/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\"", "lint": "npx prettier --check \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\" && npx prettier --check \"sasjs-tests/src/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\" && npx prettier --check \"cypress/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\"", "lint:silent": "npx prettier --loglevel silent --check \"src/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\" && npx prettier --loglevel silent --check \"sasjs-tests/src/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\" && npx prettier --loglevel silent --check \"cypress/**/*.{ts,tsx,js,jsx,html,css,sass,less,json,yml,md,graphql}\"", "test": "jest --silent --coverage", - "prepublishOnly": "cp -r ./build/* . && rm -rf ./build", - "postpublish": "git clean -fd", + "publishInit": "cp -r ./build/* . && rm -rf ./build", "semantic-release": "semantic-release", "typedoc": "node createTSDocs", "prepare": "git rev-parse --git-dir && git config core.hooksPath ./.git-hooks && git config core.autocrlf false || true", @@ -79,7 +76,7 @@ }, "main": "index.js", "dependencies": { - "@sasjs/utils": "3.5.2", + "@sasjs/utils": "3.5.4", "axios": "1.12.2", "axios-cookiejar-support": "5.0.5", "form-data": "4.0.4",