Skip to content

Commit

Permalink
Sync playground versions
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Apr 2, 2023
1 parent 3c4ba7b commit 54948b1
Show file tree
Hide file tree
Showing 14 changed files with 164 additions and 128 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
# - @vue/*

public-hoist-pattern[]=@vue/*
prefer-workspace-packages=true
64 changes: 32 additions & 32 deletions playground/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{
"name": "@whyframe/playground-astro",
"private": true,
"type": "module",
"scripts": {
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview"
},
"dependencies": {
"preact": "^10.13.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"solid-js": "^1.7.1",
"vue": "^3.2.47"
},
"devDependencies": {
"@astrojs/preact": "^2.1.0",
"@astrojs/react": "^2.1.1",
"@astrojs/solid-js": "^2.1.0",
"@astrojs/svelte": "^2.1.0",
"@astrojs/vue": "^2.1.0",
"@types/react": "^18.0.32",
"@types/react-dom": "^18.0.11",
"@whyframe/astro": "workspace:*",
"@whyframe/core": "workspace:*",
"@whyframe/jsx": "workspace:*",
"@whyframe/svelte": "workspace:*",
"@whyframe/vue": "workspace:*",
"astro": "^2.1.9",
"svelte": "^3.58.0",
"vite-plugin-inspect": "^0.7.18"
}
"name": "@whyframe/playground-astro",
"private": true,
"type": "module",
"scripts": {
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview"
},
"dependencies": {
"preact": "^10.13.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"solid-js": "^1.7.1",
"vue": "^3.2.47"
},
"devDependencies": {
"@astrojs/preact": "^2.1.0",
"@astrojs/react": "^2.1.1",
"@astrojs/solid-js": "^2.1.0",
"@astrojs/svelte": "^2.1.0",
"@astrojs/vue": "^2.1.0",
"@types/react": "^18.0.32",
"@types/react-dom": "^18.0.11",
"@whyframe/astro": "^0.2.4",
"@whyframe/core": "^0.1.9",
"@whyframe/jsx": "^0.1.8",
"@whyframe/svelte": "^0.1.5",
"@whyframe/vue": "^0.1.5",
"astro": "^2.1.9",
"svelte": "^3.58.0",
"vite-plugin-inspect": "^0.7.18"
}
}
4 changes: 2 additions & 2 deletions playground/docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"@docusaurus/module-type-aliases": "^2.4.0",
"@docusaurus/plugin-content-docs": "^2.4.0",
"@docusaurus/types": "^2.4.0",
"@whyframe/core": "workspace:*",
"@whyframe/jsx": "workspace:*"
"@whyframe/core": "^0.1.9",
"@whyframe/jsx": "^0.1.8"
},
"browserslist": {
"production": [
Expand Down
36 changes: 18 additions & 18 deletions playground/next/package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"name": "@whyframe/playground-next",
"private": true,
"type": "module",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"preview": "next start"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@whyframe/core": "workspace:*",
"@whyframe/jsx": "workspace:*",
"next": "^13.2.4"
}
"name": "@whyframe/playground-next",
"private": true,
"type": "module",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"preview": "next start"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@whyframe/core": "^0.1.9",
"@whyframe/jsx": "^0.1.8",
"next": "^13.2.4"
}
}
4 changes: 2 additions & 2 deletions playground/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
},
"devDependencies": {
"@types/node": "^18.15.11",
"@whyframe/core": "workspace:*",
"@whyframe/vue": "workspace:*",
"@whyframe/core": "^0.1.9",
"@whyframe/vue": "^0.1.5",
"node-fetch-native": "^1.0.2",
"nuxt": "^3.3.2",
"ufo": "^1.1.1",
Expand Down
36 changes: 18 additions & 18 deletions playground/sveltekit/package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"name": "@whyframe/playground-sveltekit",
"private": true,
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/kit": "^1.15.0",
"@whyframe/core": "workspace:*",
"@whyframe/svelte": "workspace:*",
"mdsvex": "^0.10.6",
"svelte": "^3.58.0",
"vite": "^4.2.1",
"vite-plugin-inspect": "^0.7.18"
}
"name": "@whyframe/playground-sveltekit",
"private": true,
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/kit": "^1.15.0",
"@whyframe/core": "^0.1.9",
"@whyframe/svelte": "^0.1.5",
"mdsvex": "^0.10.6",
"svelte": "^3.58.0",
"vite": "^4.2.1",
"vite-plugin-inspect": "^0.7.18"
}
}
4 changes: 2 additions & 2 deletions playground/vite-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"devDependencies": {
"@preact/preset-vite": "^2.5.0",
"@whyframe/core": "workspace:*",
"@whyframe/jsx": "workspace:*",
"@whyframe/core": "^0.1.9",
"@whyframe/jsx": "^0.1.8",
"vite": "^4.2.1",
"vite-plugin-inspect": "^0.7.18"
}
Expand Down
4 changes: 2 additions & 2 deletions playground/vite-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
},
"devDependencies": {
"@vitejs/plugin-react": "^3.1.0",
"@whyframe/core": "workspace:*",
"@whyframe/jsx": "workspace:*",
"@whyframe/core": "^0.1.9",
"@whyframe/jsx": "^0.1.8",
"vite": "^4.2.1",
"vite-plugin-inspect": "^0.7.18"
}
Expand Down
4 changes: 2 additions & 2 deletions playground/vite-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"solid-js": "^1.7.1"
},
"devDependencies": {
"@whyframe/core": "workspace:*",
"@whyframe/jsx": "workspace:*",
"@whyframe/core": "^0.1.9",
"@whyframe/jsx": "^0.1.8",
"babel-preset-solid": "^1.7.1",
"vite": "^4.2.1",
"vite-plugin-inspect": "^0.7.18",
Expand Down
4 changes: 2 additions & 2 deletions playground/vite-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.0.4",
"@whyframe/core": "workspace:*",
"@whyframe/svelte": "workspace:*",
"@whyframe/core": "^0.1.9",
"@whyframe/svelte": "^0.1.5",
"svelte": "^3.58.0",
"vite": "^4.2.1",
"vite-plugin-inspect": "^0.7.18"
Expand Down
4 changes: 2 additions & 2 deletions playground/vite-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.1.0",
"@whyframe/core": "workspace:*",
"@whyframe/vue": "workspace:*",
"@whyframe/core": "^0.1.9",
"@whyframe/vue": "^0.1.5",
"vite": "^4.2.1",
"vite-plugin-inspect": "^0.7.18"
}
Expand Down
36 changes: 18 additions & 18 deletions playground/vitepress/package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"name": "@whyframe/playground-vitepress",
"private": true,
"type": "module",
"scripts": {
"dev": "vitepress dev",
"build": "vitepress build",
"preview": "vitepress serve"
},
"dependencies": {
"vue": "^3.2.47"
},
"devDependencies": {
"@whyframe/core": "workspace:*",
"@whyframe/vue": "workspace:*",
"vite": "^4.2.1",
"vite-plugin-inspect": "^0.7.18",
"vitepress": "1.0.0-alpha.64"
}
"name": "@whyframe/playground-vitepress",
"private": true,
"type": "module",
"scripts": {
"dev": "vitepress dev",
"build": "vitepress build",
"preview": "vitepress serve"
},
"dependencies": {
"vue": "^3.2.47"
},
"devDependencies": {
"@whyframe/core": "^0.1.9",
"@whyframe/vue": "^0.1.5",
"vite": "^4.2.1",
"vite-plugin-inspect": "^0.7.18",
"vitepress": "1.0.0-alpha.64"
}
}
56 changes: 28 additions & 28 deletions playground/webpack-react/package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"name": "@whyframe/playground-webpack-react",
"private": true,
"type": "module",
"scripts": {
"dev": "webpack serve",
"build": "webpack build",
"preview": "sirv dist -s"
},
"dependencies": {
"copy-webpack-plugin": "^11.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@babel/core": "^7.21.4",
"@babel/preset-react": "^7.18.6",
"@whyframe/core": "workspace:*",
"@whyframe/jsx": "workspace:*",
"babel-loader": "^9.1.2",
"css-loader": "^6.7.3",
"html-webpack-plugin": "^5.5.0",
"mini-css-extract-plugin": "^2.7.5",
"sirv-cli": "^2.0.2",
"style-loader": "^3.3.2",
"webpack": "^5.77.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.13.2"
}
"name": "@whyframe/playground-webpack-react",
"private": true,
"type": "module",
"scripts": {
"dev": "webpack serve",
"build": "webpack build",
"preview": "sirv dist -s"
},
"dependencies": {
"copy-webpack-plugin": "^11.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@babel/core": "^7.21.4",
"@babel/preset-react": "^7.18.6",
"@whyframe/core": "^0.1.9",
"@whyframe/jsx": "^0.1.8",
"babel-loader": "^9.1.2",
"css-loader": "^6.7.3",
"html-webpack-plugin": "^5.5.0",
"mini-css-extract-plugin": "^2.7.5",
"sirv-cli": "^2.0.2",
"style-loader": "^3.3.2",
"webpack": "^5.77.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.13.2"
}
}
35 changes: 35 additions & 0 deletions scripts/playground-sync-versions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import fs from 'node:fs/promises'
import path from 'node:path'

// playground projects need to reference the `@whyframe/*` packages with direct version
// not the `workspace:*` version, so they can be used in stackblitz directly.
// pnpm likes to convert them to `workspace:*` when updating, this scripts reverts it,
// and can be helpful when releasing new packages.

// find all package versions in packages/
const packages = await fs.readdir('packages')
const versions = {}
for (const pkg of packages) {
if (pkg.startsWith('.')) continue
const pkgJson = await fs.readFile(
path.join('packages', pkg, 'package.json'),
'utf-8'
)
const pkgJsonObj = JSON.parse(pkgJson)
versions[pkgJsonObj.name] = pkgJsonObj.version
}

// find all playground projects, since the versions with ^
const playgrounds = await fs.readdir('playground')
for (const playground of playgrounds) {
if (playground.startsWith('.')) continue
const pkgJsonPath = path.join('playground', playground, 'package.json')
const pkgJson = await fs.readFile(pkgJsonPath, 'utf-8')
const pkgJsonObj = JSON.parse(pkgJson)
for (const dep in pkgJsonObj.devDependencies) {
if (versions[dep]) {
pkgJsonObj.devDependencies[dep] = `^${versions[dep]}`
}
}
await fs.writeFile(pkgJsonPath, JSON.stringify(pkgJsonObj, null, 2) + '\n')
}

0 comments on commit 54948b1

Please sign in to comment.