diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b149913..d48b148 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,6 +35,24 @@ jobs: */*/node_modules key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + - name: Copy package.json compatible with node version + run: | + if [[ ${{ 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..f5993c9 --- /dev/null +++ b/ci-package.json @@ -0,0 +1,53 @@ +{ + "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", + "prepare": "husky", + "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", + "@commitlint/cli": "^19.3.0", + "@types/crypto-js": "^4.2.2", + "@types/lz-string": "^1.5.0", + "babel-jest": "^29.7.0", + "babel-loader": "^9.1.3", + "globals": "^15.4.0", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", + "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 +}