diff --git a/.gitignore b/.gitignore index 6706b91..5d091a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,106 +1,2 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# TypeScript v1 declaration files -typings/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache - -# Next.js build output -.next - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and *not* Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -.idea/ +/node_modules/ +.pnpm-debug.log diff --git a/MIGRATION.md b/MIGRATION.md index 9e393ec..f3bfb2d 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -2,7 +2,7 @@ ### `vike-solid/ClientOnly` replaced by `vike-solid/clientOnly` In order to have a coherent experience between all `vike-*` packages, -and to reflect Solid recommended approach, the `ClientOnly` component as been replaced +and to reflect Solid recommended approach, the `ClientOnly` component has been replaced by a `clientOnly` helper. ```diff diff --git a/README.md b/README.md deleted file mode 120000 index 08284b3..0000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -vike-solid/README.md \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5101c0a --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +[Vike extensions](https://vike.dev/extensions) for [SolidJs](https://www.solidjs.com). + +- `vike-solid` (SolidJs integration) + - Docs: [vike.dev/vike-solid](https://vike.dev/vike-solid) + - Version history: [CHANGELOG.md](packages/vike-solid/CHANGELOG.md) + - Source code: [packages/vike-solid/](packages/vike-solid) + +> [!NOTE] +> The source code is [small, simple, and highly polished](https://vike.dev/vike-solid#under-the-hood). Contributing is easy and welcome, see [CONTRIBUTING.md](CONTRIBUTING.md) to get started. \ No newline at end of file diff --git a/examples/full/.gitignore b/examples/full/.gitignore new file mode 100644 index 0000000..b0a5c34 --- /dev/null +++ b/examples/full/.gitignore @@ -0,0 +1,2 @@ +/node_modules/ +/dist/ diff --git a/examples/full/package.json b/examples/full/package.json index d371ffb..3155e87 100644 --- a/examples/full/package.json +++ b/examples/full/package.json @@ -10,7 +10,7 @@ "node-fetch": "^3.3.2", "solid-js": "^1.8.21", "vike": "^0.4.191", - "vike-solid": "link:vike-solid" + "vike-solid": "workspace:*" }, "devDependencies": { "typescript": "^5.5.4", diff --git a/examples/minimal/.gitignore b/examples/minimal/.gitignore new file mode 100644 index 0000000..b0a5c34 --- /dev/null +++ b/examples/minimal/.gitignore @@ -0,0 +1,2 @@ +/node_modules/ +/dist/ diff --git a/examples/minimal/package.json b/examples/minimal/package.json index 1c286e9..ccd2f38 100644 --- a/examples/minimal/package.json +++ b/examples/minimal/package.json @@ -7,7 +7,7 @@ "dependencies": { "solid-js": "^1.8.21", "vike": "^0.4.191", - "vike-solid": "link:vike-solid" + "vike-solid": "workspace:*" }, "devDependencies": { "vite": "^5.4.1" diff --git a/package.json b/package.json index de40d12..6895451 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,10 @@ { "type": "module", "scripts": { - "dev": "cd vike-solid/ && pnpm run dev", - "build": "cd vike-solid/ && pnpm run build", - "release": "cd vike-solid/ && pnpm run release", + "========= Build": "", + "build": "pnpm --recursive --filter {packages/*} run build", + "========= Dev": "", + "dev": "cd ./packages/vike-solid/ && pnpm run dev", "========= Test": "", "test": "pnpm run test:e2e && pnpm run test:types", "test:e2e": "test-e2e", @@ -13,23 +14,26 @@ "format:prettier": "git ls-files | egrep '\\.(json|js|jsx|css|ts|tsx|vue|mjs|cjs)$' | grep --invert-match package.json | xargs pnpm exec prettier --write", "format:biome": "biome format --write .", "format:check": "biome format . || (echo 'Fix formatting by running `$ pnpm run -w format`.' && exit 1)", + "========= Release": "", + "release": "cd ./packages/vike-solid/ && pnpm run release", + "release:minor": "cd ./packages/vike-solid/ && pnpm run release:minor", + "release:commit": "cd ./packages/vike-solid/ && pnpm run release:commit", "========= Clean": "", - "clean": "git clean -Xdf", - "reset": "pnpm run clean && pnpm install && pnpm run build", + "reset": "git clean -Xdf && pnpm install && pnpm run build", "========= Only allow pnpm; forbid yarn & npm": "", "preinstall": "npx only-allow pnpm" }, "pnpm": { "overrides": { - "vike-solid": "link:./vike-solid/" + "vike-solid": "link:./packages/vike-solid/" } }, - "packageManager": "pnpm@9.4.0", "devDependencies": { "@biomejs/biome": "^1.8.3", "@brillout/test-e2e": "^0.5.34", "@brillout/test-types": "^0.1.15", "playwright": "^1.46.1", "prettier": "^3.3.3" - } + }, + "packageManager": "pnpm@9.4.0" } diff --git a/vike-solid/+config.ts b/packages/vike-solid/+config.ts similarity index 100% rename from vike-solid/+config.ts rename to packages/vike-solid/+config.ts diff --git a/packages/vike-solid/.gitignore b/packages/vike-solid/.gitignore new file mode 100644 index 0000000..b0a5c34 --- /dev/null +++ b/packages/vike-solid/.gitignore @@ -0,0 +1,2 @@ +/node_modules/ +/dist/ diff --git a/CHANGELOG.md b/packages/vike-solid/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to packages/vike-solid/CHANGELOG.md diff --git a/packages/vike-solid/README.md b/packages/vike-solid/README.md new file mode 100644 index 0000000..e30f762 --- /dev/null +++ b/packages/vike-solid/README.md @@ -0,0 +1,2 @@ +Docs: [vike.dev/vike-solid](https://vike.dev/vike-solid) +Source code: [GitHub > vikejs/vike-solid](https://github.com/vikejs/vike-solid) diff --git a/packages/vike-solid/biome.json b/packages/vike-solid/biome.json new file mode 120000 index 0000000..fbaf105 --- /dev/null +++ b/packages/vike-solid/biome.json @@ -0,0 +1 @@ +../../biome.json \ No newline at end of file diff --git a/vike-solid/client.d.ts b/packages/vike-solid/client.d.ts similarity index 100% rename from vike-solid/client.d.ts rename to packages/vike-solid/client.d.ts diff --git a/vike-solid/components/Config/Config-client.ts b/packages/vike-solid/components/Config/Config-client.ts similarity index 100% rename from vike-solid/components/Config/Config-client.ts rename to packages/vike-solid/components/Config/Config-client.ts diff --git a/vike-solid/components/Config/Config-server.ts b/packages/vike-solid/components/Config/Config-server.ts similarity index 100% rename from vike-solid/components/Config/Config-server.ts rename to packages/vike-solid/components/Config/Config-server.ts diff --git a/vike-solid/components/Head/Head-client.ts b/packages/vike-solid/components/Head/Head-client.ts similarity index 100% rename from vike-solid/components/Head/Head-client.ts rename to packages/vike-solid/components/Head/Head-client.ts diff --git a/vike-solid/components/Head/Head-server.ts b/packages/vike-solid/components/Head/Head-server.ts similarity index 100% rename from vike-solid/components/Head/Head-server.ts rename to packages/vike-solid/components/Head/Head-server.ts diff --git a/vike-solid/helpers/clientOnly.tsx b/packages/vike-solid/helpers/clientOnly.tsx similarity index 100% rename from vike-solid/helpers/clientOnly.tsx rename to packages/vike-solid/helpers/clientOnly.tsx diff --git a/vike-solid/hooks/useConfig/configsCumulative.ts b/packages/vike-solid/hooks/useConfig/configsCumulative.ts similarity index 100% rename from vike-solid/hooks/useConfig/configsCumulative.ts rename to packages/vike-solid/hooks/useConfig/configsCumulative.ts diff --git a/vike-solid/hooks/useConfig/useConfig-client.ts b/packages/vike-solid/hooks/useConfig/useConfig-client.ts similarity index 100% rename from vike-solid/hooks/useConfig/useConfig-client.ts rename to packages/vike-solid/hooks/useConfig/useConfig-client.ts diff --git a/vike-solid/hooks/useConfig/useConfig-server.ts b/packages/vike-solid/hooks/useConfig/useConfig-server.ts similarity index 100% rename from vike-solid/hooks/useConfig/useConfig-server.ts rename to packages/vike-solid/hooks/useConfig/useConfig-server.ts diff --git a/vike-solid/hooks/useData.tsx b/packages/vike-solid/hooks/useData.tsx similarity index 100% rename from vike-solid/hooks/useData.tsx rename to packages/vike-solid/hooks/useData.tsx diff --git a/vike-solid/hooks/usePageContext.tsx b/packages/vike-solid/hooks/usePageContext.tsx similarity index 100% rename from vike-solid/hooks/usePageContext.tsx rename to packages/vike-solid/hooks/usePageContext.tsx diff --git a/vike-solid/package.json b/packages/vike-solid/package.json similarity index 98% rename from vike-solid/package.json rename to packages/vike-solid/package.json index c297e61..10e0ae8 100644 --- a/vike-solid/package.json +++ b/packages/vike-solid/package.json @@ -21,6 +21,7 @@ "@babel/core": "^7.25.2", "@babel/preset-env": "^7.25.3", "@babel/preset-typescript": "^7.24.7", + "@biomejs/biome": "^1.8.3", "@brillout/release-me": "^0.4.0", "@rollup/plugin-babel": "^6.0.4", "@rollup/plugin-node-resolve": "^15.2.3", diff --git a/vike-solid/renderer/applyHeadSettings.tsx b/packages/vike-solid/renderer/applyHeadSettings.tsx similarity index 100% rename from vike-solid/renderer/applyHeadSettings.tsx rename to packages/vike-solid/renderer/applyHeadSettings.tsx diff --git a/vike-solid/renderer/getHeadSetting.ts b/packages/vike-solid/renderer/getHeadSetting.ts similarity index 100% rename from vike-solid/renderer/getHeadSetting.ts rename to packages/vike-solid/renderer/getHeadSetting.ts diff --git a/vike-solid/renderer/getPageElement.tsx b/packages/vike-solid/renderer/getPageElement.tsx similarity index 100% rename from vike-solid/renderer/getPageElement.tsx rename to packages/vike-solid/renderer/getPageElement.tsx diff --git a/vike-solid/renderer/onRenderClient.tsx b/packages/vike-solid/renderer/onRenderClient.tsx similarity index 100% rename from vike-solid/renderer/onRenderClient.tsx rename to packages/vike-solid/renderer/onRenderClient.tsx diff --git a/vike-solid/renderer/onRenderHtml.tsx b/packages/vike-solid/renderer/onRenderHtml.tsx similarity index 100% rename from vike-solid/renderer/onRenderHtml.tsx rename to packages/vike-solid/renderer/onRenderHtml.tsx diff --git a/vike-solid/renderer/ssrEffect.ts b/packages/vike-solid/renderer/ssrEffect.ts similarity index 100% rename from vike-solid/renderer/ssrEffect.ts rename to packages/vike-solid/renderer/ssrEffect.ts diff --git a/vike-solid/rollup.config.js b/packages/vike-solid/rollup.config.js similarity index 100% rename from vike-solid/rollup.config.js rename to packages/vike-solid/rollup.config.js diff --git a/vike-solid/tsconfig.json b/packages/vike-solid/tsconfig.json similarity index 100% rename from vike-solid/tsconfig.json rename to packages/vike-solid/tsconfig.json diff --git a/vike-solid/types/Config.ts b/packages/vike-solid/types/Config.ts similarity index 100% rename from vike-solid/types/Config.ts rename to packages/vike-solid/types/Config.ts diff --git a/vike-solid/types/PageContext.ts b/packages/vike-solid/types/PageContext.ts similarity index 100% rename from vike-solid/types/PageContext.ts rename to packages/vike-solid/types/PageContext.ts diff --git a/vike-solid/utils/callCumulativeHooks.ts b/packages/vike-solid/utils/callCumulativeHooks.ts similarity index 100% rename from vike-solid/utils/callCumulativeHooks.ts rename to packages/vike-solid/utils/callCumulativeHooks.ts diff --git a/vike-solid/utils/getGlobalObject.ts b/packages/vike-solid/utils/getGlobalObject.ts similarity index 100% rename from vike-solid/utils/getGlobalObject.ts rename to packages/vike-solid/utils/getGlobalObject.ts diff --git a/vike-solid/utils/getTagAttributesString.ts b/packages/vike-solid/utils/getTagAttributesString.ts similarity index 100% rename from vike-solid/utils/getTagAttributesString.ts rename to packages/vike-solid/utils/getTagAttributesString.ts diff --git a/vike-solid/utils/includes.ts b/packages/vike-solid/utils/includes.ts similarity index 100% rename from vike-solid/utils/includes.ts rename to packages/vike-solid/utils/includes.ts diff --git a/vike-solid/utils/isCallable.ts b/packages/vike-solid/utils/isCallable.ts similarity index 100% rename from vike-solid/utils/isCallable.ts rename to packages/vike-solid/utils/isCallable.ts diff --git a/vike-solid/utils/objectKeys.ts b/packages/vike-solid/utils/objectKeys.ts similarity index 100% rename from vike-solid/utils/objectKeys.ts rename to packages/vike-solid/utils/objectKeys.ts diff --git a/vike-solid/vite-plugin-vike-solid.ts b/packages/vike-solid/vite-plugin-vike-solid.ts similarity index 100% rename from vike-solid/vite-plugin-vike-solid.ts rename to packages/vike-solid/vite-plugin-vike-solid.ts diff --git a/vike-solid/vite.config.ts b/packages/vike-solid/vite.config.ts similarity index 100% rename from vike-solid/vite.config.ts rename to packages/vike-solid/vite.config.ts diff --git a/vike-solid/with-solid.js b/packages/vike-solid/with-solid.js similarity index 100% rename from vike-solid/with-solid.js rename to packages/vike-solid/with-solid.js diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 974ecfd..c6a220e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,7 +5,7 @@ settings: excludeLinksFromLockfile: false overrides: - vike-solid: link:./vike-solid/ + vike-solid: link:./packages/vike-solid/ importers: @@ -39,8 +39,8 @@ importers: specifier: ^0.4.191 version: 0.4.191(vite@5.4.1(@types/node@22.4.0)) vike-solid: - specifier: link:../../vike-solid - version: link:../../vike-solid + specifier: link:../../packages/vike-solid + version: link:../../packages/vike-solid devDependencies: typescript: specifier: ^5.5.4 @@ -58,14 +58,14 @@ importers: specifier: ^0.4.191 version: 0.4.191(vite@5.4.1(@types/node@22.4.0)) vike-solid: - specifier: link:../../vike-solid - version: link:../../vike-solid + specifier: link:../../packages/vike-solid + version: link:../../packages/vike-solid devDependencies: vite: specifier: ^5.4.1 version: 5.4.1(@types/node@22.4.0) - vike-solid: + packages/vike-solid: dependencies: vite-plugin-solid: specifier: ^2.10.2 @@ -80,6 +80,9 @@ importers: '@babel/preset-typescript': specifier: ^7.24.7 version: 7.24.7(@babel/core@7.25.2) + '@biomejs/biome': + specifier: ^1.8.3 + version: 1.8.3 '@brillout/release-me': specifier: ^0.4.0 version: 0.4.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 82b591d..89723f9 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,3 @@ packages: - - "vike-solid" + - "packages/*" - "examples/*" diff --git a/vike-solid/README.md b/vike-solid/README.md deleted file mode 100644 index 205ef49..0000000 --- a/vike-solid/README.md +++ /dev/null @@ -1,10 +0,0 @@ -[](https://vike.dev) -[![npm version](https://img.shields.io/npm/v/vike-solid)](https://www.npmjs.com/package/vike-solid) - -# `vike-solid` - -[Solid](https://www.solidjs.com) integration for Vike. - -- Docs at [`vike.dev/vike-solid`](https://vike.dev/vike-solid) -- [Examples](https://github.com/vikejs/vike-solid/tree/main/examples) -- [CHANGELOG.md](https://github.com/vikejs/vike-solid/blob/main/CHANGELOG.md)