Skip to content

Commit

Permalink
convert to pnpm (#80)
Browse files Browse the repository at this point in the history
* convert to pnpm

* add types node

* formatting

* bump a few more htings
  • Loading branch information
JoviDeCroock authored Apr 28, 2023
1 parent 9577903 commit ca7bc83
Show file tree
Hide file tree
Showing 6 changed files with 8,090 additions and 7,872 deletions.
99 changes: 66 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,74 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile
- run: npm run build
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 7
run_install: false

- name: Get pnpm store directory
id: pnpm-store
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Use pnpm store
uses: actions/cache@v3
id: pnpm-cache
with:
path: ${{ steps.pnpm-store.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install Dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- run: pnpm build

test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile
- run: yarn test
- uses: codecov/codecov-action@v1
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 7
run_install: false

- name: Get pnpm store directory
id: pnpm-store
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Use pnpm store
uses: actions/cache@v3
id: pnpm-cache
with:
path: ${{ steps.pnpm-store.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install Dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- run: pnpm test
- uses: codecov/codecov-action@v1
16 changes: 9 additions & 7 deletions .github/workflows/size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2-beta
with:
fetch-depth: 1
- uses: preactjs/compressed-size-action@v1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
build-script: "build:ci"
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: preactjs/compressed-size-action@v1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
build-script: "build:ci"
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ example
.editorconfig
.gitignore
yarn.lock
pnpm-lock.yaml
.rpt2_cache
coverage
packages
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"author": "jdecroock <[email protected]> (https://twitter.com/JoviDeC)",
"private": false,
"scripts": {
"build": "rimraf dist && yarn build:preact && yarn build:react",
"build": "rimraf dist && pnpm build:preact && pnpm build:react",
"build:react": "microbundle --define process.env.NODE_ENV=production --external react --name hoofd --no-compress --output dist/ && cp ./dist/hoofd.module.js ./dist/hoofd.mjs",
"build:preact": "microbundle --define process.env.NODE_ENV=production --external preact --name hoofd --no-compress --output preact/dist --alias react=./preact/preact.ts && cp ./preact/dist/hoofd.module.js ./preact/dist/hoofd.mjs",
"build:ci": "microbundle --define process.env.NODE_ENV=production --external preact --name hoofd --output dist/",
"test": "jest",
"test:watch": "cross-env NODE_ENV=test yarn test -- --watch",
"prepublishOnly": "yarn test && yarn lint && yarn build",
"test:watch": "cross-env NODE_ENV=test pnpm test -- --watch",
"prepublishOnly": "pnpm test && pnpm lint && pnpm build",
"lint": "eslint . --ext .ts,.tsx"
},
"repository": {
Expand Down Expand Up @@ -59,11 +59,11 @@
"require": "./preact/dist/hoofd.js"
}
},
"dependencies": {},
"devDependencies": {
"@testing-library/jest-dom": "^5.3.0",
"@testing-library/react": "^10.0.2",
"@testing-library/react": "^14.0.0",
"@types/jest": "24.0.23",
"@types/node": "^18.16.1",
"@types/react": "16.9.16",
"@types/react-dom": "16.9.4",
"@typescript-eslint/eslint-plugin": "2.11.0",
Expand All @@ -78,10 +78,10 @@
"jest-cli": "^26.6.3",
"lint-staged": "9.5.0",
"microbundle": "0.12.4",
"preact": "^10.5.7",
"preact": "^10.13.2",
"prettier": "^2.0.2",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"rimraf": "^3.0.2",
"ts-jest": "^26.4.4",
"tslib": "^1.11.1",
Expand Down
Loading

0 comments on commit ca7bc83

Please sign in to comment.