Skip to content

Commit

Permalink
feat(browser): add browser package; prepare release & repl integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahul committed Oct 16, 2023
1 parent a65ce75 commit 1681386
Show file tree
Hide file tree
Showing 48 changed files with 448 additions and 320 deletions.
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"type": "module",
"scripts": {
"build:docs": "nuxt build",
"prepare:docs": "nuxt prepare",
"clean": "rm -rf dist",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"clean": "rm -rf dist"
"prepare:docs": "nuxt prepare",
"preview": "nuxt preview"
},
"devDependencies": {
"@nuxt/content": "^2.8.5",
Expand Down
8 changes: 4 additions & 4 deletions examples/astro-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "@pinceau/astro-svelte-example",
"private": true,
"scripts": {
"dev": "astro dev --port=3000",
"start": "astro dev --port=3000",
"astro": "astro",
"build:example": "astro build",
"clean": "rm -rf dist",
"dev": "astro dev --port=3000",
"preview": "astro preview",
"astro": "astro",
"clean": "rm -rf dist"
"start": "astro dev --port=3000"
},
"dependencies": {
"vue": "^3.3.4"
Expand Down
8 changes: 4 additions & 4 deletions examples/astro-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "@pinceau/astro-vue-example",
"private": true,
"scripts": {
"dev": "astro dev --port=3000",
"start": "astro dev --port=3000",
"astro": "astro",
"build:example": "astro build",
"clean": "rm -rf dist",
"dev": "astro dev --port=3000",
"preview": "astro preview",
"astro": "astro",
"clean": "rm -rf dist"
"start": "astro dev --port=3000"
},
"dependencies": {
"vue": "^3.3.4"
Expand Down
8 changes: 4 additions & 4 deletions examples/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "@pinceau/astro-example",
"private": true,
"scripts": {
"dev": "astro dev --port=3000",
"start": "astro dev --port=3000",
"astro": "astro",
"build:example": "astro build",
"clean": "rm -rf dist",
"dev": "astro dev --port=3000",
"preview": "astro preview",
"astro": "astro",
"clean": "rm -rf dist"
"start": "astro dev --port=3000"
},
"devDependencies": {
"@pinceau/astro": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions examples/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"private": true,
"scripts": {
"build:example": "nuxi build",
"clean": "rm -rf dist && rm -rf .output && rm -rf .nuxt",
"dev": "nuxi dev --port=3000",
"preview": "nuxi preview",
"clean": "rm -rf dist && rm -rf .output && rm -rf .nuxt"
"preview": "nuxi preview"
},
"dependencies": {
"@pinceau/nuxt": "workspace:*"
Expand Down
6 changes: 3 additions & 3 deletions examples/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "@pinceau/sveltekit-example",
"type": "module",
"scripts": {
"dev": "vite dev --port=3000",
"build:example": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"clean": "rm -rf dist"
"clean": "rm -rf dist",
"dev": "vite dev --port=3000",
"preview": "vite preview"
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
Expand Down
6 changes: 3 additions & 3 deletions examples/vite-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@pinceau/vite-lib-example",
"type": "module",
"private": true,
"type": "module",
"scripts": {
"build:example": "vite build",
"clean": "rm -rf dist",
"dev": "vite --port=3000",
"preview": "vite preview",
"clean": "rm -rf dist"
"preview": "vite preview"
},
"dependencies": {
"pinceau": "workspace:*"
Expand Down
4 changes: 2 additions & 2 deletions examples/vite-lit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"types"
],
"scripts": {
"dev": "vite --port=3000",
"build:example": "tsc && vite build",
"clean": "rm -rf dist"
"clean": "rm -rf dist",
"dev": "vite --port=3000"
},
"dependencies": {
"lit": "^3.0.0"
Expand Down
10 changes: 5 additions & 5 deletions examples/vite-preact/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@pinceau/vite-preact-example",
"private": true,
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite --port=3000",
"dev-refresh": "cross-env USE_REFRESH=true vite --port=3000",
"build:example": "vite build",
"build:example-refresh": "cross-env USE_REFRESH=true vite build",
"preview": "vite preview",
"clean": "rm -rf dist"
"clean": "rm -rf dist",
"dev": "vite --port=3000",
"dev-refresh": "cross-env USE_REFRESH=true vite --port=3000",
"preview": "vite preview"
},
"dependencies": {
"preact": "^10.18.1"
Expand Down
12 changes: 6 additions & 6 deletions examples/vite-react/package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"name": "@pinceau/vite-react-example",
"private": true,
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite --port=3000",
"dev-refresh": "cross-env USE_REFRESH=true vite --port=3000",
"build:example": "vite build",
"build:example-refresh": "cross-env USE_REFRESH=true vite build",
"preview": "vite preview",
"clean": "rm -rf dist"
"clean": "rm -rf dist",
"dev": "vite --port=3000",
"dev-refresh": "cross-env USE_REFRESH=true vite --port=3000",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/react": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/react": "workspace:*",
"@types/node": "20.8.5",
"@types/react": "latest",
"@types/react-dom": "latest",
Expand Down
8 changes: 4 additions & 4 deletions examples/vite-solid/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@pinceau/vite-solid-example",
"private": true,
"version": "0.0.0",
"private": true,
"license": "MIT",
"scripts": {
"dev": "vite --port=3000",
"build:example": "vite build",
"serve": "vite preview",
"clean": "rm -rf dist"
"clean": "rm -rf dist",
"dev": "vite --port=3000",
"serve": "vite preview"
},
"dependencies": {
"solid-js": "^1.8.1"
Expand Down
10 changes: 5 additions & 5 deletions examples/vite-svelte/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "@pinceau/vite-svelte-example",
"version": "0.0.0",
"private": true,
"type": "module",
"version": "0.0.0",
"scripts": {
"dev": "vite --port=3000",
"build:example": "vite build",
"serve": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.json",
"clean": "rm -rf dist"
"clean": "rm -rf dist",
"dev": "vite --port=3000",
"serve": "vite preview"
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/svelte": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/svelte": "workspace:*",
"@sveltejs/vite-plugin-svelte": "^2.4.6",
"svelte": "^4.2.1",
"svelte-check": "^3.5.2",
Expand Down
8 changes: 4 additions & 4 deletions examples/vite-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "@pinceau/vite-vue-example",
"type": "module",
"private": true,
"type": "module",
"scripts": {
"build:example": "vite build",
"clean": "rm -rf dist",
"dev": "vite --port=3000",
"preview": "vite preview",
"clean": "rm -rf dist"
"preview": "vite preview"
},
"dependencies": {
"vue": "^3.3.4",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@pinceau/configs": "workspace:*",
"@pinceau/vue": "workspace:*",
"@pinceau/palette": "workspace:*",
"@pinceau/vue": "workspace:*",
"@vitejs/plugin-vue": "^4.4.0",
"typescript": "^5.2.2",
"vite": "^4.4.11"
Expand Down
16 changes: 8 additions & 8 deletions integrations/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "@pinceau/astro",
"type": "module",
"private": true,
"version": "1.0.0-beta.10",
"private": true,
"homepage": "https://github.com/Tahul/pinceau#readme",
"bugs": {
"url": "https://github.com/Tahul/pinceau/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Tahul/pinceau.git"
},
"bugs": {
"url": "https://github.com/Tahul/pinceau/issues"
},
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
Expand Down Expand Up @@ -38,12 +38,12 @@
"types": "./dist/index.d.ts",
"scripts": {
"build": "unbuild",
"stub": "unbuild --stub",
"clean": "rm -rf dist"
"clean": "rm -rf dist",
"stub": "unbuild --stub"
},
"dependencies": {
"@pinceau/integration": "workspace:*",
"@pinceau/core": "workspace:*",
"@pinceau/integration": "workspace:*",
"acorn": "^8.10.0"
},
"devDependencies": {
Expand Down
19 changes: 17 additions & 2 deletions build/browser.ts → integrations/browser/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,32 @@ const { external, alias } = env(nodeless, node)
build({
minify: true,
treeshake: true,
dts: true,
platform: 'browser',
format: ['esm'],
entry: ['src/index.ts', 'src/utils.ts', 'src/runtime.ts', 'src/volar.ts'],
outDir: 'dist/browser',
entry: [
'./src/theme.ts',
'./src/theme-runtime.ts',
'./src/core.ts',
'./src/core-runtime.ts',
'./src/svelte.ts',
'./src/svelte-runtime.ts',
'./src/vue.ts',
'./src/vue-runtime.ts',
'./src/react.ts',
'./src/react-runtime.ts',
],
outDir: 'dist/',
clean: true,
esbuildOptions: (options) => {
options.ignoreAnnotations = true
options.external = options.external ?? []
options.external.push('@vue/*')
options.external.push('vue')
options.external.push('jiti')
options.external.push('@volar/*')
options.external.push(...external)
options.external.push('$pinceau/*')
options.alias = options.alias ?? {}
options.alias = {
...options.alias,
Expand All @@ -36,6 +50,7 @@ build({
options.splitting = true
},
noExternal: [
'sfc-composer',
'style-dictionary-esm',
'nanoid',
'scule',
Expand Down
Loading

0 comments on commit 1681386

Please sign in to comment.