Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Adjust the yarn examples #6464

Merged
merged 18 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/actions/build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ runs:
uses: streetsidesoftware/action-set-output@v1
with:
value: >-
build-${{ hashFiles(
build-${{ runner.os }}-${{ hashFiles(
'*-lock.yaml',
'integration-tests/src/**/*.ts',
'integration-tests/tsconfig*.json',
Expand All @@ -68,10 +68,7 @@ runs:
'packages/*/src/**/*.mjs',
'packages/*/src/**/*.mts',
'packages/*/src/**/*.ts',
'test-packages/**/*.cjs',
'test-packages/**/*.cts',
'test-packages/**/*.js',
'test-packages/**/*.mjs',
'test-packages/**/*.mts',
'test-packages/**/*.ts',
'test-packages/**/tsconfig*.json',
Expand Down
5 changes: 3 additions & 2 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ inputs:
runs:
using: 'composite'
steps:
- name: Setup pnpm
uses: pnpm/[email protected]
- name: Enable Corepack
run: corepack enable
shell: bash

- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-version-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ jobs:
with:
token: ${{ env.GITHUB_TOKEN }} # needed to trigger workflows

- name: Setup pnpm
uses: pnpm/[email protected]
- name: Enable Corepack
run: corepack enable

- name: Use Node.js
uses: actions/setup-node@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cspell-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/[email protected]
- name: Enable Corepack
run: corepack enable

- name: Use Node.js
uses: actions/setup-node@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cspell-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/[email protected]
- name: Enable Corepack
run: corepack enable

- name: Use Node.js
uses: actions/setup-node@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/[email protected]
- name: Enable Corepack
run: corepack enable

- uses: actions/setup-node@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reuseable-load-integrations-repo-list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ jobs:
with:
ref: ${{ env.REF_BRANCH }}

- name: Setup pnpm
uses: pnpm/[email protected]
- name: Enable Corepack
run: corepack enable

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/update-dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ jobs:
with:
ref: ${{ env.REF_BRANCH }}

- name: Setup pnpm
uses: pnpm/[email protected]
- name: Enable Corepack
run: corepack enable

- name: Use Node.js
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
node-version: 20.x
cache: 'pnpm'

- name: Run Action
id: dependabot
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/update-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
with:
ref: ${{ env.REF_BRANCH }}

- name: Setup pnpm
uses: pnpm/[email protected]
- name: Enable Corepack
run: corepack enable

- name: Use Node.js
uses: actions/setup-node@v4
Expand All @@ -74,6 +74,10 @@ jobs:
- name: Install
run: pnpm install

- name: Update Yarn
run: |
pnpm run update-yarn

- name: Has changes
run: |
git --no-pager diff --compact-summary --exit-code && echo "git_status=clean" >> $GITHUB_ENV || echo "git_status=dirty" >> $GITHUB_ENV
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/update-dictionaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ jobs:
with:
ref: ${{ env.REF_BRANCH }}

- name: Setup pnpm
uses: pnpm/[email protected]
- name: Enable Corepack
run: corepack enable

- name: Use Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -154,8 +154,8 @@ jobs:
with:
ref: ${{ env.REF_BRANCH }}

- name: Setup pnpm
uses: pnpm/[email protected]
- name: Enable Corepack
run: corepack enable

- name: Patch
run: |
Expand Down Expand Up @@ -254,8 +254,8 @@ jobs:
with:
ref: ${{ env.REF_BRANCH }}

- name: Setup pnpm
uses: pnpm/[email protected]
- name: Enable Corepack
run: corepack enable

- name: Patch
run: |
Expand Down Expand Up @@ -313,8 +313,8 @@ jobs:
with:
ref: ${{ env.REF_BRANCH }}

- name: Setup pnpm
uses: pnpm/[email protected]
- name: Enable Corepack
run: corepack enable

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/update-integration-repositories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ jobs:
with:
ref: ${{ env.REF_BRANCH }}

- name: Setup pnpm
uses: pnpm/[email protected]
- name: Enable Corepack
run: corepack enable

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
Expand Down Expand Up @@ -168,8 +168,8 @@ jobs:
with:
ref: ${{ env.REF_BRANCH }}

- name: Setup pnpm
uses: pnpm/[email protected]
- name: Enable Corepack
run: corepack enable

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
Expand Down
1 change: 1 addition & 0 deletions cspell-dict.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ codecov
Codecov
codeql
COMPOUNDFLAG
corepack
coverallsapp
cspellcache
Damerau
Expand Down
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"/cspell-ignore-words.txt",
"/docs/docsV2/**",
"/docs/types/cspell-types",
"examples/yarn/**",
"/.cspell",
"cspell*.{json,yaml}",
"integration-tests/config/config.json",
Expand Down
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export default tsEslint.config(
'docs/_site/**',
'docs/docsV2/**',
'docs/types/cspell-types/**',
'examples/yarn/**',
'integration-tests/repositories/**',
'package-lock.json',
'packages/*/dist/**',
Expand Down
1 change: 1 addition & 0 deletions examples/project-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
corepack
5 changes: 5 additions & 0 deletions examples/yarn/cspell-eslint-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ingore .yarn zero install because this is just a test package.
.yarn/cache
install-state.gz
.pnp.js
.pnp.*
6 changes: 6 additions & 0 deletions examples/yarn/cspell-eslint-plugin/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
compressionLevel: mixed

globalFolder: ../../../.yarn
enableGlobalCache: true
pnpEnableEsmLoader: true
npmRegistryServer: https://registry.npmjs.org
18 changes: 18 additions & 0 deletions examples/yarn/cspell-eslint-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Sample Repository using Yarn and `@cspell/eslint-plugin`

**Usage**

```
yarn
yarn lint
```

## Medical Terms Test

This file contains some medical terms to be spell checked.

Sampled full list

abiana
abiate
abiatrophy
5 changes: 5 additions & 0 deletions examples/yarn/cspell-eslint-plugin/cspell.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
usePnP: true
import:
- '@cspell/dict-medicalterms/cspell-ext.json'
words:
- medicalterms
13 changes: 13 additions & 0 deletions examples/yarn/cspell-eslint-plugin/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import cspellESLintPluginRecommended from '@cspell/eslint-plugin/recommended';

/** @type {import('eslint').Linter.Config[]} */
export default [
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
{
ignores: ['.pnp.cjs'],
},
cspellESLintPluginRecommended,
];
86 changes: 86 additions & 0 deletions examples/yarn/cspell-eslint-plugin/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
export const sampleWords = `
# Sample Repository using Yarn

# Medical Terms Test

This file contaains some medical terms to be spell checked.

Sampled full list

abiana
abiate
abiatrophy
abiatus
abid
abidi
abidochromis
abience
abient
abietene
abietic
abietine
abietite
abigeat
abigei
Abilify
abinoxylan
abio
AbioCor
abiogeneses
abiogenesis
abiogenetic
abiogenic
abiogenist
abiogenous
abiogeny
Abiological
Abiomed
AbioMed
abionergy
abioseston
abiosis
abiotic
abiotically

ZUMI
Zung
Zunrisa
Zuntz's
Zuplenz
Zweifel
zwitterion
Zyban
Zybit
Zyderm
Zydis
Zydone
Zyflo
zygal
zygapophyseal
zygapophyseales
zygapophysial
zygapophysiales
zygapophysis
zygia
zygion
Zygocotyle
zygodactyly
zygoma
zygomas
zygomatic
zygomatica
zygomatici
zygomatico
zygomaticoauricular
zygomaticofacial
zygomaticofacialis
zygomaticofrontal
zygomaticofrontalis
zygomaticomaxillaris
zygomaticomaxillary
zygomaticosphenoid
zygomaticotemporal
zygomaticotemporalis
`;

console.log(sampleWords);
24 changes: 24 additions & 0 deletions examples/yarn/cspell-eslint-plugin/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "cspell-eslint-plugin",
"version": "1.0.0",
"license": "MIT",
"private": true,
"packageManager": "[email protected]+sha512.341db9396b6e289fecc30cd7ab3af65060e05ebff4b3b47547b278b9e67b08f485ecd8c79006b405446262142c7a38154445ef7f17c1d5d1de7d90bf9ce7054d",
"module": "./index.mjs",
"scripts": {
"lint": "eslint .",
"spell": "cspell .",
"test": "yarn lint",
"go": "node ./index.mjs",
"update:dep": "yarn add --dev @cspell/dict-medicalterms@latest @cspell/cspell-types@latest @cspell/eslint-plugin@latest cspell"
},
"devDependencies": {
"@cspell/cspell-types": "^8.15.7",
"@cspell/dict-medicalterms": "^4.1.5",
"@cspell/eslint-plugin": "^8.15.7",
"@eslint/js": "^9.14.0",
"cspell": "^8.15.7",
"eslint": "^9.14.0",
"globals": "^15.11.0"
}
}
Loading
Loading