Skip to content

Commit 109a742

Browse files
authored
feat: setup changeset and use pnpm (#46)
1 parent 2fbd805 commit 109a742

File tree

22 files changed

+12155
-17534
lines changed

22 files changed

+12155
-17534
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{ "repo": "pradel/create-react-app-esbuild" }
6+
],
7+
"commit": false,
8+
"linked": [],
9+
"access": "public",
10+
"baseBranch": "main",
11+
"updateInternalDependencies": "patch",
12+
"ignore": []
13+
}

.changeset/flat-zebras-press.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'craco-esbuild': patch
3+
---
4+
5+
Automate release process.

.github/workflows/node.js.yml

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,62 +14,50 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v2
1616

17-
- name: Use Node.js 14
18-
uses: actions/setup-node@v1
17+
- uses: pnpm/action-setup@v2
1918
with:
20-
node-version: 14.x
21-
22-
- name: Get yarn cache directory path
23-
id: yarn-cache-dir-path
24-
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
19+
version: 6.24.1
2520

26-
- uses: actions/cache@v2
27-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
21+
- name: Use Node.js 14
22+
uses: actions/setup-node@v2
2823
with:
29-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
30-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
31-
restore-keys: |
32-
${{ runner.os }}-yarn-
24+
node-version: 14.x
25+
cache: 'pnpm'
3326

34-
- run: yarn install --immutable
27+
- name: Install dependencies
28+
run: pnpm install
3529

3630
- name: Compile create-react-app examples using react-scripts
3731
run: |
38-
yarn workspaces foreach --include "with-*" run build-react-scripts
32+
pnpm run build-react-scripts --filter "with-*"
3933
4034
- name: Test create-react-app examples using react-scripts
4135
run: |
42-
yarn workspaces foreach --include "with-*" run test-react-scripts
36+
pnpm run test-react-scripts --filter "with-*"
4337
4438
test:
4539
runs-on: ubuntu-latest
4640

4741
steps:
4842
- uses: actions/checkout@v2
4943

50-
- name: Use Node.js 14
51-
uses: actions/setup-node@v1
44+
- uses: pnpm/action-setup@v2
5245
with:
53-
node-version: 14.x
54-
55-
- name: Get yarn cache directory path
56-
id: yarn-cache-dir-path
57-
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
46+
version: 6.24.1
5847

59-
- uses: actions/cache@v2
60-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
48+
- name: Use Node.js 14
49+
uses: actions/setup-node@v2
6150
with:
62-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
63-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
64-
restore-keys: |
65-
${{ runner.os }}-yarn-
51+
node-version: 14.x
52+
cache: 'pnpm'
6653

67-
- run: yarn install --immutable
54+
- name: Install dependencies
55+
run: pnpm install
6856

6957
- name: Compile create-react-app examples using craco
7058
run: |
71-
yarn workspaces foreach --include "with-*" run build
59+
pnpm run build --filter "with-*"
7260
7361
- name: Test create-react-app examples using craco
7462
run: |
75-
yarn workspaces foreach --include "with-*" run test
63+
pnpm run test --filter "with-*"

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
release:
9+
name: Release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Repo
13+
uses: actions/checkout@v2
14+
with:
15+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
16+
fetch-depth: 0
17+
18+
- uses: pnpm/action-setup@v2
19+
with:
20+
version: 6.24.1
21+
22+
- name: Use Node.js 14.x
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: 14.x
26+
cache: 'pnpm'
27+
28+
- name: Install dependencies
29+
run: pnpm install
30+
31+
- name: Create Release Pull Request or Publish to npm
32+
id: changesets
33+
uses: changesets/action@v1
34+
with:
35+
version: pnpm run version
36+
publish: pnpm run release
37+
commit: 'chore: update versions'
38+
title: 'chore: version packages'
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
.yarn/*
2-
!.yarn/releases
3-
!.yarn/plugins
4-
.pnp.*
51
node_modules

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
pnpx lint-staged

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CHANGELOG.md
1+
build

.versionrc.js

Lines changed: 0 additions & 57 deletions
This file was deleted.

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 0 additions & 363 deletions
This file was deleted.

0 commit comments

Comments
 (0)