diff --git a/.github/workflows/npm-cd.yml b/.github/workflows/npm-cd.yml index 68dd3b3b82..d768e542e9 100644 --- a/.github/workflows/npm-cd.yml +++ b/.github/workflows/npm-cd.yml @@ -112,7 +112,7 @@ jobs: run: | # Remove the "cpu" and "os" fileds so the base package would be able to install it on ubuntu SED_FOR_MACOS=`if [[ "${{ matrix.build.OS }}" =~ .*"macos".* ]]; then echo "''"; fi` - sed -i $SED_FOR_MACOS '/"cpu":/d' ./package.json && sed -i $SED_FOR_MACOS '/"os":/d' ./package.json + sed -i $SED_FOR_MACOS '/"\/\/\/cpu": \[/,/]/d' ./package.json && sed -i $SED_FOR_MACOS '/"\/\/\/os": \[/,/]/d' ./package.json mkdir -p bin npm pack --pack-destination ./bin ls ./bin diff --git a/node/package.json b/node/package.json index b943253f51..d3fc6932d1 100644 --- a/node/package.json +++ b/node/package.json @@ -12,6 +12,7 @@ "glide-rs": "file:rust-client", "long": "^5.2.3", "npmignore": "^0.3.0", + "prettier": "^3.2.5", "protobufjs": "^7.2.2" }, "bundleDependencies": [ @@ -32,7 +33,9 @@ "test": "jest --verbose --runInBand --testPathIgnorePatterns='RedisModules'", "lint": "eslint -f unix \"src/**/*.{ts,tsx}\"", "prepack": "npmignore --auto", - "test-modules": "jest --verbose --runInBand 'tests/RedisModules.test.ts'" + "test-modules": "jest --verbose --runInBand 'tests/RedisModules.test.ts'", + "prettier:check:ci": "./node_modules/.bin/prettier --check . --ignore-unknown '!**/*.{js,d.ts}'", + "prettier:format": "./node_modules/.bin/prettier --write . --ignore-unknown '!**/*.{js,d.ts}'" }, "devDependencies": { "@babel/preset-env": "^7.20.2", @@ -70,8 +73,12 @@ "//": [ "The fields below have been commented out and are only necessary for publishing the package." ], - "///cpu": ["${node_arch}"], - "///os": ["${node_os}"], + "///cpu": [ + "${node_arch}" + ], + "///os": [ + "${node_os}" + ], "///name": "${scope}${pkg_name}", "///version": "${package_version}" }