Skip to content

Commit

Permalink
chore: switch yarn to pnpm linker (zwave-js#3748)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone authored Nov 18, 2021
1 parent 7e2ca72 commit 9a56c5d
Show file tree
Hide file tree
Showing 38 changed files with 60 additions and 660 deletions.
3 changes: 0 additions & 3 deletions .github/actions/generateTypedDocs/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Enable Yarn PnP
require("../../../.pnp.cjs").setup();

const exec = require("@actions/exec");
const github = require("@actions/github");
const core = require("@actions/core");
Expand Down
3 changes: 0 additions & 3 deletions .github/actions/gh-cc-table/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Enable Yarn PnP
require("../../../.pnp.cjs").setup();

const c = require("ansi-colors");
const exec = require("@actions/exec");
const github = require("@actions/github");
Expand Down
3 changes: 0 additions & 3 deletions .github/actions/toLogEntry/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Enable Yarn PnP
require("../../../.pnp.cjs").setup();

const c = require("ansi-colors");
const exec = require("@actions/exec");
const github = require("@actions/github");
Expand Down
11 changes: 3 additions & 8 deletions .github/actions/zwave-js-bot/main.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
// @ts-check

// Enable Yarn PnP
// @ts-expect-error 🤷🏻‍♂️
require("../../../.pnp.cjs").setup();

const exec = require("@actions/exec");
const github = require("@actions/github");
const core = require("@actions/core");
Expand Down Expand Up @@ -55,15 +51,14 @@ async function publishPr() {

// Bump versions
await exec.exec(
"yarn",
`lerna version ${newVersion} --exact --allow-branch * --ignore-scripts --no-commit-hooks --no-push --yes`.split(
"lerna",
`version ${newVersion} --exact --allow-branch * --ignore-scripts --no-commit-hooks --no-push --yes`.split(
" ",
),
);

// and release
await exec.exec("yarn", [
"lerna",
await exec.exec("lerna", [
"publish",
"from-package",
"--yes",
Expand Down
4 changes: 0 additions & 4 deletions .github/bot-scripts/addCompatFlag.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

/// <reference path="types.d.ts" />

// To require non-local modules, we need to setup Yarn PnP
// @ts-ignore
require("../../.pnp.cjs").setup();

const { ConfigManager } = require("@zwave-js/config");
const JSONC = require("comment-json");
const fs = require("fs-extra");
Expand Down
4 changes: 0 additions & 4 deletions .github/bot-scripts/addFingerprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

/// <reference path="types.d.ts" />

// To require non-local modules, we need to setup Yarn PnP
// @ts-ignore
require("../../.pnp.cjs").setup();

const { ConfigManager } = require("@zwave-js/config");
const { formatId } = require("@zwave-js/shared");
const JSONC = require("comment-json");
Expand Down
6 changes: 1 addition & 5 deletions .github/bot-scripts/approveWorkflows.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
// @ts-check

// To require non-local modules, we need to setup Yarn PnP
// @ts-ignore
require("../../.pnp.cjs").setup();
/// <reference path="./types.d.ts" />

const { makeRe } = require("minimatch");

/// <reference path="./types.d.ts" />

/**
* @param {{github: Github, context: Context, whitelist: string[], workflows: string[]}} param
*/
Expand Down
1 change: 1 addition & 0 deletions .github/bot-scripts/checkAuthorized.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check

/// <reference path="types.d.ts" />

const { authorizedUsers } = require("./users");
Expand Down
1 change: 1 addition & 0 deletions .github/bot-scripts/fixLintFeedback.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check

/// <reference path="types.d.ts" />

/**
Expand Down
1 change: 1 addition & 0 deletions .github/bot-scripts/getFixLintInfo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check

/// <reference path="types.d.ts" />

/**
Expand Down
1 change: 1 addition & 0 deletions .github/bot-scripts/importConfigCreatePR.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check

/// <reference path="types.d.ts" />

const { reviewers } = require("./users");
Expand Down
1 change: 1 addition & 0 deletions .github/bot-scripts/rebaseFeedback.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check

/// <reference path="types.d.ts" />

/**
Expand Down
1 change: 1 addition & 0 deletions .github/bot-scripts/renameCommitCheck.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check

/// <reference path="types.d.ts" />

/**
Expand Down
1 change: 1 addition & 0 deletions .github/bot-scripts/renameCommitFeedback.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check

/// <reference path="types.d.ts" />

/**
Expand Down
1 change: 1 addition & 0 deletions .github/bot-scripts/renameCommitGetPRInfo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-check

/// <reference path="types.d.ts" />

/**
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly-config-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
# ===============================
# Verify that only @zwave-js/config and zwave-js are changed
LERNA_CHANGED=$(yarn lerna changed)
LERNA_CHANGED=$(lerna changed)
if [[ $(echo -e "@zwave-js/config\nzwave-js") != "$LERNA_CHANGED" ]]; then
echo "❌ Lerna detected unexpected package changes, aborting..."
echo "These packages are changed:"
Expand All @@ -77,7 +77,7 @@ jobs:
# ===============================
# Create a clean build
yarn lerna run build
lerna run build
# Lint config files
yarn run lint:config
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
console.log(v);
EOF
VERSION=$(yarn node script.js)
VERSION=$(node script.js)
echo "Next version is $VERSION"
npm version "$VERSION" --ignore-scripts --no-git-tag-version
npm publish --tag nightly
8 changes: 4 additions & 4 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: yarn install --immutable

- name: Compile TypeScript code
run: yarn lerna run build
run: lerna run build

- name: Run linters
run: yarn run lint
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
run: yarn install --immutable

- name: Compile TypeScript code
run: yarn lerna run build
run: lerna run build

- name: Lint config files
run: yarn run lint:config
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:

# Test that the generated packages are ok
- name: Import main entry point
run: yarn node -e 'require("zwave-js")'
run: node -e 'require("zwave-js")'

- name: Run component tests
run: yarn run test:ci
Expand Down Expand Up @@ -244,7 +244,7 @@ jobs:
run: |
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
npm whoami
yarn lerna publish from-package --yes $TAG
lerna publish from-package --yes $TAG
- name: Create Github Release
uses: actions/create-release@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/to-log-entry-overview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: yarn install --immutable

- name: Compile TypeScript code
run: yarn lerna run build
run: lerna run build

- name: Update overview
uses: ./.github/actions/toLogEntry
Expand Down
1 change: 0 additions & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ vscode:
- dbaeumer.vscode-eslint
- esbenp.prettier-vscode
- EditorConfig.EditorConfig
- arcanis.vscode-zipfs

# Configure prebuilds
github:
Expand Down
3 changes: 1 addition & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"EditorConfig.EditorConfig",
"amodio.toggle-excluded-files",
"arcanis.vscode-zipfs"
"amodio.toggle-excluded-files"
]
}
56 changes: 28 additions & 28 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,40 @@
"typescriptreact"
],
"files.exclude": {
"node_modules/": true,
"coverage/": true,
"node_modules/": false,
"coverage/": false,
".*": false,
"**/node_modules/": true,
".nyc_output": true,
"**/coverage/": true,
"**/*.map": true,
"**/zwave-js-*.tgz": true,
"build": true,
"*.d.ts": true,
"*.map": true,
"**/build": true,
"**/*.tsbuildinfo": true,
"packages/zwave-js/**/fingerprint.txt": true,
"node_modules/zwave-js/**/fingerprint.txt": true,
".husky/_/**/*": true,
"packages/config/config/devices/index.json": true,
"packages/*/package-lock.json": true,
".yarn/*": true,
"**/node_modules/": false,
".nyc_output": false,
"**/coverage/": false,
"**/*.map": false,
"**/zwave-js-*.tgz": false,
"build": false,
"*.d.ts": false,
"*.map": false,
"**/build": false,
"**/*.tsbuildinfo": false,
"packages/zwave-js/**/fingerprint.txt": false,
"node_modules/zwave-js/**/fingerprint.txt": false,
".husky/_/**/*": false,
"packages/config/config/devices/index.json": false,
"packages/*/package-lock.json": false,
".yarn/*": false,
".yarn/patches": false,
".yarn/releases": false,
".yarn/plugins": false,
".yarn/sdks": false,
".yarn/versions": false,
"**/.pnp.*": true,
"**/*.test.js": true,
"packages/*/cache": true,
"**/.tmp": true,
"**/.tmpoh/": true,
"**/.tmpozw/": true,
"**/.tmpzwa/": true,
"**/.secrets": true,
"**/.test-payloads": true,
"(!test)/cache": true
"**/.pnp.*": false,
"**/*.test.js": false,
"packages/*/cache": false,
"**/.tmp": false,
"**/.tmpoh/": false,
"**/.tmpozw/": false,
"**/.tmpzwa/": false,
"**/.secrets": false,
"**/.test-payloads": false,
"(!test)/cache": false
},
"files.associations": {
"**/config/**/*.json": "jsonc"
Expand Down
40 changes: 0 additions & 40 deletions .yarn-patches/ts-morph.diff

This file was deleted.

20 changes: 0 additions & 20 deletions .yarn/sdks/eslint/bin/eslint.js

This file was deleted.

20 changes: 0 additions & 20 deletions .yarn/sdks/eslint/lib/api.js

This file was deleted.

6 changes: 0 additions & 6 deletions .yarn/sdks/eslint/package.json

This file was deleted.

5 changes: 0 additions & 5 deletions .yarn/sdks/integrations.yml

This file was deleted.

Loading

0 comments on commit 9a56c5d

Please sign in to comment.