Skip to content

Commit 74d3635

Browse files
authored
feat: prepare for 2.x (#33)
* feat: change to changesets * refactor: tailwindcss-patch * chore: tailwindcss-mangle-core to vitest * chore: remove jest to vitest * chore: unbuild to tailwindcss-patch * chore: unbuild all pkgs * feat: unbuild and cjs bridge * chore: add multiple platform * fix: multple platform * chore: commit setup file
1 parent 5f779d8 commit 74d3635

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1810
-2226
lines changed

.changeset/config.json

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

.github/FUNDING.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository
2+
3+
github: [sonofmagic]
4+
custom: ["https://github.com/sonofmagic/sponsors"]

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
# push:
5+
# branches: ['main']
6+
pull_request:
7+
types: [opened, synchronize]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
name: Build and Test
13+
timeout-minutes: 15
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, windows-latest, macos-latest]
18+
node-version: [16, 18]
19+
runs-on: ${{ matrix.os }}
20+
# To use Remote Caching, uncomment the next lines and follow the steps below.
21+
# env:
22+
# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
23+
# TURBO_TEAM: ${{ vars.TURBO_TEAM }}
24+
25+
steps:
26+
- name: Check out code
27+
uses: actions/checkout@v3
28+
with:
29+
fetch-depth: 2
30+
31+
- uses: pnpm/action-setup@v2
32+
33+
- name: Setup Node.js environment
34+
uses: actions/setup-node@v3
35+
with:
36+
node-version: ${{ matrix.node-version }}
37+
cache: 'pnpm'
38+
39+
- name: Install dependencies
40+
run: pnpm install
41+
42+
- name: Build
43+
run: pnpm build
44+
45+
- name: Test
46+
run: pnpm test

.github/workflows/release.yml

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,41 @@
11
name: Release
22

3-
permissions:
4-
contents: write
5-
63
on:
74
push:
8-
tags:
9-
- 'v*'
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
concurrency: ${{ github.workflow }}-${{ github.ref }}
1010

1111
jobs:
1212
release:
13-
permissions:
14-
id-token: write
13+
name: Release
1514
runs-on: ubuntu-latest
1615
steps:
17-
- uses: actions/checkout@v3
18-
with:
19-
fetch-depth: 0
16+
- name: Checkout Repo
17+
uses: actions/checkout@v3
2018

21-
- name: Install pnpm
22-
uses: pnpm/action-setup@v2
19+
- uses: pnpm/action-setup@v2
2320

24-
- name: Set node
21+
- name: Setup Node.js environment
2522
uses: actions/setup-node@v3
2623
with:
2724
node-version: 18
28-
cache: pnpm
29-
registry-url: 'https://registry.npmjs.org'
30-
31-
# - run: npx changelogithub
32-
# continue-on-error: true
33-
# env:
34-
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
25+
cache: 'pnpm'
3526

3627
- name: Install Dependencies
3728
run: pnpm i
3829

39-
- name: PNPM build
40-
run: pnpm run build:pkg
41-
42-
- name: Publish to NPM
43-
run: pnpm -r --filter=./packages/* publish --access public --no-git-checks
30+
- name: Create Release Pull Request or Publish to npm
31+
id: changesets
32+
uses: changesets/action@v1
33+
with:
34+
# This expects you to have a script called release which does a build for your packages and calls changeset publish
35+
publish: pnpm publish-packages
4436
env:
45-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
46-
NPM_CONFIG_PROVENANCE: true
37+
# this doesn't work but semantic-release works
38+
# see https://github.com/sonofmagic/npm-lib-rollup-template/blob/main/.github/workflows/release.yml#L46
39+
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

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

apps/remix-app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"name": "remix-app",
23
"private": true,
34
"sideEffects": false,
45
"scripts": {

jest.config.ts

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

package.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,38 @@
77
"packages/*"
88
],
99
"scripts": {
10-
"build": "pnpm run -r build",
11-
"build:pkg": "pnpm run -r --filter=./packages/* build",
10+
"build": "pnpm run -r --filter=./packages/* build",
1211
"build:app": "pnpm run -r --filter=./apps/* build ",
1312
"dev": "pnpm -r --parallel run dev",
1413
"dev:pkg": "pnpm -r --filter=./packages/* --parallel run dev",
15-
"test": "pnpm run -r --filter=./packages/* test ",
14+
"test": "vitest run --coverage.enabled",
1615
"lint": "pnpm run -r lint",
1716
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
1817
"preinstall": "npx only-allow pnpm",
19-
"release": "bumpp -r",
20-
"sync": "cnpm sync tailwindcss-mangle-shared tailwindcss-patch unplugin-tailwindcss-mangle tailwindcss-mangle-core"
18+
"sync": "cnpm sync tailwindcss-mangle-shared tailwindcss-patch unplugin-tailwindcss-mangle tailwindcss-mangle-core",
19+
"publish-packages": "pnpm run build && pnpm run test && changeset version && changeset publish"
2120
},
2221
"devDependencies": {
22+
"@changesets/changelog-github": "^0.4.8",
23+
"@changesets/cli": "^2.26.2",
2324
"@icebreakers/eslint-config-ts": "^1.2.2",
2425
"@icebreakers/rollup": "^0.4.0",
2526
"@icebreakers/tsconfig": "^0.0.7",
2627
"@tsconfig/recommended": "^1.0.2",
27-
"@types/jest": "^29.5.3",
2828
"@types/node": "^20.4.8",
2929
"@vitest/coverage-v8": "^0.34.1",
30-
"bumpp": "^9.1.1",
3130
"cross-env": "^7.0.3",
3231
"eslint": "^8.46.0",
3332
"eslint-plugin-unicorn": "^48.0.1",
34-
"jest": "^29.6.2",
3533
"only-allow": "^1.1.1",
3634
"prettier": "^3.0.1",
3735
"rollup": "^3.27.2",
3836
"tailwindcss-mangle-core": "workspace:*",
3937
"tailwindcss-mangle-shared": "workspace:*",
4038
"tailwindcss-patch": "workspace:*",
41-
"ts-jest": "^29.1.1",
4239
"ts-node": "^10.9.1",
4340
"typescript": "^5.1.6",
41+
"unbuild": "^1.2.1",
4442
"unplugin-tailwindcss-mangle": "workspace:*",
4543
"vitest": "^0.34.1"
4644
},

packages/core/build.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineBuildConfig } from 'unbuild'
2+
3+
export default defineBuildConfig({
4+
rollup: {
5+
inlineDependencies: true
6+
}
7+
// devDependencies: ['defu', '@parse5/tools']
8+
})

packages/core/jest.config.ts

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

0 commit comments

Comments
 (0)