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

Rewrite build script to build all packages in one process (Removes CJS) #701

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft
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
86 changes: 86 additions & 0 deletions .changeset/ninety-glasses-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
"@solid-primitives/intersection-observer": minor
"@solid-primitives/broadcast-channel": minor
"@solid-primitives/mutation-observer": minor
"@solid-primitives/controlled-props": minor
"@solid-primitives/event-dispatcher": minor
"@solid-primitives/transition-group": minor
"@solid-primitives/page-visibility": minor
"@solid-primitives/resize-observer": minor
"@solid-primitives/signal-builders": minor
"@solid-primitives/active-element": minor
"@solid-primitives/event-listener": minor
"@solid-primitives/jsx-tokenizer": minor
"@solid-primitives/script-loader": minor
"@solid-primitives/state-machine": minor
"@solid-primitives/connectivity": minor
"@solid-primitives/static-store": minor
"@solid-primitives/destructure": minor
"@solid-primitives/event-props": minor
"@solid-primitives/geolocation": minor
"@solid-primitives/filesystem": minor
"@solid-primitives/flux-store": minor
"@solid-primitives/fullscreen": minor
"@solid-primitives/input-mask": minor
"@solid-primitives/pagination": minor
"@solid-primitives/permission": minor
"@solid-primitives/analytics": minor
"@solid-primitives/autofocus": minor
"@solid-primitives/clipboard": minor
"@solid-primitives/event-bus": minor
"@solid-primitives/immutable": minor
"@solid-primitives/lifecycle": minor
"@solid-primitives/scheduled": minor
"@solid-primitives/selection": minor
"@solid-primitives/websocket": minor
"@solid-primitives/gestures": minor
"@solid-primitives/keyboard": minor
"@solid-primitives/platform": minor
"@solid-primitives/presence": minor
"@solid-primitives/resource": minor
"@solid-primitives/rootless": minor
"@solid-primitives/context": minor
"@solid-primitives/devices": minor
"@solid-primitives/graphql": minor
"@solid-primitives/history": minor
"@solid-primitives/masonry": minor
"@solid-primitives/mutable": minor
"@solid-primitives/pointer": minor
"@solid-primitives/promise": minor
"@solid-primitives/storage": minor
"@solid-primitives/trigger": minor
"@solid-primitives/virtual": minor
"@solid-primitives/workers": minor
"@solid-primitives/bounds": minor
"@solid-primitives/cursor": minor
"@solid-primitives/marker": minor
"@solid-primitives/scroll": minor
"@solid-primitives/spring": minor
"@solid-primitives/stream": minor
"@solid-primitives/styles": minor
"@solid-primitives/upload": minor
"@solid-primitives/audio": minor
"@solid-primitives/fetch": minor
"@solid-primitives/keyed": minor
"@solid-primitives/media": minor
"@solid-primitives/mouse": minor
"@solid-primitives/props": minor
"@solid-primitives/range": minor
"@solid-primitives/share": minor
"@solid-primitives/start": minor
"@solid-primitives/timer": minor
"@solid-primitives/tween": minor
"@solid-primitives/utils": minor
"@solid-primitives/date": minor
"@solid-primitives/deep": minor
"@solid-primitives/i18n": minor
"@solid-primitives/idle": minor
"@solid-primitives/list": minor
"@solid-primitives/memo": minor
"@solid-primitives/refs": minor
"@solid-primitives/map": minor
"@solid-primitives/raf": minor
"@solid-primitives/set": minor
---

Remove CJS support. The package is ESM only now.
8 changes: 0 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ jobs:
- name: Install Dependencies
run: pnpm i

- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: node_modules/.cache/turbo
key: turbo-${{ github.sha }}
restore-keys: |
turbo-

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: node_modules/.cache/turbo
key: turbo-${{ github.sha }}
restore-keys: |
turbo-

- name: Build all packages
run: pnpm build

Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ temp/

tsup.config.bundled*.mjs

# turbo
.turbo

# vite
vite.config.ts.js
vitest.config.ts.timestamp-*.mjs
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

# Solid Primitives

[![pnpm](https://img.shields.io/badge/maintained%20with-pnpm-cc00ff.svg?style=for-the-badge&logo=pnpm)](https://pnpm.io/)
[![turborepo](https://img.shields.io/badge/built%20with-turborepo-cc00ff.svg?style=for-the-badge&logo=turborepo)](https://turborepo.org/)<!-- INSERT-NPM-DOWNLOADS-BADGE:START -->
[![pnpm](https://img.shields.io/badge/maintained%20with-pnpm-cc00ff.svg?style=for-the-badge&logo=pnpm)](https://pnpm.io/)<!-- INSERT-NPM-DOWNLOADS-BADGE:START -->
[![combined-downloads](https://img.shields.io/endpoint?style=for-the-badge&url=https://combined-npm-downloads.deno.dev/@solid-primitives/utils,@solid-primitives/broadcast-channel,@solid-primitives/context,@solid-primitives/cookies,@solid-primitives/devices,@solid-primitives/event-dispatcher,@solid-primitives/event-props,@solid-primitives/fetch,@solid-primitives/filesystem,@solid-primitives/flux-store,@solid-primitives/i18n,@solid-primitives/idle,@solid-primitives/input-mask,@solid-primitives/keyed,@solid-primitives/lifecycle,@solid-primitives/list,@solid-primitives/marker,@solid-primitives/mutable,@solid-primitives/permission,@solid-primitives/platform,@solid-primitives/resource,@solid-primitives/scheduled,@solid-primitives/script-loader,@solid-primitives/selection,@solid-primitives/share,@solid-primitives/spring,@solid-primitives/state-machine,@solid-primitives/timer,@solid-primitives/transition-group,@solid-primitives/tween,@solid-primitives/websocket,@solid-primitives/workers)](https://dash.deno.com/playground/combined-npm-downloads)
<!-- INSERT-NPM-DOWNLOADS-BADGE:END -->

Expand Down
4 changes: 2 additions & 2 deletions configs/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import * as utils from "../scripts/utils/index.js"
const package_name = utils.getPackageNameFromCWD()

if (package_name == null) {
utils.logLine("Testing ALL packages...")
utils.log_info("Testing ALL packages...")
} else {
utils.logLine("Testing "+package_name+" package...")
utils.log_info("Testing "+package_name+" package...")
}

const from_root = package_name == null
Expand Down
18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"test:client": "vitest -c ./configs/vitest.config.ts",
"test:ssr": "pnpm run test:client --mode ssr",
"test": "pnpm run test:client && pnpm run test:ssr",
"build:ci": "turbo run build --filter='./packages/*'",
"build": "pnpm run build:ci --concurrency=50%",
"build": "tsx ./scripts/build.ts",
"new-package": "tsx ./scripts/new-package.ts",
"update-readme": "tsx ./scripts/update-readme.ts",
"measure": "tsx ./scripts/measure.ts",
Expand All @@ -29,11 +28,13 @@
},
"devDependencies": {
"@changesets/cli": "^2.27.8",
"@solidjs/start": "^1.0.6",
"@types/jsdom": "^21.1.7",
"@types/node": "^22.5.4",
"@typescript-eslint/eslint-plugin": "^8.5.0",
"@typescript-eslint/parser": "^8.5.0",
"esbuild": "^0.19.11",
"esbuild-plugin-solid": "^0.6.0",
"eslint": "^9.10.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-no-only-tests": "^3.3.0",
Expand All @@ -46,18 +47,15 @@
"rehype-slug": "^6.0.0",
"remark-gfm": "^4.0.0",
"solid-js": "^1.8.22",
"@solidjs/start": "^1.0.6",
"tsup": "^8.2.4",
"tsup-preset-solid": "^2.2.0",
"tsx": "^4.19.1",
"turbo": "^1.12.5",
"vinxi": "^0.4.2",
"vite-plugin-solid": "^2.10.2",
"typescript": "~5.6.2",
"valibot": "^0.20.1",
"vinxi": "^0.4.2",
"vite": "5.4.4",
"vite-plugin-solid": "^2.10.2",
"vitest": "^2.1.0"
},
"packageManager": "pnpm@9.9.0",
"engines": {"node": ">=20.0.0"}
"engines": {
"node": ">=20.0.0"
}
}
1 change: 0 additions & 1 deletion packages/active-element/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

# @solid-primitives/active-element

[![turborepo](https://img.shields.io/badge/built%20with-turborepo-cc00ff.svg?style=for-the-badge&logo=turborepo)](https://turborepo.org/)
[![size](https://img.shields.io/bundlephobia/minzip/@solid-primitives/active-element?style=for-the-badge)](https://bundlephobia.com/package/@solid-primitives/active-element)
[![size](https://img.shields.io/npm/v/@solid-primitives/active-element?style=for-the-badge)](https://www.npmjs.com/package/@solid-primitives/active-element)
[![stage](https://img.shields.io/endpoint?style=for-the-badge&url=https%3A%2F%2Fraw.githubusercontent.com%2Fsolidjs-community%2Fsolid-primitives%2Fmain%2Fassets%2Fbadges%2Fstage-3.json)](https://github.com/solidjs-community/solid-primitives#contribution-process)
Expand Down
5 changes: 0 additions & 5 deletions packages/active-element/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,13 @@
"dist"
],
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"browser": {},
"types": "./dist/index.d.ts",
"exports": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"scripts": {
Expand Down
20 changes: 17 additions & 3 deletions packages/active-element/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{
"extends": "../../tsconfig.json",
"include": ["./src", "./test", "./dev", "./demo"],
"exclude": ["node_modules", "./dist"]
}
"compilerOptions": {
"composite": true,
"outDir": "dist",
"rootDir": "src"
},
"references": [
{
"path": "../event-listener"
},
{
"path": "../utils"
}
],
"include": [
"src"
]
}
1 change: 0 additions & 1 deletion packages/analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Category: Utilities

# @solid-primitives/analytics

[![turborepo](https://img.shields.io/badge/built%20with-turborepo-cc00ff.svg?style=for-the-badge&logo=turborepo)](https://turborepo.org/)
[![stage](https://img.shields.io/endpoint?style=for-the-badge&url=https%3A%2F%2Fraw.githubusercontent.com%2Fsolidjs-community%2Fsolid-primitives%2Fmain%2Fassets%2Fbadges%2Fstage-0.json)](https://github.com/solidjs-community/solid-primitives#contribution-process)

Creates a primitive for analytics management.
Expand Down
5 changes: 0 additions & 5 deletions packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,13 @@
"url": "https://github.com/solidjs-community/solid-primitives/tree/main/packages/analytics"
},
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"browser": {},
"types": "./dist/index.d.ts",
"exports": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"files": [
Expand Down
13 changes: 11 additions & 2 deletions packages/analytics/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{
"extends": "../../tsconfig.json"
}
"extends": "../../tsconfig.json",
"compilerOptions": {
"composite": true,
"outDir": "dist",
"rootDir": "src"
},
"references": [],
"include": [
"src"
]
}
1 change: 0 additions & 1 deletion packages/audio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

# @solid-primitives/audio

[![turborepo](https://img.shields.io/badge/built%20with-turborepo-cc00ff.svg?style=for-the-badge&logo=turborepo)](https://turborepo.org/)
[![size](https://img.shields.io/bundlephobia/minzip/@solid-primitives/audio?style=for-the-badge)](https://bundlephobia.com/package/@solid-primitives/audio)
[![size](https://img.shields.io/npm/v/@solid-primitives/audio?style=for-the-badge)](https://www.npmjs.com/package/@solid-primitives/audio)
[![stage](https://img.shields.io/endpoint?style=for-the-badge&url=https%3A%2F%2Fraw.githubusercontent.com%2Fsolidjs-community%2Fsolid-primitives%2Fmain%2Fassets%2Fbadges%2Fstage-3.json)](https://github.com/solidjs-community/solid-primitives#contribution-process)
Expand Down
5 changes: 0 additions & 5 deletions packages/audio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,13 @@
"private": false,
"sideEffects": false,
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"browser": {},
"types": "./dist/index.d.ts",
"exports": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"typesVersions": {},
Expand Down
20 changes: 18 additions & 2 deletions packages/audio/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
{
"extends": "../../tsconfig.json"
}
"extends": "../../tsconfig.json",
"compilerOptions": {
"composite": true,
"outDir": "dist",
"rootDir": "src"
},
"references": [
{
"path": "../static-store"
},
{
"path": "../utils"
}
],
"include": [
"src"
]
}
1 change: 0 additions & 1 deletion packages/autofocus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

# @solid-primitives/autofocus

[![turborepo](https://img.shields.io/badge/built%20with-turborepo-cc00ff.svg?style=for-the-badge&logo=turborepo)](https://turborepo.org/)
[![size](https://img.shields.io/bundlephobia/minzip/@solid-primitives/autofocus?style=for-the-badge&label=size)](https://bundlephobia.com/package/@solid-primitives/autofocus)
[![version](https://img.shields.io/npm/v/@solid-primitives/autofocus?style=for-the-badge)](https://www.npmjs.com/package/@solid-primitives/autofocus)
[![stage](https://img.shields.io/endpoint?style=for-the-badge&url=https%3A%2F%2Fraw.githubusercontent.com%2Fsolidjs-community%2Fsolid-primitives%2Fmain%2Fassets%2Fbadges%2Fstage-1.json)](https://github.com/solidjs-community/solid-primitives#contribution-process)
Expand Down
5 changes: 0 additions & 5 deletions packages/autofocus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,13 @@
"dist"
],
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"browser": {},
"types": "./dist/index.d.ts",
"exports": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"scripts": {
Expand Down
17 changes: 15 additions & 2 deletions packages/autofocus/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
{
"extends": "../../tsconfig.json"
}
"extends": "../../tsconfig.json",
"compilerOptions": {
"composite": true,
"outDir": "dist",
"rootDir": "src"
},
"references": [
{
"path": "../utils"
}
],
"include": [
"src"
]
}
1 change: 0 additions & 1 deletion packages/bounds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

# @solid-primitives/bounds

[![turborepo](https://img.shields.io/badge/built%20with-turborepo-cc00ff.svg?style=for-the-badge&logo=turborepo)](https://turborepo.org/)
[![size](https://img.shields.io/bundlephobia/minzip/@solid-primitives/bounds?style=for-the-badge&label=size)](https://bundlephobia.com/package/@solid-primitives/bounds)
[![version](https://img.shields.io/npm/v/@solid-primitives/bounds?style=for-the-badge)](https://www.npmjs.com/package/@solid-primitives/bounds)
[![stage](https://img.shields.io/endpoint?style=for-the-badge&url=https%3A%2F%2Fraw.githubusercontent.com%2Fsolidjs-community%2Fsolid-primitives%2Fmain%2Fassets%2Fbadges%2Fstage-1.json)](https://github.com/solidjs-community/solid-primitives#contribution-process)
Expand Down
Loading
Loading