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

chore: remove turbo and migreate to unbuild #45

Merged
merged 9 commits into from
Apr 30, 2024
Merged
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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

wattanx-converter provides useful tools for Vue and Nuxt.

## Delelopment

- Clone repository
- Ensure you have the latest LTS version of Node.js installed
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` to enable `pnpm`
- Install dependencies with `pnpm install`
- Open playground with `pnpm dev`

## Vue Composition Converter

https://wattanx-converter.vercel.app/vue-composition-converter
Expand Down
35 changes: 23 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,45 @@
"name": "wattanx-converter",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev --parallel",
"lint": "turbo run lint",
"build": "pnpm --filter './packages/**' prepack",
"build:stub": "pnpm --filter './packages/**' prepack --stub",
"dev": "pnpm build && pnpm docs:dev",
"lint": "pnpm --filter './packages/**' lint",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"test": "turbo run test",
"test:watch": "turbo run test:watch",
"test": "pnpm --filter './packages/**' test",
"test:watch": "pnpm --filter './packages/**' test:watch",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs",
"changelog": "changelogen --release --no-tag --no-commit"
},
"devDependencies": {
"dependencies": {
"@wattanx/vue-composition-converter": "workspace:*",
"@wattanx/vue-mixins-converter": "workspace:*",
"@wattanx/vue-script-setup-converter": "workspace:*",
"@wattanx/vue-script-setup-converter": "workspace:*"
},
"devDependencies": {
"@vue/compiler-sfc": "^3.4.26",
"autoprefixer": "^10.4.13",
"changelogen": "^0.5.3",
"eslint-config-custom": "*",
"highlight.js": "^11.8.0",
"postcss": "^8.4.20",
"prettier": "latest",
"tailwindcss": "^3.2.4",
"turbo": "latest",
"postcss": "^8.4.38",
"prettier": "2.8.8",
"tailwindcss": "^3.4.3",
"ts-morph": "^16.0.0",
"vitepress": "1.0.0-rc.36"
},
"engines": {
"node": ">=14.0.0"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"resolutions": {
"@wattanx/vue-composition-converter": "workspace:*",
"@wattanx/vue-mixins-converter": "workspace:*",
"@wattanx/vue-script-setup-converter": "workspace:*",
"@wattanx/converter-utils": "workspace:*"
}
}
10 changes: 10 additions & 0 deletions packages/converter-utils/build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineBuildConfig } from 'unbuild';

export default defineBuildConfig({
entries: [{ input: 'src/index.ts' }],
externals: ['typescript', 'ts-morph'],
declaration: true,
rollup: {
emitCJS: true,
},
});
20 changes: 12 additions & 8 deletions packages/converter-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
{
"name": "@wattanx/converter-utils",
"version": "0.0.0",
"main": "./dist/index.mjs",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
}
},
"types": "./dist/types/index.d.ts",
"files": [
"dist"
],
"types": "./dist/index.d.ts",
"scripts": {
"build": "concurrently pnpm:build:*",
"build:vite": "vite build",
"prepack": "unbuild",
"test": "vitest run",
"test:watch": "vitest",
"format": "prettier --write src",
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types"
"format": "prettier --write src"
},
"peerDependencies": {
"ts-morph": ">=17.0.1",
Expand All @@ -33,6 +36,7 @@
"prettier-plugin-tailwindcss": "^0.1.11",
"ts-node": "^10.7.0",
"typescript": "4.9.3",
"unbuild": "^2.0.0",
"vite": "4.3.9",
"vitest": "0.32.2"
}
Expand Down
14 changes: 0 additions & 14 deletions packages/converter-utils/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
import { defineConfig } from 'vitest/config';
import path from 'path';

// https://vitejs.dev/config/
export default defineConfig({
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
fileName: 'index',
formats: ['es', 'cjs'],
},
rollupOptions: {
external: ['typescript', 'ts-morph'],
},
},
esbuild: {
minifyIdentifiers: false,
},
test: {
environment: 'node',
},
Expand Down
10 changes: 10 additions & 0 deletions packages/vue-composition-converter/build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineBuildConfig } from 'unbuild';

export default defineBuildConfig({
entries: [{ input: 'src/index.ts', builder: 'rollup' }],
declaration: true,
externals: ['typescript', 'ts-morph'],
rollup: {
emitCJS: true,
},
});
24 changes: 13 additions & 11 deletions packages/vue-composition-converter/package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
{
"name": "@wattanx/vue-composition-converter",
"version": "0.0.0",
"main": "./dist/index.mjs",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
}
},
"types": "./dist/types/index.d.ts",
"types": "./dist/index.d.ts",
"scripts": {
"convert": "ts-node --project src/scripts/tsconfig.json src/scripts/index.ts",
"build": "concurrently pnpm:build:*",
"build:vite": "vite build",
"prepack": "unbuild",
"test": "vitest run",
"test:watch": "vitest",
"format": "prettier --write src",
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types"
"format": "prettier --write src"
},
"peerDependencies": {
"ts-morph": ">=17.0.1",
Expand All @@ -26,8 +25,6 @@
"@types/jsdom": "^16.2.15",
"@types/node": "^17.0.35",
"@types/prettier": "^2.6.0",
"@vue/compiler-sfc": "^3.2.45",
"@wattanx/converter-utils": "*",
"commander": "^9.2.0",
"concurrently": "^7.6.0",
"eslint": "^8.5.0",
Expand All @@ -36,7 +33,12 @@
"prettier": "^2.6.2",
"prettier-plugin-tailwindcss": "^0.1.11",
"ts-node": "^10.7.0",
"unbuild": "^2.0.0",
"vite": "4.3.9",
"vitest": "0.32.2"
},
"dependencies": {
"@vue/compiler-sfc": "^3.2.45",
"@wattanx/converter-utils": "*"
}
}
14 changes: 0 additions & 14 deletions packages/vue-composition-converter/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,6 @@ import path from 'path';

// https://vitejs.dev/config/
export default defineConfig({
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
fileName: 'index',
formats: ['es', 'cjs'],
},
rollupOptions: {
external: ['typescript', 'ts-morph'],
},
emptyOutDir: false,
},
esbuild: {
minifyIdentifiers: false,
},
test: {
environment: 'node',
},
Expand Down
10 changes: 10 additions & 0 deletions packages/vue-mixins-converter/build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineBuildConfig } from 'unbuild';

export default defineBuildConfig({
entries: [{ input: 'src/index.ts', builder: 'rollup' }],
declaration: true,
externals: ['typescript', 'ts-morph'],
rollup: {
emitCJS: true,
},
});
26 changes: 14 additions & 12 deletions packages/vue-mixins-converter/package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
{
"name": "@wattanx/vue-mixins-converter",
"version": "0.0.0",
"main": "./dist/index.mjs",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
}
},
"types": "./dist/types/index.d.ts",
"types": "./dist/index.d.ts",
"scripts": {
"convert": "ts-node --project src/scripts/tsconfig.json src/scripts/index.ts",
"build": "concurrently pnpm:build:*",
"build:vite": "vite build",
"prepack": "unbuild",
"test": "vitest run",
"test:watch": "vitest",
"format": "prettier --write src",
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types"
"format": "prettier --write src"
},
"peerDependencies": {
"ts-morph": ">=17.0.1",
Expand All @@ -26,9 +25,6 @@
"@types/jsdom": "^16.2.15",
"@types/node": "^17.0.35",
"@types/prettier": "^2.6.0",
"@vue/compiler-sfc": "^3.2.33",
"@wattanx/converter-utils": "*",
"@wattanx/vue-composition-converter": "*",
"commander": "^9.2.0",
"concurrently": "^7.6.0",
"eslint": "^8.5.0",
Expand All @@ -37,7 +33,13 @@
"prettier": "^2.6.2",
"prettier-plugin-tailwindcss": "^0.1.11",
"ts-node": "^10.7.0",
"unbuild": "^2.0.0",
"vite": "4.3.9",
"vitest": "0.32.2"
},
"dependencies": {
"@vue/compiler-sfc": "^3.4.26",
"@wattanx/converter-utils": "workspace:*",
"@wattanx/vue-composition-converter": "workspace:*"
}
}
10 changes: 10 additions & 0 deletions packages/vue-script-setup-converter/build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineBuildConfig } from 'unbuild';

export default defineBuildConfig({
entries: [{ input: 'src/index.ts', builder: 'rollup' }],
declaration: true,
externals: ['typescript', 'ts-morph'],
rollup: {
emitCJS: true,
},
});
23 changes: 12 additions & 11 deletions packages/vue-script-setup-converter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@
"name": "@wattanx/vue-script-setup-converter",
"private": true,
"version": "0.0.0",
"main": "./dist/index.mjs",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.mjs"
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
}
},
"types": "./dist/types/index.d.ts",
"types": "./dist/index.d.ts",
"scripts": {
"dev": "vite",
"build": "concurrently pnpm:build:*",
"build:vite": "vite build",
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
"preview": "vite preview",
"prepack": "unbuild",
"test": "vitest run",
"test:watch": "vitest"
},
Expand All @@ -25,11 +23,14 @@
},
"devDependencies": {
"@types/prettier": "^2.7.1",
"@vue/compiler-sfc": "^3.2.40",
"@wattanx/converter-utils": "*",
"concurrently": "^7.6.0",
"prettier": "^2.7.1",
"unbuild": "^2.0.0",
"vite": "4.3.9",
"vitest": "0.32.2"
},
"dependencies": {
"@vue/compiler-sfc": "^3.2.40",
"@wattanx/converter-utils": "*"
}
}
Loading
Loading