Skip to content

Commit

Permalink
chore: migration to pnpm and turborepo (#980)
Browse files Browse the repository at this point in the history
* chore: migration to pnpm and turborepo

* feat(*): support pnpm
* fix(webpack): get rid of loader-utils (#977)
  • Loading branch information
Anber committed Jun 5, 2022
1 parent 73aab0a commit 8be5650
Show file tree
Hide file tree
Showing 104 changed files with 12,593 additions and 16,080 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
25 changes: 25 additions & 0 deletions .changeset/curly-birds-joke.md
@@ -0,0 +1,25 @@
---
'@linaria/atomic': patch
'@linaria/babel-preset': patch
'@linaria/cli': patch
'@linaria/core': patch
'@linaria/esbuild': patch
'@linaria/extractor': patch
'@linaria/babel-plugin-interop': patch
'linaria': patch
'@linaria/logger': patch
'@linaria/preeval': patch
'@linaria/react': patch
'@linaria/rollup': patch
'@linaria/server': patch
'@linaria/shaker': patch
'@linaria/stylelint': patch
'@linaria/testkit': patch
'@linaria/utils': patch
'@linaria/webpack-loader': patch
'@linaria/webpack4-loader': patch
'@linaria/webpack5-loader': patch
'linaria-website': patch
---

The repo has been migrated to PNPM and Turborepo
1 change: 1 addition & 0 deletions .eslintignore
Expand Up @@ -2,6 +2,7 @@ __fixtures__/
coverage/
lib/
esm/
packages/*/bin/
packages/*/types/
dist/
build/
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.js
Expand Up @@ -190,6 +190,7 @@ module.exports = {
},
{
files: [
'packages/testkit/**/*.test.ts',
'**/__tests__/**/*.test.ts',
'**/__tests__/**/*.test.tsx',
'**/__utils__/**/*.ts',
Expand Down
23 changes: 17 additions & 6 deletions .github/workflows/check.yml
Expand Up @@ -11,22 +11,33 @@ jobs:

runs-on: ubuntu-latest

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 18.x]
node-version: [14.x, 16.x, 18.x]

steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2.2.2
with:
version: 7
run_install: false

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache: 'pnpm'

- name: Install and prepare
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile --strict-peer-dependencies
- name: ESLint
run: yarn lint
run: pnpm lint
- name: TSLint
run: yarn test:dts
run: pnpm turbo run test:dts
- name: Tests
run: yarn test
run: pnpm turbo run test
26 changes: 18 additions & 8 deletions .github/workflows/site-deploy.yml
Expand Up @@ -6,17 +6,27 @@ on:
jobs:
build-and-deploy:
runs-on: ubuntu-latest

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}

steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.3.1
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2.2.2
with:
version: 7
run_install: false

- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
persist-credentials: false
node-version: 18.x
cache: 'pnpm'

- name: Install and Build 🔧
run: |
yarn install --frozen-lockfile
yarn website install --frozen-lockfile
yarn website build
- name: Install and prepare
run: pnpm install --frozen-lockfile --strict-peer-dependencies

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@3.7.1
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -44,6 +44,9 @@ jspm_packages/
# Optional npm cache directory
.npm

# Turborepo cache directory
.turbo

# Optional eslint cache
.eslintcache

Expand Down
17 changes: 0 additions & 17 deletions .release-it.json

This file was deleted.

30 changes: 30 additions & 0 deletions .syncpackrc.js
@@ -0,0 +1,30 @@
module.exports = {
dev: true,
filter: '.',
indent: ' ',
overrides: true,
peer: false,
pnpmOverrides: true,
prod: true,
resolutions: true,
semverGroups: [],
semverRange: '',
sortAz: [
'contributors',
'dependencies',
'devDependencies',
'keywords',
'peerDependencies',
'resolutions',
'scripts',
],
sortFirst: ['name', 'description', 'version', 'author'],
source: [],
versionGroups: [
{
dependencies: ['@types/enhanced-resolve', 'enhanced-resolve', 'webpack'],
packages: ['@linaria/webpack4-loader'],
},
],
workspace: true,
};
3 changes: 2 additions & 1 deletion babel.config.js
Expand Up @@ -44,6 +44,7 @@ module.exports = {
},
},
],
'@babel/preset-typescript',
],
},
},
Expand Down Expand Up @@ -79,7 +80,7 @@ module.exports = {
/**
* we have to transpile JSX in tests
*/
test: /\/((__tests__)|(__fixtures__))\//,
test: /\/(__tests__|__fixtures__|packages\/teskit\/src)\//,
presets: ['@babel/preset-react'],
},
],
Expand Down
87 changes: 44 additions & 43 deletions package.json
@@ -1,41 +1,22 @@
{
"private": true,
"license": "MIT",
"repository": "git@github.com:callstack/linaria.git",
"engines": {
"node": "^12.16.0 || >=13.7.0"
},
"bugs": {
"url": "https://github.com/callstack/linaria/issues"
},
"homepage": "https://github.com/callstack/linaria#readme",
"scripts": {
"add-contributor": "all-contributors add",
"bootstrap": "yarn && yarn website install",
"check:all": "yarn test:dts && yarn typecheck && yarn test && yarn lint",
"clean": "del 'packages/*/{coverage,esm,lib,types,tsconfig.tsbuildinfo}'",
"lint": "eslint --ext .js,.ts,.tsx .",
"prepare": "yarn lerna run prepare",
"release": "release-it",
"test": "yarn lerna run test",
"test:coverage": "yarn lerna run test -- -- --coverage",
"test:dts": "yarn lerna run test:dts",
"typecheck": "yarn lerna run typecheck",
"watch": "lerna run --parallel watch",
"website": "yarn --cwd website"
"name": "umbrella",
"version": "3.0.0-beta.19",
"bugs": "https://github.com/callstack/linaria/issues",
"dependencies": {
"git-raw-commits": "^2.0.3"
},
"devDependencies": {
"@babel/cli": ">=7",
"@babel/core": ">=7",
"@babel/cli": "^7.17.10",
"@babel/core": "^7.18.2",
"@babel/eslint-parser": "^7.18.2",
"@babel/plugin-proposal-class-properties": ">=7",
"@babel/plugin-syntax-jsx": ">=7",
"@babel/preset-env": ">=7",
"@babel/preset-react": ">=7",
"@babel/preset-typescript": ">=7",
"@changesets/cli": "^2.22.0",
"@commitlint/config-conventional": "^8.3.4",
"@release-it/conventional-changelog": "^1.1.0",
"@types/jest": "^27.5.1",
"@types/jest": "^28.1.0",
"@typescript-eslint/eslint-plugin": "^5.26.0",
"@typescript-eslint/parser": "^5.26.0",
"all-contributors-cli": "^6.20.0",
Expand All @@ -56,30 +37,50 @@
"eslint-plugin-react-hooks": "^4.5.0",
"husky": "^1.3.1",
"jest": "^28.1.0",
"lerna": "^3.22.1",
"lerna-changelog": "^1.0.1",
"prettier": "^2.6.2",
"react": ">=16",
"release-it": "^14.2.1",
"release-it-lerna-changelog": "^3.1.0",
"typescript": "^4.7.2"
"react": "^16.14.0",
"syncpack": "^8.0.0",
"turbo": "^1.2.16",
"typescript": "^4.7.3"
},
"resolutions": {
"@typescript-eslint/experimental-utils": "^4.28.0",
"git-raw-commits": "^2.0.3"
"engines": {
"node": "^12.16.0 || >=13.7.0"
},
"homepage": "https://github.com/callstack/linaria#readme",
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "yarn check:all"
"pre-commit": "npm run check:all"
}
},
"license": "MIT",
"private": true,
"repository": "git@github.com:callstack/linaria.git",
"resolutions": {
"@typescript-eslint/experimental-utils": "^4.28.0",
"git-raw-commits": "^2.0.3"
},
"scripts": {
"add-contributor": "all-contributors add",
"bootstrap": "pnpm install",
"check:all": "turbo run check:all && npm run lint && npm run sp:check",
"clean": "del 'packages/*/{coverage,esm,lib,types,tsconfig.tsbuildinfo}'",
"lint": "eslint --ext .js,.ts,.tsx .",
"prepare": "turbo run build",
"release": "release-it",
"sp:check": "syncpack",
"sp:fix": "syncpack format && syncpack fix-mismatches",
"sp:format": "syncpack format",
"sp:list": "syncpack list-mismatches",
"test": "turbo run test",
"test:coverage": "turbo run test -- -- --coverage",
"test:dts": "turbo run test:dts",
"typecheck": "turbo run typecheck",
"watch": "turbo run --parallel watch",
"website": "pnpm --filter=linaria-website"
},
"workspaces": [
"./packages/*",
"./website"
],
"dependencies": {
"git-raw-commits": "^2.0.3"
},
"name": "linaria"
]
}

0 comments on commit 8be5650

Please sign in to comment.