diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b149913..ac06b36 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,6 +35,26 @@ jobs: */*/node_modules key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + - name: Copy package.json compatible with node version + run: | + if [[ ${{ matrix.node_version }} == 8* ]]; then + cp ci-package.json package.json + elif [[ ${{ matrix.node_version }} == 10* ]]; then + cp ci-package.json package.json + elif [[ ${{ matrix.node_version }} == 12* ]]; then + cp ci-package.json package.json + elif [[ ${{ matrix.node_version }} == 13* ]]; then + cp ci-package.json package.json + elif [[ ${{ matrix.node_version }} == 14* ]]; then + cp ci-package.json package.json + elif [[ ${{ matrix.node_version }} == 15* ]]; then + cp ci-package.json package.json + elif [[ ${{ matrix.node_version }} == 16* ]]; then + cp ci-package.json package.json + elif [[ ${{ matrix.node_version }} == 19* ]]; then + cp ci-package.json package.json + fi + - name: Install dependencies and run tests with coverage run: | yarn install diff --git a/ci-package.json b/ci-package.json new file mode 100644 index 0000000..b64cda8 --- /dev/null +++ b/ci-package.json @@ -0,0 +1,47 @@ +{ + "name": "secure-ls", + "description": "Secure localStorage/sessionStorage data with high level of encryption and data compression", + "main": "./dist/secure-ls.js", + "browser": "./dist/secure-ls.js", + "typings": "./types/secure-ls.d.ts", + "scripts": { + "build": "yarn build-dev && yarn build-prod", + "build-dev": "webpack --mode=development", + "build-prod": "webpack --mode=production", + "build:patch": "yarn build-dev --env type=patch npm version patch", + "build:minor": "yarn build-dev --env type=minor npm version minor", + "build:major": "yarn build-dev --env type=major npm version major", + "lint": "eslint src/*.js --fix", + "prettier": "prettier -w **/*.js *.md", + "test:dev": "jest --watch --runInBand --debug --colors --errorOnDeprecated", + "test:prod": "jest --runInBand --colors --errorOnDeprecated", + "test:coverage": "jest --coverage --coverageDirectory=coverage && cat ./coverage/lcov.info" + }, + "dependencies": { + "crypto-js": "^4.2.0", + "lz-string": "^1.5.0" + }, + "devDependencies": { + "@babel/core": "^7.24.5", + "@babel/preset-env": "^7.24.5", + "babel-jest": "^25.x.x", + "jest": "^25.x.x", + "jest-environment-jsdom": "^25.x.x", + "semver": "^7.6.2" + }, + "repository": { + "type": "git", + "url": "https://github.com/softvar/secure-ls.git" + }, + "keywords": ["secure-ls", "localStorage", "encryption", "compression", "webpack", "es6", "umd", "commonjs"], + "author": "Varun Malhotra", + "license": "MIT", + "bugs": { + "url": "https://github.com/softvar/secure-ls/issues" + }, + "homepage": "https://github.com/softvar/secure-ls", + "engines": { + "node": ">=10.0" + }, + "engineStrict": true +} diff --git a/package.json b/package.json index 6d148e9..7eec53f 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ }, "homepage": "https://github.com/softvar/secure-ls", "engines": { - "node": ">=10.0" + "node": ">=8.0" }, "engineStrict": true }