Skip to content

Commit

Permalink
build: migrate to yarn v4
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Jan 1, 2024
1 parent 8a50056 commit 62b8f81
Show file tree
Hide file tree
Showing 20 changed files with 68,550 additions and 12,179 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
cache: yarn

- name: Install Dependencies
run: yarn --frozen-lockfile
run: yarn --immutable

# required for linting before commit
- name: Build
Expand All @@ -33,10 +33,10 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release:only
commit: 'chore: release package(s)'
title: 'chore: release package(s)'
publish: yarn release:only
version: yarn run version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/auto-imports.d.ts
1 change: 1 addition & 0 deletions .yarn/plugins/plugin-prepare-lifecycle.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports={name:"plugin-prepare-lifecycle",factory:e=>({hooks:{afterAllInstalled(r){if(!r.topLevelWorkspace.manifest.scripts.get("prepare"))return;e("@yarnpkg/shell").execute("yarn prepare")}}})};
6 changes: 6 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
nodeLinker: node-modules

plugins:
- checksum: 37b2361b1502b2054e6779788c0e9bdd6a90ce49852a8cad2feda79b0614ec94f06fb6e78951f5f95429c610d7934dd077caa47413a0227378a102c55161616d
path: .yarn/plugins/plugin-prepare-lifecycle.cjs
spec: "https://github.com/un-es/yarn-plugin-prepare-lifecycle/releases/download/v0.0.1/index.js"
21 changes: 21 additions & 0 deletions auto-imports.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
export {}
declare global {
const afterAll: typeof import('vitest')['afterAll']
const afterEach: typeof import('vitest')['afterEach']
const assert: typeof import('vitest')['assert']
const beforeAll: typeof import('vitest')['beforeAll']
const beforeEach: typeof import('vitest')['beforeEach']
const chai: typeof import('vitest')['chai']
const describe: typeof import('vitest')['describe']
const expect: typeof import('vitest')['expect']
const it: typeof import('vitest')['it']
const suite: typeof import('vitest')['suite']
const test: typeof import('vitest')['test']
const vi: typeof import('vitest')['vi']
const vitest: typeof import('vitest')['vitest']
}
49 changes: 27 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,57 @@
"workspaces": [
"packages/*"
],
"packageManager": "yarn@1.22.21",
"packageManager": "yarn@4.0.2",
"scripts": {
"build": "run-p build:*",
"build": "run-p 'build:*'",
"build:r": "r -f es2015",
"build:ts": "tsc -b",
"clean": "rimraf packages/*/{lib,*.tsbuildinfo}",
"lint": "run-p lint:*",
"clean": "rimraf --glob 'packages/*/{lib,*.tsbuildinfo}'",
"lint": "yarn build && run-p 'lint:*'",
"lint:es": "eslint . --cache -f friendly",
"lint:tsc": "tsc --noEmit",
"prelint": "yarn build",
"prepare": "patch-package && simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0",
"prerelease": "yarn build",
"release": "yarn release:only",
"prepare": "patch-package && simple-git-hooks",
"release": "run-s build release:only",
"release:only": "changeset publish",
"test": "jest",
"version": "changeset version && yarn --no-immutable",
"test": "vitest run --coverage",
"typecov": "type-coverage"
},
"devDependencies": {
"@1stg/lib-config": "^12.0.1",
"@1stg/common-config": "^10.0.0",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@types/eslint": "^8.44.8",
"@commitlint/cli": "^18.4.3",
"@pkgr/rollup": "^5.0.0",
"@types/acorn": "^6.0.0",
"@types/eslint": "^8.56.0",
"@types/eslint-plugin-markdown": "^2.0.2",
"@types/jest": "^29.5.10",
"@types/node": "^20.10.3",
"@types/react": "^18.2.42",
"@types/node": "^20.10.6",
"@types/react": "^18.2.46",
"@types/unist": "^3.0.2",
"jest": "^29.7.0",
"@vitest/coverage-istanbul": "^1.1.1",
"eslint": "^8.56.0",
"lint-staged": "^15.2.0",
"npm-run-all2": "^6.1.1",
"patch-package": "^8.0.0",
"react": "^18.2.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"type-coverage": "^2.27.0",
"typescript": "^5.3.2",
"yarn-deduplicate": "^6.0.2"
"rimraf": "^5.0.5",
"simple-git-hooks": "^2.9.0",
"type-coverage": "^2.27.1",
"typescript": "^5.3.3",
"unplugin-auto-import": "^0.17.3",
"vitest": "^1.1.1"
},
"resolutions": {
"@types/acorn": "^6.0.0",
"@types/mdast": "^4.0.3",
"acorn": "^8.11.2",
"acorn": "^8.11.3",
"cliui": "npm:@isaacs/cliui@^8.0.2",
"eslint-mdx": "link:packages/eslint-mdx",
"eslint-plugin-markdown": "JounQin/eslint-plugin-markdown#feat/bump",
"eslint-plugin-mdx": "link:packages/eslint-plugin-mdx",
"mdast-util-frontmatter": "^2.0.1",
"mdast-util-gfm": "^3.0.0",
"prettier": "^2.8.8",
"unified": "^11.0.4",
"unified-engine": "^11.2.0",
"unist-util-visit": "^5.0.0"
Expand All @@ -71,6 +75,7 @@
"fixtures",
"lib",
"CHANGELOG.md",
"/auto-imports.d.ts",
"/test.*",
"!/.*.js"
],
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
"eslint": ">=8.0.0"
},
"dependencies": {
"acorn": "^8.11.2",
"acorn": "^8.11.3",
"acorn-jsx": "^5.3.2",
"espree": "^9.6.1",
"estree-util-visit": "^2.0.0",
"remark-mdx": "^3.0.0",
"remark-parse": "^11.0.0",
"remark-stringify": "^11.0.0",
"synckit": "^0.8.6",
"synckit": "^0.8.8",
"tslib": "^2.6.2",
"unified": "^11.0.4",
"unified-engine": "^11.2.0",
Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-mdx/src/meta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error -- no idea
// @ts-ignore
import { name, version } from '../package.json'

export const meta = { name, version }
32 changes: 15 additions & 17 deletions packages/eslint-mdx/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ let tokTypes: typeof _tokTypes
let jsxTokTypes: Record<string, TokenType>
let tt: Record<string, TokenType> & typeof _tokTypes

let TokenTranslator: typeof import('espree/lib/token-translator')['default']
let TokenTranslator: (typeof import('espree/lib/token-translator'))['default']

export const processorCache = new Map<
string,
Expand All @@ -71,9 +71,8 @@ export const processorCache = new Map<

const getRemarkConfig = async (searchFrom: string) => {
if (!config) {
const { Configuration } = await loadEsmModule<
typeof import('unified-engine')
>('unified-engine')
const { Configuration } =
await loadEsmModule<typeof import('unified-engine')>('unified-engine')
config = new Configuration({
cwd: process.cwd(),
packageField: 'remarkConfig',
Expand Down Expand Up @@ -251,13 +250,12 @@ runAsWorker(
}

if (!jsxTokTypes) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
jsxTokTypes = acornJsx.default(
{
allowNamespacedObjects: true,
},
// @ts-expect-error
)(acorn.Parser).acornJsx.tokTypes
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
jsxTokTypes = acornJsx.default({
allowNamespacedObjects: true,
// @ts-expect-error -- no type
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
})(acorn.Parser).acornJsx.tokTypes
}

if (!TokenTranslator) {
Expand Down Expand Up @@ -289,9 +287,8 @@ runAsWorker(
const comments: Comment[] = []
const tokens: AST.Token[] = []

const { visit } = await loadEsmModule<typeof import('unist-util-visit')>(
'unist-util-visit',
)
const { visit } =
await loadEsmModule<typeof import('unist-util-visit')>('unist-util-visit')

const processed = new WeakSet<Node>()

Expand Down Expand Up @@ -727,9 +724,10 @@ runAsWorker(
})
}

const { visit: visitEstree } = await loadEsmModule<
typeof import('estree-util-visit')
>('estree-util-visit')
const { visit: visitEstree } =
await loadEsmModule<typeof import('estree-util-visit')>(
'estree-util-visit',
)

visitEstree(
{
Expand Down
2 changes: 0 additions & 2 deletions packages/eslint-plugin-mdx/src/meta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error -- no idea
// @ts-ignore
import { name, version } from '../package.json'

export const meta = { name, version }
File renamed without changes.
11 changes: 0 additions & 11 deletions patches/string-length+4.0.2.patch

This file was deleted.

Loading

0 comments on commit 62b8f81

Please sign in to comment.