Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
name: CI

on: { push: { branches-ignore: 'wip/**' } }
on: { push: { branches-ignore: wip/** } }

jobs:
ci:
name: Checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up pnpm
uses: pnpm/action-setup@v4
with: { version: latest }

- name: Set up Node.js
uses: actions/setup-node@v6
with: { node-version: latest, cache: pnpm }
- name: Set up Bun
uses: oven-sh/setup-bun@v2

- name: Install deps
run: pnpm install
run: bun i --filter './packages/*'

- name: Build
run: pnpm build:prod
run: bun build:prod

- name: Test
run: pnpm test
run: bun run test

- name: Lint
run: pnpm lint
run: bun lint
35 changes: 14 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on: { push: { tags: '**@[0-9]+.[0-9]+.[0-9]+*' } }

jobs:
release:
name: Release & Publish
runs-on: ubuntu-latest
permissions:
contents: write # for creating a GitHub release
Expand All @@ -14,54 +13,48 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with: { ref: 'main' } # attach HEAD to 'main'

- name: Set up pnpm
uses: pnpm/action-setup@v4
with: { version: latest }

- name: Set up Node.js
uses: actions/setup-node@v6
with: { node-version: latest, cache: pnpm, registry-url: https://registry.npmjs.org }
with: { node-version: latest, registry-url: https://registry.npmjs.org }

- name: Set up Bun
uses: oven-sh/setup-bun@v2

- name: Set env variables
run: |
[[ $TAG =~ ^((@.+?\/)?(.+))@(.+)$ ]]
PACKAGE=${BASH_REMATCH[1]}
DIR=${BASH_REMATCH[3]}
VERSION=${BASH_REMATCH[4]}
ARCHIVE=${PACKAGE/@rawstyle\//rawstyle-}-v$VERSION.zip
echo -e "DIR=$DIR\nPACKAGE=$PACKAGE\nVERSION=$VERSION\nARCHIVE=$ARCHIVE" >> $GITHUB_ENV
ZIP=${PACKAGE/@rawstyle\//rawstyle-}-v$VERSION.zip
echo -e "DIR=$DIR\nPACKAGE=$PACKAGE\nVERSION=$VERSION\nZIP=$ZIP" >> $GITHUB_ENV

- name: Install deps
run: pnpm install
run: bun i

- name: Build
run: pnpm build:prod
run: bun build:prod

- name: Test
run: pnpm test
run: bun run test

- name: Lint
working-directory: packages/${{ env.DIR }}
run: pnpm lint
run: bun lint

- name: Create release archive
- name: Create ZIP
working-directory: packages/${{ env.DIR }}
run: |
cp ../../LICENSE .
zip -r $ARCHIVE dist package.json LICENSE \
zip -r $ZIP dist package.json LICENSE \
$([[ $DIR == "rawstyle" ]] && cp ../../README.md . && echo README.md || true)
rm -f LICENSE README.md

- name: Publish to npm
working-directory: packages/${{ env.DIR }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm publish --access public --provenance
run: npm publish --access public

- name: Create GitHub release
working-directory: packages/${{ env.DIR }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create $TAG --title $TAG --draft $ARCHIVE
run: gh release create $TAG --title $TAG --draft $ZIP
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules
dist
examples/**/pnpm-lock.yaml
*.zip
1,189 changes: 1,189 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions examples/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "next build",
"start": "next start",
"lint": "eslint",
"prepare": "next-dont"
"prepare": "bunx next-dont"
},
"dependencies": {
"next": "^16.2.1",
Expand All @@ -18,7 +18,7 @@
"@eslint-react/eslint-plugin": "^2.13.0",
"@eslint/js": "^10.0.1",
"@next/eslint-plugin-next": "^16.2.1",
"@rawstyle/next": "link:..\\..\\packages\\next",
"@rawstyle/next": "../../packages/next",
"@stylistic/eslint-plugin": "^5.10.0",
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
"@types/node": "^25.5.0",
Expand All @@ -30,9 +30,8 @@
"eslint-plugin-react-hooks": "^7.0.1",
"jiti": "^2.6.1",
"next-dont": "^0.1.4",
"rawstyle": "link:..\\..\\packages\\rawstyle",
"rawstyle": "../../packages/rawstyle",
"rawstyle-eslint": "^0.1.2",
"tsx": "^4.21.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.58.0"
}
Expand Down
1 change: 0 additions & 1 deletion examples/next/pnpm-workspace.yaml

This file was deleted.

7 changes: 3 additions & 4 deletions examples/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,21 @@
"devDependencies": {
"@eslint-react/eslint-plugin": "^2.13.0",
"@eslint/js": "^10.0.1",
"@rawstyle/vite": "link:..\\..\\packages\\vite",
"@rawstyle/vite": "../../packages/vite",
"@stylistic/eslint-plugin": "^5.10.0",
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
"@types/node": "^25.5.0",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.2.0",
"@vitejs/plugin-react": "^6.0.1",
"eslint": "^10.1.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1",
"jiti": "^2.6.1",
"rawstyle": "link:..\\..\\packages\\rawstyle",
"rawstyle": "../../packages/rawstyle",
"rawstyle-eslint": "^0.1.2",
"rolldown-vite": "^7.3.1",
"tsx": "^4.21.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.58.0"
}
Expand Down
1 change: 0 additions & 1 deletion examples/vite/pnpm-workspace.yaml

This file was deleted.

17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
{
"type": "module",
"workspaces": ["packages/*", "examples/*"],
"scripts": {
"build": "pnpm -r build",
"build:watch": "pnpm -r --parallel build:watch",
"build:prod": "pnpm -r build:prod",
"lint": "pnpm -r lint",
"test": "pnpm -r test"
"build": "bun -F './packages/*' build",
"build:watch": "bun --parallel -F './packages/*' build:watch",
"build:prod": "bun -F './packages/*' build:prod",
"lint": "bun -F './packages/*' lint",
"test": "bun -F './packages/*' test"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@stylistic/eslint-plugin": "^5.10.0",
"@types/node": "^25.5.0",
"@types/bun": "^1.3.11",
"eslint": "^10.1.0",
"jiti": "^2.6.1",
"relion": "^0.44.3",
"tsdown": "0.21.7",
"typescript": "^6.0.2",
"typescript-eslint": "^8.58.0",
"vitest": "^4.1.2"
"typescript-eslint": "^8.58.0"
}
}
5 changes: 2 additions & 3 deletions packages/create-rawstyle/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
{
"name": "create-rawstyle",
"version": "0.1.4",
"version": "0.1.5",
"description": "🚀 Rawstyle project generator",
"author": "kh4f <kh4f.dev@gmail.com>",
"license": "MIT",
"repository": "https://github.com/rawstylecss/rawstyle",
"bugs": "https://github.com/rawstylecss/rawstyle/issues",
"homepage": "https://github.com/rawstylecss/rawstyle#readme",
"keywords": ["rawstyle", "create-rawstyle", "css-in-js"],
"relion": { "tagPrefix": "create-rawstyle@" },
"files": ["dist"],
"bin": "dist/index.js",
"type": "module",
Expand All @@ -17,7 +16,7 @@
"build:watch": "tsdown --watch",
"build:prod": "tsdown --prod",
"lint": "eslint",
"release": "relion"
"release": "bunx relion -t create-rawstyle@"
},
"dependencies": {
"@clack/prompts": "^1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-rawstyle/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { intro, select, spinner, text, outro } from '@clack/prompts'
import { downloadTemplate } from 'giget'
import { handleCancel, resolveLinkedDeps } from '@/utils'
import { handleCancel, resolveLinkedDeps } from './utils'

void (async () => {
console.log()
Expand Down
6 changes: 0 additions & 6 deletions packages/create-rawstyle/tsconfig.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build:watch": "tsdown --watch",
"build:prod": "tsdown --prod",
"lint": "eslint",
"release": "relion"
"release": "bunx relion"
},
"peerDependencies": {
"rawstyle": "workspace:>=0.6",
Expand Down
6 changes: 0 additions & 6 deletions packages/next/tsconfig.json

This file was deleted.

5 changes: 2 additions & 3 deletions packages/rawstyle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"bugs": "https://github.com/rawstylecss/rawstyle/issues",
"homepage": "https://github.com/rawstylecss/rawstyle#readme",
"keywords": ["rawstyle", "rawstyle-core", "css-in-js"],
"relion": { "tagPrefix": "rawstyle@" },
"files": ["dist", "README.md"],
"type": "module",
"exports": {
Expand All @@ -21,8 +20,8 @@
"build:watch": "tsdown --watch",
"build:prod": "tsdown --prod",
"lint": "eslint",
"test": "vitest",
"release": "relion",
"test": "bun test",
"release": "bunx relion -t rawstyle@",
"prepack": "cp ../../README.md .",
"postpack": "rm README.md"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/rawstyle/src/transformer.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect } from 'vitest'
import { describe, it, expect } from 'bun:test'
import { transform } from './transformer'
import { dedent } from './utils'

Expand Down
4 changes: 2 additions & 2 deletions packages/rawstyle/src/transformer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { parseSync, Visitor } from 'oxc-parser'
import { generateHash, dedent } from '@/utils'
import type { TransformResult, Replacement } from '@/types'
import { generateHash, dedent } from './utils'
import type { TransformResult, Replacement } from './types'

export const transform = (file: string, source: string): TransformResult => {
const { program } = parseSync(file, source)
Expand Down
6 changes: 0 additions & 6 deletions packages/rawstyle/tsconfig.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build:watch": "tsdown --watch",
"build:prod": "tsdown --prod",
"lint": "eslint",
"release": "relion"
"release": "bunx relion"
},
"peerDependencies": {
"rawstyle": "workspace:>=0.6",
Expand Down
5 changes: 3 additions & 2 deletions packages/vite/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { Plugin } from 'rolldown-vite'
import { TRANSFORMABLE_EXT, VIRTUAL_PREFIX, RESOLVED_PREFIX } from 'rawstyle'
import { transform } from 'rawstyle/transformer'
import { normalizePath } from '@/utils'

const styles = new Map<string, string>()

Expand Down Expand Up @@ -41,4 +40,6 @@ export default (): Plugin => ({
styles.set(cssId, css)
if (mod) return [...modules, mod]
},
})
})

const normalizePath = (path: string) => path.replace(/\\/g, '/')
1 change: 0 additions & 1 deletion packages/vite/src/utils.ts

This file was deleted.

6 changes: 0 additions & 6 deletions packages/vite/tsconfig.json

This file was deleted.

Loading
Loading