Skip to content

Commit

Permalink
use yarn instead of pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
astahmer committed Oct 30, 2023
1 parent d62b780 commit 7bb512a
Show file tree
Hide file tree
Showing 21 changed files with 14,409 additions and 9,869 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.{js,json,yml}]
charset = utf-8
indent_style = space
indent_size = 2
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
14 changes: 5 additions & 9 deletions .github/composite-actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
name: 'Install'
description: 'Sets up Node.js and runs install'
name: "Install"
description: "Sets up Node.js and runs install"

runs:
using: composite
steps:
- uses: pnpm/[email protected]
with:
version: 7

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
registry-url: "https://registry.npmjs.org"
cache: "yarn"

- name: Setup Git User
shell: bash
Expand All @@ -23,4 +19,4 @@ runs:
- name: Install dependencies
shell: bash
run: pnpm install
run: yarn install --frozen-lockfile
8 changes: 4 additions & 4 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: ./.github/composite-actions/install

- name: Run Prettier
run: pnpm fmt
run: yarn fmt

# tests:
# name: Unit Tests
Expand All @@ -37,7 +37,7 @@ jobs:
# uses: ./.github/composite-actions/install

# - name: Run tests
# run: pnpm test
# run: yarn test

eslint:
name: ESLint
Expand All @@ -50,7 +50,7 @@ jobs:
uses: ./.github/composite-actions/install

- name: Run ESLint
run: pnpm lint
run: yarn lint
env:
NODE_OPTIONS: "--max-old-space-size=4096"

Expand All @@ -65,4 +65,4 @@ jobs:
uses: ./.github/composite-actions/install

- name: Run TypeScript type check
run: pnpm typecheck
run: yarn typecheck
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"skipFiles": ["<node_internals>/**"]
},
{
"command": "pnpm test ${relativeFile}",
"command": "yarn test ${relativeFile}",
"name": "Run Vitest",
"request": "launch",
"type": "node-terminal"
Expand Down
Binary file added .yarn/install-state.gz
Binary file not shown.
893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.1.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-4.0.1.cjs
nmHoistingLimits: dependencies
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"private": true,
"description": "The repository of css panda",
"scripts": {
"prepare": "pnpm build-fast",
"dev": "pnpm -r --parallel --filter=./packages/** dev",
"build-fast": "pnpm -r --parallel --filter=./packages/** build-fast",
"build": "pnpm -r --filter=./packages/** build",
"prepare": "yarn build-fast",
"dev": "yarn workspaces foreach --all -pt run dev",
"build-fast": "yarn workspaces foreach --all -pt run build-fast",
"build": "yarn workspaces foreach --all run build",
"test": "vitest",
"lint": "eslint packages --ext .ts",
"fmt": "prettier --write packages",
Expand All @@ -29,5 +29,8 @@
"typescript": "5.2.2",
"vitest": "0.33.0"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"workspaces": [
"packages/*"
]
}
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"scripts": {
"build": "tsup src/index.ts --format=esm,cjs --dts",
"build-fast": "tsup src/index.ts --format=esm,cjs --no-dts",
"dev": "pnpm build-fast --watch",
"dev": "yarn build-fast --watch",
"clean": "rimraf dist",
"lint": "eslint ./src --ext .ts,.tsx --fix"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/ts-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"scripts": {
"build": "tsup src/index.ts --format=cjs --dts",
"build-fast": "tsup src/index.ts --format=cjs --no-dts",
"dev": "pnpm build-fast --watch"
"dev": "yarn build-fast --watch"
},
"devDependencies": {
"@pandacss/extension-shared": "workspace:^",
Expand Down
1 change: 1 addition & 0 deletions packages/vscode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# vscode
19 changes: 11 additions & 8 deletions packages/vscode/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"publisher": "chakra-ui",
"packageManager": "[email protected]",
"name": "panda-css-vscode",
"displayName": "🐼 Panda CSS",
"description": "The official Panda CSS plugin for VS Code",
Expand Down Expand Up @@ -195,18 +196,18 @@
"directory": "packages/vscode"
},
"scripts": {
"build:lsp": "pnpm --filter=../language-server build",
"build:shared": "pnpm --filter=../shared build",
"build:ts-plugin": "pnpm --filter=../ts-plugin build",
"build:all": "pnpm build:shared && pnpm build:lsp && pnpm build:ts-plugin",
"build:lsp": "yarn workspaces focus @pandacss/language-server build",
"build:shared": "yarn workspaces focus @pandacss/extension-shared build",
"build:ts-plugin": "yarn workspaces focus @pandacss/ts-plugin build",
"build:all": "yarn build:shared && yarn build:lsp && yarn build:ts-plugin",
"build": "tsup",
"dev": "tsup --watch src/index.ts --watch ../language-server/dist/index.js --watch ../shared/dist/index.js --watch ../ts-plugin/dist/index.js",
"clean": "rimraf dist node_modules",
"typecheck": "tsc --noEmit",
"rewrite-deps": "tsx ./scripts/rewrite-workspace-dependencies.ts",
"override-esbuild": "tsx ./scripts/override-esbuild-with-wasm.ts",
"release": "pnpm build --silent && tsx ./scripts/publish.ts",
"local:build": "pnpm rewrite-deps && pnpm clean && pnpm override-esbuild && npm i --ignore-scripts && pnpm build:all && pnpm build && pnpm vsix-builder package"
"release": "yarn build --silent && tsx ./scripts/publish.ts",
"local:build": "yarn build:all && yarn build && yarn vsix-builder package"
},
"dependencies": {
"@pandacss/dev": "^0.17.0",
Expand All @@ -225,12 +226,14 @@
"devDependencies": {
"@pandacss/extension-shared": "workspace:^",
"@pandacss/language-server": "workspace:^",
"@pandacss/types": "^0.17.3",
"@pandacss/vsix-builder": "workspace:^",
"@pnpm/find-workspace-dir": "^6.0.2",
"@pnpm/find-workspace-packages": "^6.0.9",
"@pnpm/types": "^9.4.0",
"@types/node": "20.4.5",
"@types/vscode": "^1.80.0",
"@vscode/vsce": "^2.20.0",
"@types/vscode": "^1.67.0",
"@vscode/vsce": "^2.22.0",
"dotenv": "^16.3.1",
"execa": "7.2.0",
"fs-extra": "11.1.1",
Expand Down
8 changes: 4 additions & 4 deletions packages/vscode/scripts/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ if (!rcVersion) {
}

const commands = {
vscode_package: `pnpm vsix-builder package ${rcVersion} --target ${target} -o panda.vsix`,
vscode_publish: `pnpm vsce publish --packagePath panda.vsix --pat ${process.env.VSCE_TOKEN}`,
vscode_package: `yarn vsix-builder package ${rcVersion} --target ${target} -o panda.vsix`,
vscode_publish: `yarn vsce publish --packagePath panda.vsix --pat ${process.env.VSCE_TOKEN}`,
// rc release: publish to VS Code Marketplace with today's date as patch number
vscode_package_rc: `pnpm vsix-builder package ${rcVersion} --pre-release --target ${target} -o panda.vsix`,
vscode_rc: `pnpm vsce publish --pre-release --packagePath panda.vsix --pat ${process.env.VSCE_TOKEN}`,
vscode_package_rc: `yarn vsix-builder package ${rcVersion} --pre-release --target ${target} -o panda.vsix`,
vscode_rc: `yarn vsce publish --pre-release --packagePath panda.vsix --pat ${process.env.VSCE_TOKEN}`,
// To publish to the open-vsx registry
openvsx_publish: `npx ovsx publish panda.vsix --pat ${process.env.OVSX_TOKEN}`,
}
Expand Down
8 changes: 6 additions & 2 deletions packages/vscode/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { defineConfig } from 'tsup'
import { dependencies, devDependencies } from './package.json'

export default defineConfig({
entry: ['src/index.ts', 'src/server.ts'],
// entry: ['src/index.ts'],
format: ['cjs'],
external: ['vscode', 'esbuild'],
minify: true,
// external: ['vscode', 'esbuild'],
// external: Object.keys(dependencies).concat(Object.keys(devDependencies)),
external: ['vscode', 'esbuild', '@pandacss/types'],
minify: false,
outDir: 'dist',
clean: true,
shims: true,
Expand Down
10 changes: 5 additions & 5 deletions packages/vsix-builder/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"name": "@pandacss/vsix-builder",
"description": "Forked version of @vscode/vsce to support pnpm symlinks",
"description": "Forked version of @vscode/vsce to support symlinks",
"version": "0.17.0",
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"bin": {
"vsix-builder": "bin.js"
},
"bin": "bin.js",
"repository": {
"url": "https://github.com/chakra-ui/panda-vscode",
"directory": "packages/vsix-builder"
Expand All @@ -18,17 +16,19 @@
"scripts": {
"build": "tsup src/cli-*.ts src/index.ts --format=cjs --dts --shims --clean",
"build-fast": "tsup src/cli-*.ts src/index.ts --format=cjs --no-dts --shims",
"dev": "pnpm build-fast --watch",
"dev": "yarn build-fast --watch",
"clean": "rimraf dist",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@types/mime": "^1",
"@types/npm-packlist": "^3.0.0",
"@types/read": "^0.0.29",
"@types/semver": "^7.5.4",
"@types/tar-stream": "^2.2.2",
"@types/xml2js": "^0.4.11",
"@types/yauzl": "^2.10.0",
"chalk": "^5.3.0",
"tsup": "7.1.0",
"typescript": "^5.2.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/vsix-builder/src/create-vsix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const createVsix = async (
) => {
const { manifest, dir } = await getManifest(target.dir)
const fileNames = await packlist({ path: dir })
const files = fileNames.map((f) => ({ path: `packages/${f}`, localPath: join(target.dir, f) }))
const files = fileNames.map((f) => ({ path: `extension/${f}`, localPath: join(target.dir, f) }))

const { outfile } = target
if (target.dry) {
Expand Down
1 change: 0 additions & 1 deletion packages/vsix-builder/src/vsce/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,6 @@ async function toContentTypes(files: IFile[]): Promise<string> {
const ext = extname(file.path).toLowerCase()

if (ext) {
// @ts-ignore
mimetypes.set(ext, mime.lookup(ext))
}
}
Expand Down
Loading

0 comments on commit 7bb512a

Please sign in to comment.