Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turboo and esbuild #161

Merged
merged 13 commits into from Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 5 additions & 0 deletions .changeset/tasty-shirts-shout.md
@@ -0,0 +1,5 @@
---
'@icons-pack/react-simple-icons': major
---

Use esbuild to generate buld components
3 changes: 1 addition & 2 deletions .eslintignore
Expand Up @@ -9,5 +9,4 @@ scripts
.DS_Store
npm-debug.log

rollup.config.js
rollup.esm.config.js
tsup.config.js
32 changes: 0 additions & 32 deletions .github/workflows/check-pull-request.yml

This file was deleted.

58 changes: 58 additions & 0 deletions .github/workflows/pull_request_stats.yml
@@ -0,0 +1,58 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Check pull request

on:
pull_request:
branches:
- main

env:
TURBO_VERSION: 1.6.1
PNPM_VERSION: 7.12.1

jobs:
check_pull_request:
name: PR Stats
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/

# We use week in the turbo cache key to keep the cache from infinitely growing
- id: get-week
run: echo ::set-output name=WEEK::$(date +%U)

- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
with:
path: .turbo
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-
turbo-${{ github.job }}-canary-${{ steps.get-week.outputs.WEEK }}-

- name: 🔥 install pnpm
run: npm i pnpm@${PNPM_VERSION} -g --force

- name: Setup TURBO
run: npm i -g turbo@${TURBO_VERSION}

- name: 📦 Install Dependencies
run: |
pnpm install

- name: 🔥 generate:components
run: pnpm turbo run generate:components

- name: 💣 build
run: pnpm turbo run build
38 changes: 32 additions & 6 deletions .github/workflows/release.yml
Expand Up @@ -10,28 +10,54 @@ on:
release:
types: [created]

env:
TURBO_VERSION: 1.6.1
PNPM_VERSION: 7.12.1

jobs:
publish-npm:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/

# We use week in the turbo cache key to keep the cache from infinitely growing
- id: get-week
run: echo ::set-output name=WEEK::$(date +%U)

- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
with:
path: .turbo
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-
turbo-${{ github.job }}-canary-${{ steps.get-week.outputs.WEEK }}-

- name: 🔥 install pnpm
run: npm i pnpm@7.2.1 -g --force
run: npm i pnpm@${PNPM_VERSION} -g --force

- name: Setup TURBO
run: npm i -g turbo@${TURBO_VERSION}

- name: 📦 Install Dependencies
run: |
pnpm i
pnpm install

- name: 🔥 generate:components
run: pnpm generate:components
run: pnpm turbo run generate:components

- name: 💣 build
run: pnpm build
run: pnpm turbo run build

- name: Create Release Pull Request or Publish to GitHub Packages 📦
uses: changesets/action@v1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -26,3 +26,4 @@ lerna-debug.log
!.yarn/versions

package-lock.json
.turbo
2 changes: 1 addition & 1 deletion .prettierignore
Expand Up @@ -3,8 +3,8 @@ dist
.cache
node_modules
storybook
scripts

# Cruft
.DS_Store
npm-debug.log
tsup.config.js
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -3,7 +3,7 @@

# react-simple-icons

This package provides the [Simple Icons 7.17.0](https://github.com/simple-icons/simple-icons/releases/tag/7.17.0)
This package provides the [Simple Icons 7.19.0](https://github.com/simple-icons/simple-icons/releases/tag/7.19.0)
packaged as a set of [React](https://facebook.github.io/react/) components.

<a href="https://www.npmjs.com/package/@icons-pack/react-simple-icons" target="_blank">
Expand Down
40 changes: 17 additions & 23 deletions package.json
Expand Up @@ -25,24 +25,26 @@
"author": "Jorge Luis Calleja <jorge.calleja@wootsbot.dev>",
"source": "src/index.ts",
"types": "dist/index.d.ts",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"umd:main": "dist/index.umd.js",
"unpkg": "dist/index.umd.js",
"jsdelivr": "dist/index.umd.js",
"jsnext:main": "dist/esm/index.js",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"umd:main": "dist/index.js",
"unpkg": "dist/index.js",
"jsdelivr": "dist/index.js",
"jsnext:main": "dist/index.mjs",
"sideEffects": false,
"files": [
"dist"
],
"scripts": {
"clean": "rimraf dist",
"build": "pnpm clean && pnpm build:modern",
"build:modern": "rollup -c ./rollup.config.js",
"clean:build": "rimraf -rf dist",
"build": "pnpm clean:build && tsup && pnpm generate:declarations",
"bundlesize": "bundlesize",
"lint:types": "tsc --noEmit",
"clean:components": "rimraf -rf ./src/**",
"generate:components": "pnpm clean:components && node scripts/generate-components",
"clean:components": "rimraf -rf ./src/components/**",
"clean:files": "rimraf -rf ./src/index.ts",
"generate:components": "pnpm clean:components && pnpm clean:files && node scripts/generate-components",
"generate:declarations": "node scripts/generate-declarations",
"lint": "pnpm lint:eslint",
"lint:eslint": "eslint --fix .",
"prettier": "prettier --config .prettierrc \"./**/*.+(js|json|ts|tsx)\" --write",
Expand All @@ -59,14 +61,10 @@
]
},
"devDependencies": {
"@babel/core": "^7.18.2",
"@babel/preset-typescript": "^7.17.12",
"@changesets/changelog-github": "^0.4.5",
"@changesets/cli": "^2.22.0",
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@rollup/plugin-commonjs": "22.0.0",
"@rollup/plugin-node-resolve": "13.3.0",
"@types/react": "^18.0.12",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
Expand All @@ -85,16 +83,12 @@
"prettier-eslint": "^9.0.0",
"react": "^18.2.0",
"rimraf": "^3.0.2",
"rollup": "2.75.3",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-peer-deps-external": "2.2.4",
"rollup-plugin-sourcemaps": "0.6.3",
"rollup-plugin-terser": "7.0.2",
"rollup-plugin-typescript2": "0.31.2",
"signale": "^1.4.0",
"simple-icons": "7.17.0",
"typescript": "^4.7.3",
"uppercamelcase": "^3.0.0"
"simple-icons": "7.19.0",
"tsup": "6.3.0",
"turbo": "1.6.1",
"typescript": "4.7.3",
"uppercamelcase": "3.0.0"
},
"peerDependencies": {
"react": "^16.13 || ^17 || ^18"
Expand Down