Skip to content
Open
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
7 changes: 7 additions & 0 deletions .changeset/floppy-regions-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@teiler/svelte': patch
'@teiler/core': patch
'@teiler/vue': patch
---

Migrate to pnpm + rolldown, update all deps
20 changes: 11 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,25 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Enable corepack
run: corepack enable
- uses: actions/cache@v4
id: yarn-cache
id: pnpm-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ~/.local/share/pnpm/store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-pnpm-
- name: Install Dependencies
run: yarn install
run: pnpm install
- name: Build
run: yarn build
run: pnpm build
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
version: yarn changeset:version
publish: yarn changeset:publish
version: pnpm changeset:version
publish: pnpm changeset:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
68 changes: 38 additions & 30 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,86 +9,94 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
node-version: [20.x, 22.x, 24.x]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Enable corepack
run: corepack enable
- uses: actions/cache@v4
id: yarn-cache
id: pnpm-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ~/.local/share/pnpm/store
key: ${{ runner.os }}-${{ matrix.node-version }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-yarn-
${{ runner.os }}-${{ matrix.node-version }}-pnpm-
- name: Install Dependencies
run: yarn install
run: pnpm install
- name: Run tests
run: yarn test -- --ci --coverage
run: pnpm test -- --ci --coverage
storybook:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
node-version: [20.x, 22.x, 24.x]
package: [{ name: 'svelte', port: 6006 }, { name: 'vue', port: 6007 }]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Enable corepack
run: corepack enable
- uses: actions/cache@v4
id: yarn-cache
id: pnpm-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ~/.local/share/pnpm/store
key: ${{ runner.os }}-${{ matrix.node-version }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-yarn-
${{ runner.os }}-${{ matrix.node-version }}-pnpm-
- name: Install Dependencies
run: |
yarn install
yarn playwright install --with-deps chromium
pnpm install
pnpm playwright install --with-deps chromium
- name: Build
run: yarn build
run: pnpm build
- name: Run tests
run: |
cd packages/${{ matrix.package.name }}
yarn dlx concurrently -k -s first -n "STORYBOOK,TEST" -c "magenta,blue" \
"yarn storybook" \
"yarn dlx wait-on tcp:${{ matrix.package.port }} && yarn test-storybook --url http://localhost:${{ matrix.package.port }}"
pnpm dlx concurrently -k -s first -n "STORYBOOK,TEST" -c "magenta,blue" \
"pnpm storybook" \
"pnpm dlx wait-on tcp:${{ matrix.package.port }} && pnpm test-storybook --url http://localhost:${{ matrix.package.port }}"
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Enable corepack
run: corepack enable
- uses: actions/cache@v4
id: yarn-cache
id: pnpm-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ~/.local/share/pnpm/store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-pnpm-
- name: Install Dependencies
run: yarn install
run: pnpm install
- name: Run tests
run: yarn lint
run: pnpm lint
format:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Enable corepack
run: corepack enable
- uses: actions/cache@v4
id: yarn-cache
id: pnpm-cache
with:
path: .yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ~/.local/share/pnpm/store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-pnpm-
- name: Install Dependencies
run: yarn install
run: pnpm install
- name: Run tests
run: yarn check-format
run: pnpm check-format
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.1.0.cjs

This file was deleted.

12 changes: 0 additions & 12 deletions .yarnrc.yml

This file was deleted.

34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "teiler",
"private": true,
"packageManager": "yarn@4.1.0",
"packageManager": "pnpm@10.23.0",
"workspaces": [
"packages/*"
],
Expand All @@ -11,30 +11,30 @@
"lint": "eslint packages/*/src",
"check-format": "prettier -c packages/**/src/*",
"dev": "turbo run dev",
"changeset:version": "changeset version && yarn install --mode=update-lockfile",
"changeset:version": "changeset version && pnpm install --lockfile-only",
"changeset:publish": "changeset publish",
"storybook": "storybook dev -p 6005",
"storybook-packages": "turbo run storybook",
"wait": "wait-on tcp:6006 && wait-on tcp:6007"
},
"devDependencies": {
"@changesets/changelog-github": "^0.5.1",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.31.0",
"@storybook/html-vite": "^8.6.14",
"@typescript-eslint/eslint-plugin": "^8.38.0",
"@typescript-eslint/parser": "^8.38.0",
"eslint": "^9.31.0",
"playwright": "^1.54.1",
"prettier": "^3.6.2",
"@changesets/changelog-github": "^0.7.0",
"@eslint/eslintrc": "^3.3.5",
"@eslint/js": "^10.0.1",
"@storybook/html-vite": "^10.4.2",
"@typescript-eslint/eslint-plugin": "^8.60.1",
"@typescript-eslint/parser": "^8.60.1",
"eslint": "^10.4.1",
"playwright": "^1.60.0",
"prettier": "^3.8.3",
"prettier-plugin-svelte": "^3.4.0",
"storybook": "^8.6.14",
"turbo": "^2.5.5",
"typescript": "^5.8.3",
"vite": "^5.4.19",
"wait-on": "^7.2.0"
"storybook": "^10.4.2",
"turbo": "^2.9.16",
"typescript": "^6.0.3",
"vite": "^8.0.16",
"wait-on": "^9.0.10"
},
"dependencies": {
"@changesets/cli": "^2.29.5"
"@changesets/cli": "^2.31.0"
}
}
19 changes: 7 additions & 12 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,23 @@
"./package.json": "./package.json"
},
"scripts": {
"build": "rollup --config --bundleConfigAsCjs",
"dev": "rollup --config --bundleConfigAsCjs --watch",
"build": "rolldown --config",
"dev": "rolldown --config --watch",
"test": "jest",
"wait": "wait-on dist/teiler-core.cjs.js"
},
"dependencies": {
"stylis": "^4.3.6"
"stylis": "^4.4.0"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@rollup/plugin-commonjs": "^28.0.6",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.3.1",
"@rollup/plugin-swc": "^0.4.0",
"@swc/core": "^1.13.2",
"@swc/core": "^1.15.40",
"@swc/jest": "^0.2.39",
"@types/stylis": "^4.2.7",
"jest": "^29.7.0",
"jsdom": "^25.0.1",
"rollup": "^4.45.1",
"rollup-plugin-dts": "^6.2.1",
"rollup-plugin-terser": "^7.0.2",
"typescript": "^5.8.3"
"rolldown": "^1.1.0",
"rolldown-plugin-dts": "^0.25.2",
"typescript": "^6.0.3"
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
import commonjs from '@rollup/plugin-commonjs'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import json from '@rollup/plugin-json'
import swc from '@rollup/plugin-swc';
import dts from 'rollup-plugin-dts'

import { terser } from 'rollup-plugin-terser'

const defaultPlugins = [
commonjs(),
nodeResolve({ extensions: ['.ts'], }),
json(),
swc(),
terser(),
]
import { dts } from 'rolldown-plugin-dts'

export default [
{
Expand All @@ -35,18 +21,18 @@ export default [
sourcemap: true,
},
],
plugins: defaultPlugins,
watch: {
clearScreen: false
}
},
{
input: 'src/index.ts',
output: {
file: `dist/teiler-core.d.ts`,
dir: 'dist',
format: 'es',
entryFileNames: (chunk) => chunk.name.endsWith('.d') ? 'teiler-core.d.ts' : '_entry.js',
},
plugins: [dts.default()],
plugins: [dts({ emitDtsOnly: true })],
watch: {
clearScreen: false
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function compile<Props>(styles: Array<Style<Props>>, props: Arguments<Props>): C
const property = properties.at(index)

if (property) {
let value = null
let value: unknown
if ((typeof property === 'object' || typeof property === 'function') && 'styleDefinition' in property) {
const styleDefinition = property.styleDefinition as StyleDefinition<HTMLElements, Props>
result.definitions = [...result.definitions, styleDefinition]
Expand Down
16 changes: 2 additions & 14 deletions packages/svelte/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
import type { StorybookConfig } from '@storybook/svelte-vite'

import { join, dirname } from 'path'

/**
* This function is used to resolve the absolute path of a package.
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
*/
function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, 'package.json')))
}

const config: StorybookConfig = {
stories: ['../stories/*.mdx', '../stories/*.stories.@(js|jsx|ts|tsx|svelte)'],
addons: [getAbsolutePath('@storybook/addon-links'), getAbsolutePath('@storybook/addon-essentials'), getAbsolutePath('@chromatic-com/storybook'), getAbsolutePath('@storybook/addon-interactions')],

addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@chromatic-com/storybook', '@storybook/addon-interactions'],
framework: {
name: getAbsolutePath('@storybook/svelte-vite'),
name: '@storybook/svelte-vite',
options: {},
},

docs: {}
}
export default config
Loading
Loading