Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
run: pnpm test

- name: Publish
run: pnpx pkg-pr-new publish --compact --no-template --pnpm
run: pnpx pkg-pr-new publish --no-template --pnpm './packages/nuxt' './packages/meta'
1 change: 0 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
shamefully-hoist=true
strict-peer-dependencies=false
node-linker=hoisted
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ export default createConfigForNuxt({
'vue/multi-word-component-names': 'off',
'@typescript-eslint/no-explicit-any': 'off'
}).prepend({
ignores: ['src/devtools/.component-meta']
ignores: ['scripts/_utils.ts']
})
70 changes: 8 additions & 62 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,83 +1,29 @@
{
"name": "compodium",
"name": "@compodium",
"version": "0.1.0-beta.4",
"description": "A plug an play component playground for Nuxt.",
"private": true,
"repository": "romhml/compodium",
"license": "MIT",
"type": "module",
"exports": {
".": {
"types": "./dist/types.d.ts",
"import": "./dist/module.mjs",
"require": "./dist/module.cjs"
}
},
"main": "./dist/module.cjs",
"types": "./dist/types.d.ts",
"files": [
"dist"
],
"scripts": {
"prepack": "pnpm --filter @compodium/meta build && nuxt-module-build build && nuxi generate devtools",
"dev:prepare": "pnpm -r dev:prepare",
"dev": "COMPODIUM_LOCAL=true nuxi dev playground",
"dev:build": "nuxi build playground",
"dev:prepare": "pnpm --filter @compodium/meta build && nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare devtools && nuxi prepare playground",
"release": "pnpm run lint && pnpm run test && pnpm run prepack && changelogen --release && pnpm publish && git push --follow-tags",
"lint": "eslint .",
"test": "vitest run",
"test:watch": "vitest watch",
"typecheck": "vue-tsc --noEmit && nuxi typecheck devtools && nuxi typecheck playground"
},
"dependencies": {
"@compodium/meta": "workspace:*",
"@nuxt/devtools-kit": "^2.2.1",
"@nuxt/kit": "^3.15.4",
"@vueuse/core": "^12.8.2",
"chokidar": "^4.0.3",
"consola": "^3.4.0",
"defu": "^6.1.4",
"get-port-please": "^3.1.2",
"hookable": "^5.5.3",
"micromatch": "^4.0.8",
"npm-run-path": "^6.0.0",
"pathe": "^2.0.3",
"scule": "^1.3.0",
"semver": "^7.7.1",
"sirv": "^3.0.1",
"tinyglobby": "^0.2.12",
"ufo": "^1.5.4",
"zod": "^3.24.2"
"typecheck": "pnpm -r typecheck",
"test": "pnpm -r test",
"bump": "jiti ./scripts/bump.ts"
},
"devDependencies": {
"@nuxt/devtools": "^2.2.1",
"@nuxt/eslint-config": "^1.1.0",
"@nuxt/module-builder": "^0.8.4",
"@nuxt/schema": "^3.15.4",
"@nuxt/test-utils": "^3.17.1",
"@types/micromatch": "^4.0.9",
"@types/node": "^22.13.9",
"@types/semver": "^7.5.8",
"changelogen": "^0.6.1",
"eslint": "^9.21.0",
"happy-dom": "^16.8.1",
"nuxt": "^3.15.4",
"playwright-core": "^1.50.1",
"typescript": "5.6.3",
"vitest": "^3.0.7",
"vue-tsc": "^2.2.0"
"vitest": "^3.0.7"
},
"bundleDependencies": [
"@compodium/meta"
],
"resolutions": {
"tailwindcss": "4.0.7",
"@tailwindcss/vite": "4.0.7",
"vue-tsc": "^2.2.0"
},
"packageManager": "pnpm@10.5.2",
"keywords": [
"nuxt",
"components",
"documentation"
]
"packageManager": "pnpm@10.5.2"
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { useClipboard } from '@vueuse/core'
import type { ComponentMeta, ComponentExample } from '#module/types'
import type { ComponentMeta, ComponentExample } from 'compodium'
import { generateComponentCode } from '@/utils/codegen'

const props = defineProps<{ example?: string, component?: ComponentMeta | ComponentExample, props?: Record<string, any>, defaultProps?: Record<string, any> }>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { PropInputType, PropSchema } from '#module/types'
import type { PropInputType, PropSchema } from 'compodium'
import BooleanInput from '../components/inputs/BooleanInput.vue'
import StringInput from '../components/inputs/StringInput.vue'
import NumberInput from '../components/inputs/NumberInput.vue'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { ArrayInputSchema } from '#module/runtime/server/services/infer'
import type { ArrayInputSchema } from 'compodium'

defineProps<{ schema: ArrayInputSchema }>()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { BooleanInputSchema } from '#module/runtime/server/services/infer'
import type { BooleanInputSchema } from 'compodium'

defineProps<{ schema: BooleanInputSchema }>()
</script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { DateInputSchema } from '#module/runtime/server/services/infer'
import type { DateInputSchema } from 'compodium'
import { CalendarDate, DateFormatter, getLocalTimeZone } from '@internationalized/date'

defineProps<{ schema: DateInputSchema }>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { NumberInputSchema } from '#module/runtime/server/services/infer'
import type { NumberInputSchema } from 'compodium'

defineProps<{ schema: NumberInputSchema }>()
</script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { ObjectInputSchema } from '#module/runtime/server/services/infer'
import type { ObjectInputSchema } from 'compodium'
import type { PropertyMeta } from '@compodium/meta'
import { useFuse } from '@vueuse/integrations/useFuse.mjs'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { PrimitiveArrayInputSchema } from '#module/runtime/server/services/infer'
import type { PrimitiveArrayInputSchema } from 'compodium'

const props = defineProps<{ schema: PrimitiveArrayInputSchema }>()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { StringEnumInputSchema } from '#module/runtime/server/services/infer'
import type { StringEnumInputSchema } from 'compodium'
import { getEnumOptions } from '../../utils/enum'

const props = defineProps<{ schema: StringEnumInputSchema }>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { StringEnumInputSchema } from '#module/runtime/server/services/infer'
import type { StringEnumInputSchema } from 'compodium'

defineProps<{ schema: StringEnumInputSchema }>()
</script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ComponentCollection } from '#module/types'
import type { ComponentCollection } from 'compodium'

export function useCollections() {
const collections = useState<Record<string, ComponentCollection>>('__compodium-collections', () => ({}))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { ComponentCollection, ComponentExample } from '#module/types'
import type { ComponentCollection, ComponentExample } from 'compodium'
import { kebabCase } from 'scule'

const route = useRoute()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { useColorMode, useDebounceFn } from '@vueuse/core'
import { useFuse } from '@vueuse/integrations/useFuse'
import type { ComponentMeta, CompodiumHooks } from '#module/types'
import type { ComponentMeta, CompodiumHooks } from 'compodium'
import type { PropertyMeta } from '@compodium/meta'
import { camelCase, pascalCase } from 'scule'
import { createHooks } from 'hookable'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { CompodiumHooks } from '#module/types'
import type { CompodiumHooks } from 'compodium'
import { createHooks } from 'hookable'

const hooks = createHooks<CompodiumHooks>()
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StringEnumInputSchema } from '#module/runtime/server/services/infer'
import type { StringEnumInputSchema } from 'compodium'

const sizes = ['xs', 'sm', 'md', 'lg', 'xl']

Expand Down
11 changes: 1 addition & 10 deletions devtools/nuxt.config.ts → packages/devtools/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default defineNuxtConfig({
}
},
output: {
publicDir: resolve(__dirname, '../dist/client/devtools')
publicDir: resolve(__dirname, '../nuxt/dist/client/devtools')
}
},
vite: {
Expand All @@ -35,14 +35,5 @@ export default defineNuxtConfig({
clientPort: process.env.PORT ? +process.env.PORT : undefined
}
}
},
typescript: {
tsConfig: {
compilerOptions: {
paths: {
'#module/*': ['../../src/*']
}
}
}
}
})
8 changes: 4 additions & 4 deletions devtools/package.json → packages/devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"dev:prepare": "nuxi prepare",
"typecheck": "nuxi typecheck",
"generate": "nuxt generate",
"preview": "nuxt preview",
"test": "vitest"
"test": "vitest run ."
},
"dependencies": {
"@nuxt/ui": "3.0.0-beta.2",
Expand All @@ -22,6 +21,7 @@
},
"devDependencies": {
"@compodium/meta": "workspace:*",
"compodium": "workspace:*",
"@iconify-json/lucide": "^1.2.28"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 8 additions & 2 deletions meta/package.json → packages/meta/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "@compodium/meta",
"version": "0.1.0",
"version": "0.1.0-beta.4",
"repository": {
"url": "romhml/compodium",
"directory": "packages/meta"
},
"license": "MIT",
"type": "commonjs",
"exports": {
Expand All @@ -11,7 +15,9 @@
"dist/**/*.d.ts"
],
"scripts": {
"build": "tsc -b"
"dev:prepare": "tsc -b",
"typecheck": "tsc --noEmit",
"prepack": "tsc -b"
},
"dependencies": {
"@volar/language-core": "^2.4.11",
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions packages/nuxt/LICENSE.md
1 change: 1 addition & 0 deletions packages/nuxt/README.md
File renamed without changes.
70 changes: 70 additions & 0 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "compodium",
"version": "0.1.0-beta.4",
"description": "A plug an play component playground for Nuxt.",
"repository": {
"url": "romhml/compodium",
"directory": "packages/nuxt"
},
"license": "MIT",
"type": "module",
"exports": {
".": {
"types": "./dist/types.d.ts",
"import": "./dist/module.mjs",
"require": "./dist/module.cjs"
}
},
"main": "./dist/module.cjs",
"types": "./dist/types.d.ts",
"files": [
"dist"
],
"scripts": {
"prepack": "nuxt-module-build build && nuxi generate devtools && pnpm --filter @compodium/devtools generate",
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare",
"release": "pnpm run lint && pnpm run test && pnpm run prepack && changelogen --release && pnpm publish && git push --follow-tags",
"typecheck": "vue-tsc --noEmit",
"test": "vitest run ."
},
"dependencies": {
"@compodium/meta": "workspace:*",
"@nuxt/devtools-kit": "^2.2.1",
"@nuxt/kit": "^3.15.4",
"@vueuse/core": "^12.8.2",
"chokidar": "^4.0.3",
"consola": "^3.4.0",
"defu": "^6.1.4",
"get-port-please": "^3.1.2",
"hookable": "^5.5.3",
"micromatch": "^4.0.8",
"npm-run-path": "^6.0.0",
"pathe": "^2.0.3",
"scule": "^1.3.0",
"semver": "^7.7.1",
"sirv": "^3.0.1",
"tinyglobby": "^0.2.12",
"ufo": "^1.5.4",
"zod": "^3.24.2"
},
"devDependencies": {
"@nuxt/devtools": "^2.2.1",
"@nuxt/eslint-config": "^1.1.0",
"@nuxt/module-builder": "^0.8.4",
"@nuxt/schema": "^3.15.4",
"@nuxt/test-utils": "^3.17.1",
"@types/micromatch": "^4.0.9",
"@types/node": "^22.13.9",
"@types/semver": "^7.5.8",
"happy-dom": "^16.8.1",
"nuxt": "^3.15.4",
"playwright-core": "^1.50.1",
"vue-tsc": "^2.2.0"
},
"packageManager": "pnpm@10.5.2",
"keywords": [
"nuxt",
"components",
"documentation"
]
}
4 changes: 3 additions & 1 deletion src/module.ts → packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { joinURL, withTrailingSlash } from 'ufo'
import { getLibraryCollections } from './runtime/libs'
import micromatch from 'micromatch'

export type * from './types'

export interface ModuleOptions {
/* Whether to include default collections for third-party libraries. */
includeLibraryCollections: boolean
Expand Down Expand Up @@ -238,7 +240,7 @@ export default defineNuxtModule<ModuleOptions>({
{
command: 'pnpm',
args: ['nuxi', 'dev'],
cwd: './devtools',
cwd: './packages/devtools',
stdio: 'pipe',
env: {
PORT: PORT.toString()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion src/types.d.ts → packages/nuxt/src/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type { ComponentMeta as VueComponentMeta } from '@compodium/meta'
import type { Component as NuxtComponent } from 'nuxt'
import type { InputSchema } from './runtime/server/services/infer'
import type { Hookable } from 'hookable'

export type IconifyIcon = string & {}

export type * from './runtime/server/services/infer'

export type PropInputType = 'array' | 'object' | 'stringEnum' | 'primitiveArray' | 'array' | 'string' | 'number' | 'boolean' | 'date' | 'icon'

type StringLiteral<T> = T extends string ? (string extends T ? never : T) : never
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading