From be6c2d80929ea077aaba4a21c7ef8e670f771cd0 Mon Sep 17 00:00:00 2001 From: aminya Date: Fri, 23 Jul 2021 10:00:18 -0500 Subject: [PATCH 1/3] fix: remove BUNDLED_NODE_VERSION file --- .github/workflows/CI.yml | 2 +- BUNDLED_NODE_VERSION | 1 - script/download-node.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 BUNDLED_NODE_VERSION diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 16eef9f..bded549 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -41,7 +41,7 @@ jobs: D:\.pnpm-store ./bin/node ./bin/node.exe - key: "cache-OS:${{ matrix.os }}-${{ matrix.node_arch }}-node:${{ matrix.node_version }}-${{ hashFiles('./package.json') }}-${{ hashFiles('BUNDLED_NODE_VERSION') }}" + key: "cache-OS:${{ matrix.os }}-${{ matrix.node_arch }}-node:${{ matrix.node_version }}-${{ hashFiles('./package.json') }}-${{ hashFiles('./.npmrc') }}" - name: Install Node uses: actions/setup-node@v2 diff --git a/BUNDLED_NODE_VERSION b/BUNDLED_NODE_VERSION deleted file mode 100644 index 83f2a92..0000000 --- a/BUNDLED_NODE_VERSION +++ /dev/null @@ -1 +0,0 @@ -v12.18.3 diff --git a/script/download-node.js b/script/download-node.js index 0543090..5445b12 100644 --- a/script/download-node.js +++ b/script/download-node.js @@ -102,7 +102,7 @@ const downloadNode = function (version, done) { } } -const versionToInstall = fs.readFileSync(path.resolve(__dirname, "..", "BUNDLED_NODE_VERSION"), "utf8").trim() +const versionToInstall = fs.readFileSync(path.resolve(__dirname, "..", ".npmrc"), "utf8").match(/target=(.*)\n/)[1] downloadNode(versionToInstall, function (error) { if (error != null) { console.error("Failed to download node", error) From a82e9215780e0b0428b21484f73532db5cb20bfe Mon Sep 17 00:00:00 2001 From: aminya Date: Fri, 23 Jul 2021 10:06:23 -0500 Subject: [PATCH 2/3] chore: read the babel node target from .npmrc --- babel.config.js | 20 ++++++++++++++++++++ babel.config.json | 17 ----------------- 2 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 babel.config.js delete mode 100644 babel.config.json diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..b5c052a --- /dev/null +++ b/babel.config.js @@ -0,0 +1,20 @@ +const nodeTarget = require("fs") + .readFileSync("./.npmrc", "utf8") + .match(/target=(.*)\n/)[1] + +module.exports = { + presets: [ + [ + "babel-preset-atomic", + { + targets: { + node: nodeTarget, + }, + flow: false, + react: false, + }, + ], + ], + exclude: "node_modules/**", + sourceMap: "inline", +} diff --git a/babel.config.json b/babel.config.json deleted file mode 100644 index e13de8c..0000000 --- a/babel.config.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "presets": [ - [ - "babel-preset-atomic", - { - "targets": { - "node": "12.18.3" - }, - "flow": false, - "react": false - } - ] - ], - "plugins": [], - "exclude": "node_modules/**", - "sourceMap": "inline" -} From 5673cb75416e28511223208a202aafda299ac3bf Mon Sep 17 00:00:00 2001 From: aminya Date: Fri, 23 Jul 2021 10:11:03 -0500 Subject: [PATCH 3/3] ci: do not build the native modules in the lint job --- .github/workflows/CI.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index bded549..95be770 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -74,7 +74,9 @@ jobs: uses: wagoid/commitlint-github-action@v2 - name: Install dependencies - run: npm install + run: | + npm install --ignore-scripts # native modules are not used here + npm run prepare - name: Format ✨ run: npm run test.format