refactor: update nuxt version and nuxt-module
parent
e53d48ed62
commit
9462acb06e
|
@ -1,15 +1,31 @@
|
|||
node_modules
|
||||
coverage
|
||||
*.log*
|
||||
# Nuxt dev/build outputs
|
||||
.output
|
||||
.data
|
||||
.nuxt
|
||||
.nitro
|
||||
.cache
|
||||
.output
|
||||
.env
|
||||
dist
|
||||
|
||||
# Node dependencies
|
||||
node_modules
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log*
|
||||
|
||||
# Misc
|
||||
.DS_Store
|
||||
.fleet
|
||||
.idea
|
||||
.eslintcache
|
||||
api-generator/typedoc.json
|
||||
coverage
|
||||
**/.DS_Store
|
||||
|
||||
# Local env files
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
# Custom
|
||||
api-generator/typedoc.json
|
||||
apps/showcase/components.d.ts
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
# Showcase
|
|
@ -18,7 +18,8 @@ try {
|
|||
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
typescript: false,
|
||||
compatibilityDate: '2024-11-01',
|
||||
devtools: { enabled: false },
|
||||
modules: ['@primevue/nuxt-module'],
|
||||
components: {
|
||||
path: '~/components',
|
||||
|
@ -28,7 +29,9 @@ export default defineNuxtConfig({
|
|||
resolve: {
|
||||
dedupe: ['vue', '@primeuix/styles', '@primeuix/themes', '@primeuix/utils'],
|
||||
optimizeDeps: {
|
||||
disabled: true
|
||||
disabled: true,
|
||||
noDiscovery: true,
|
||||
include: []
|
||||
},
|
||||
alias
|
||||
}
|
||||
|
@ -40,17 +43,10 @@ export default defineNuxtConfig({
|
|||
'/accessibility': { redirect: { to: '/guides/accessibility', statusCode: 301 } },
|
||||
'/installation': { redirect: { to: '/vite', statusCode: 301 } }
|
||||
},
|
||||
primevue:
|
||||
PROCESS_ENV.DEV_ENV === 'hot'
|
||||
? {
|
||||
usePrimeVue: false,
|
||||
autoImport: true,
|
||||
loadStyles: false
|
||||
}
|
||||
: {
|
||||
autoImport: true, // When enabled, the module automatically imports PrimeVue components and directives used throughout the application.
|
||||
importTheme: { from: '@/themes/app-theme.js' }
|
||||
},
|
||||
primevue: {
|
||||
autoImport: true, // When enabled, the module automatically imports PrimeVue components and directives used throughout the application.
|
||||
importTheme: { from: '@/themes/app-theme.js' }
|
||||
},
|
||||
app: {
|
||||
baseURL: baseUrl,
|
||||
head: {
|
||||
|
|
|
@ -13,15 +13,6 @@
|
|||
"bugs": {
|
||||
"url": "https://github.com/primefaces/primevue/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "pnpm run build:prebuild && nuxt build",
|
||||
"dev": "nuxt dev",
|
||||
"generate": "nuxt generate",
|
||||
"preview": "nuxt preview",
|
||||
"postinstall": "nuxt prepare",
|
||||
"build:prebuild": "node ./scripts/prebuild.js",
|
||||
"build:apidoc": "node ./scripts/build-apidoc.js"
|
||||
},
|
||||
"keywords": [
|
||||
"primevue",
|
||||
"vue",
|
||||
|
@ -37,35 +28,42 @@
|
|||
"unstyled",
|
||||
"passthrough"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@stackblitz/sdk": "^1.8.2",
|
||||
"autoprefixer": "^10.4.16",
|
||||
"chart.js": "3.3.2",
|
||||
"jsdom": "^19.0.0",
|
||||
"nuxt": "3.3.2",
|
||||
"postcss": "^8.4.31",
|
||||
"prettier": "2.7.1",
|
||||
"primeicons": "^7.0.0",
|
||||
"quill": "2.0.0",
|
||||
"sass": "1.45.0",
|
||||
"sass-loader": "8.0.2",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"tailwindcss-primeui": "^0.4.0",
|
||||
"typedoc": "0.23.23",
|
||||
"primevue": "workspace:*",
|
||||
"@primevue/core": "workspace:*",
|
||||
"@primevue/nuxt-module": "workspace:*",
|
||||
"@primevue/forms": "workspace:*",
|
||||
"@primeuix/themes": "catalog:",
|
||||
"yup": "1.4.0",
|
||||
"zod": "3.23.8",
|
||||
"valibot": "^0.42.1",
|
||||
"superstruct": "^2.0.2"
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "pnpm run build:prebuild && nuxt build",
|
||||
"dev": "nuxt dev",
|
||||
"generate": "nuxt generate",
|
||||
"preview": "nuxt preview",
|
||||
"postinstall": "nuxt prepare",
|
||||
"build:prebuild": "node ./scripts/prebuild.js",
|
||||
"build:apidoc": "node ./scripts/build-apidoc.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@docsearch/js": "^3.3.3"
|
||||
"@docsearch/js": "catalog:app",
|
||||
"@primeuix/themes": "catalog:",
|
||||
"@primevue/core": "workspace:*",
|
||||
"@primevue/forms": "workspace:*",
|
||||
"@primevue/nuxt-module": "workspace:*",
|
||||
"primeicons": "catalog:",
|
||||
"primevue": "workspace:*",
|
||||
"chart.js": "catalog:app",
|
||||
"quill": "catalog:app",
|
||||
"superstruct": "^2.0.2",
|
||||
"valibot": "^0.42.1",
|
||||
"yup": "1.4.0",
|
||||
"zod": "3.23.8"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.11.0"
|
||||
"devDependencies": {
|
||||
"@stackblitz/sdk": "^1.8.2",
|
||||
"autoprefixer": "^10",
|
||||
"jsdom": "^19.0.0",
|
||||
"nuxt": "catalog:app",
|
||||
"postcss": "^8.4.31",
|
||||
"sass": "catalog:app",
|
||||
"sass-loader": "catalog:app",
|
||||
"tailwindcss": "^3",
|
||||
"tailwindcss-primeui": "catalog:",
|
||||
"typedoc": "0.27.9",
|
||||
"vite": "catalog:app"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,296 +0,0 @@
|
|||
import alias from '@rollup/plugin-alias';
|
||||
import { babel } from '@rollup/plugin-babel';
|
||||
import terser from '@rollup/plugin-terser';
|
||||
import postcss from 'rollup-plugin-postcss';
|
||||
import vue from 'rollup-plugin-vue';
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
|
||||
import viteConfig, { THEME_PRESETS } from './nuxt-vite.config.js';
|
||||
import pkg from './package.json';
|
||||
|
||||
// globals
|
||||
const GLOBALS = {
|
||||
vue: 'Vue'
|
||||
};
|
||||
|
||||
// externals
|
||||
const GLOBAL_EXTERNALS = ['vue', 'chart.js/auto', 'quill'];
|
||||
const INLINE_EXTERNALS = Object.keys(viteConfig.resolve.alias);
|
||||
const EXTERNALS = [...GLOBAL_EXTERNALS, ...INLINE_EXTERNALS];
|
||||
|
||||
// alias
|
||||
const ALIAS_ENTRIES = Object.entries(viteConfig.resolve.alias).map(([key, value]) => ({ find: key, replacement: value }));
|
||||
|
||||
// plugins
|
||||
const BABEL_PLUGIN_OPTIONS = {
|
||||
extensions: ['.js', '.vue'],
|
||||
exclude: 'node_modules/**',
|
||||
presets: ['@babel/preset-env'],
|
||||
plugins: [],
|
||||
skipPreflightCheck: true,
|
||||
babelHelpers: 'runtime',
|
||||
babelrc: false
|
||||
};
|
||||
|
||||
const ALIAS_PLUGIN_OPTIONS = {
|
||||
entries: ALIAS_ENTRIES
|
||||
};
|
||||
|
||||
const POSTCSS_PLUGIN_OPTIONS = {
|
||||
sourceMap: false
|
||||
};
|
||||
|
||||
const TERSER_PLUGIN_OPTIONS = {
|
||||
compress: {
|
||||
keep_infinity: true,
|
||||
pure_getters: true,
|
||||
reduce_funcs: true
|
||||
},
|
||||
mangle: {
|
||||
reserved: ['theme', 'css']
|
||||
}
|
||||
};
|
||||
|
||||
const PLUGINS = [vue(), postcss(POSTCSS_PLUGIN_OPTIONS), babel(BABEL_PLUGIN_OPTIONS)];
|
||||
|
||||
const ENTRY = {
|
||||
entries: [],
|
||||
onwarn(warning) {
|
||||
if (warning.code === 'CIRCULAR_DEPENDENCY') {
|
||||
//console.error(`(!) ${warning.message}`);
|
||||
return;
|
||||
}
|
||||
},
|
||||
format: {
|
||||
cjs_es(options) {
|
||||
return ENTRY.format.cjs(options).es(options);
|
||||
},
|
||||
cjs({ input, output, minify }) {
|
||||
ENTRY.entries.push({
|
||||
onwarn: ENTRY.onwarn,
|
||||
input,
|
||||
plugins: [...PLUGINS, minify && terser(TERSER_PLUGIN_OPTIONS)],
|
||||
external: EXTERNALS,
|
||||
inlineDynamicImports: true,
|
||||
output: [
|
||||
{
|
||||
format: 'cjs',
|
||||
file: `${output}${minify ? '.min' : ''}.cjs`,
|
||||
sourcemap: true,
|
||||
exports: 'auto'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
return ENTRY.format;
|
||||
},
|
||||
es({ input, output, minify }) {
|
||||
ENTRY.entries.push({
|
||||
onwarn: ENTRY.onwarn,
|
||||
input,
|
||||
plugins: [...PLUGINS, minify && terser(TERSER_PLUGIN_OPTIONS)],
|
||||
external: EXTERNALS,
|
||||
inlineDynamicImports: true,
|
||||
output: [
|
||||
{
|
||||
format: 'es',
|
||||
file: `${output}${minify ? '.min' : ''}.mjs`,
|
||||
sourcemap: true,
|
||||
exports: 'auto'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
return ENTRY.format;
|
||||
},
|
||||
umd({ name, input, output, minify }) {
|
||||
ENTRY.entries.push({
|
||||
onwarn: ENTRY.onwarn,
|
||||
input,
|
||||
plugins: [alias(ALIAS_PLUGIN_OPTIONS), ...PLUGINS, minify && terser(TERSER_PLUGIN_OPTIONS)],
|
||||
external: GLOBAL_EXTERNALS,
|
||||
inlineDynamicImports: true,
|
||||
output: [
|
||||
{
|
||||
format: 'umd',
|
||||
name: name ?? 'PrimeVue',
|
||||
file: `${output}${minify ? '.min' : ''}.js`,
|
||||
globals: GLOBALS,
|
||||
exports: 'auto'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
return ENTRY.format;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function addFile() {
|
||||
fs.readdirSync(path.resolve(__dirname, process.env.INPUT_DIR), { withFileTypes: true })
|
||||
.filter((dir) => dir.isDirectory())
|
||||
.forEach(({ name: folderName }) => {
|
||||
fs.readdirSync(path.resolve(__dirname, process.env.INPUT_DIR + folderName)).forEach((file) => {
|
||||
let name = file.split(/(.vue)$|(.js)$/)[0].toLowerCase();
|
||||
|
||||
if (name === folderName) {
|
||||
const input = process.env.INPUT_DIR + folderName + '/' + file;
|
||||
const output = process.env.OUTPUT_DIR + folderName + '/' + name;
|
||||
|
||||
ENTRY.format.es({ input, output });
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function addIcon() {
|
||||
const iconDir = path.resolve(__dirname, process.env.INPUT_DIR + 'icons');
|
||||
|
||||
fs.readdirSync(path.resolve(__dirname, iconDir), { withFileTypes: true })
|
||||
.filter((dir) => dir.isDirectory())
|
||||
.forEach(({ name: folderName }) => {
|
||||
fs.readdirSync(path.resolve(__dirname, iconDir + '/' + folderName)).forEach((file) => {
|
||||
if (/\.vue$/.test(file)) {
|
||||
const name = file.split(/(.vue)$/)[0].toLowerCase();
|
||||
const input = process.env.INPUT_DIR + 'icons/' + folderName + '/' + file;
|
||||
const output = process.env.OUTPUT_DIR + 'icons/' + folderName + '/' + name;
|
||||
|
||||
ENTRY.format.es({ input, output });
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function addStyle() {
|
||||
fs.readdirSync(path.resolve(__dirname, process.env.INPUT_DIR), { withFileTypes: true })
|
||||
.filter((dir) => dir.isDirectory())
|
||||
.forEach(({ name: folderName }) => {
|
||||
try {
|
||||
fs.readdirSync(path.resolve(__dirname, process.env.INPUT_DIR + folderName + '/style')).forEach((file) => {
|
||||
if (/\.js$/.test(file)) {
|
||||
const name = file.split(/(.js)$/)[0].toLowerCase();
|
||||
const input = process.env.INPUT_DIR + folderName + '/style/' + file;
|
||||
const output = process.env.OUTPUT_DIR + folderName + '/style/' + name;
|
||||
|
||||
ENTRY.format.es({ input, output });
|
||||
}
|
||||
});
|
||||
} catch {}
|
||||
});
|
||||
}
|
||||
|
||||
function traverseDir(dir, condition, callback) {
|
||||
try {
|
||||
const files = fs.readdirSync(dir);
|
||||
|
||||
files.forEach((file) => {
|
||||
const filePath = path.join(dir, file);
|
||||
const fileStat = fs.statSync(filePath);
|
||||
|
||||
if (fileStat.isDirectory()) {
|
||||
traverseDir(filePath, condition, callback);
|
||||
} else if (condition?.(file) && fileStat.isFile()) {
|
||||
callback?.(file, filePath, dir);
|
||||
}
|
||||
});
|
||||
} catch {}
|
||||
}
|
||||
|
||||
function addThemes() {
|
||||
traverseDir(
|
||||
path.resolve(__dirname, process.env.INPUT_DIR + 'themes'),
|
||||
(file) => file === 'index.js',
|
||||
(file, filePath, folderPath) => {
|
||||
const searchFolder = '/' + process.env.INPUT_DIR;
|
||||
const folderName = folderPath.substring(folderPath.indexOf(searchFolder) + searchFolder.length);
|
||||
const input = process.env.INPUT_DIR + folderName + '/' + file;
|
||||
const output = process.env.OUTPUT_DIR + folderName + '/' + 'index';
|
||||
|
||||
ENTRY.format.es({ input, output });
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function addCore() {
|
||||
ENTRY.format.es({ input: process.env.INPUT_DIR + 'config/PrimeVue.js', output: process.env.OUTPUT_DIR + 'config/config' });
|
||||
ENTRY.format.es({ input: process.env.INPUT_DIR + 'service/PrimeVueService.js', output: process.env.OUTPUT_DIR + 'service/primevueservice' });
|
||||
}
|
||||
|
||||
function addPassThrough() {
|
||||
ENTRY.format.es({ input: process.env.INPUT_DIR + 'passthrough/index.js', output: process.env.OUTPUT_DIR + 'passthrough/index' });
|
||||
}
|
||||
|
||||
function addLibrary() {
|
||||
THEME_PRESETS?.forEach((preset) => {
|
||||
ENTRY.format.umd({ name: `PrimeVue.Themes.${preset[0].toUpperCase() + preset.slice(1)}`, input: process.env.INPUT_DIR + `themes/${preset}/index.js`, output: process.env.OUTPUT_DIR + `umd/themes/${preset}`, minify: true });
|
||||
});
|
||||
|
||||
ENTRY.format.umd({ name: 'PrimeVue', input: process.env.INPUT_DIR + 'primevue.js', output: process.env.OUTPUT_DIR + 'umd/primevue', minify: true });
|
||||
}
|
||||
|
||||
function addPackageJson() {
|
||||
const outputDir = path.resolve(__dirname, process.env.OUTPUT_DIR);
|
||||
const packageJson = `{
|
||||
"name": "primevue",
|
||||
"version": "${pkg.version}",
|
||||
"private": "false",
|
||||
"author": "PrimeTek Informatics",
|
||||
"description": "PrimeVue is an open source UI library for Vue featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBlock, which has 370+ ready to use UI blocks to build spectacular applications in no time.",
|
||||
"homepage": "https://primevue.org/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/primefaces/primevue.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/primefaces/primevue/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"primevue",
|
||||
"vue",
|
||||
"vue.js",
|
||||
"vue2",
|
||||
"vue3",
|
||||
"ui library",
|
||||
"component library",
|
||||
"material",
|
||||
"bootstrap",
|
||||
"fluent",
|
||||
"tailwind",
|
||||
"unstyled",
|
||||
"passthrough"
|
||||
],
|
||||
"unpkg": "umd/primevue.min.js",
|
||||
"jsdelivr": "umd/primevue.min.js",
|
||||
"web-types": "./web-types.json",
|
||||
"vetur": {
|
||||
"tags": "./vetur-tags.json",
|
||||
"attributes": "./vetur-attributes.json"
|
||||
},
|
||||
"sideEffects": [
|
||||
"*.vue"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"vue": "^3.5.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.11.0"
|
||||
}
|
||||
}`;
|
||||
|
||||
!fs.existsSync(outputDir) && fs.mkdirSync(outputDir);
|
||||
fs.writeFileSync(path.resolve(outputDir, 'package.json'), packageJson);
|
||||
}
|
||||
|
||||
addCore();
|
||||
addStyle();
|
||||
addThemes();
|
||||
addIcon();
|
||||
addFile();
|
||||
addPassThrough();
|
||||
addLibrary();
|
||||
addPackageJson();
|
||||
|
||||
export default ENTRY.entries;
|
|
@ -1,10 +1,10 @@
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
const primeui = require('tailwindcss-primeui');
|
||||
import PrimeUI from 'tailwindcss-primeui';
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
darkMode: ['selector', '[class="p-dark"]'],
|
||||
content: ['./pages/**/*.vue', './layouts/**/*.vue', './components/**/*.{js,vue,ts}', './doc/**/*.{js,vue,ts}', './error.vue'],
|
||||
plugins: [primeui],
|
||||
plugins: [PrimeUI],
|
||||
theme: {
|
||||
screens: {
|
||||
sm: '576px',
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
{
|
||||
// https://nuxt.com/docs/guide/concepts/typescript
|
||||
"extends": "./.nuxt/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
"dev": "pnpm --filter showcase dev",
|
||||
"preview": "pnpm --filter showcase preview",
|
||||
"hot:dev": "DEV_ENV=hot pnpm --filter showcase dev",
|
||||
"labs:dev": "pnpm --filter labs dev",
|
||||
"module:dev": "pnpm --filter @primevue/nuxt-module dev",
|
||||
"security:check": "pnpm audit --prod --audit-level high",
|
||||
"lint": "eslint .",
|
||||
|
@ -55,10 +56,10 @@
|
|||
"eslint-plugin-vue": "^9.32.0",
|
||||
"globals": "^15.14.0",
|
||||
"pnpm": "^9.6.0",
|
||||
"prettier": "3.4.2",
|
||||
"prettier": "^3.5.2",
|
||||
"rollup-plugin-postcss": "^4.0.0",
|
||||
"rollup-plugin-vue": "^6.0.0-beta.9",
|
||||
"typescript": "^4.9.4"
|
||||
"typescript": "^5.7.3"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
|
|
@ -1,39 +1,84 @@
|
|||

|
||||
<!--
|
||||
Get your module up and running quickly.
|
||||
|
||||
# PrimeVue Nuxt Module
|
||||
Find and replace all on all files (CMD+SHIFT+F):
|
||||
- Name: My Module
|
||||
- Package name: my-module
|
||||
- Description: My new Nuxt module
|
||||
-->
|
||||
|
||||
# My Module
|
||||
|
||||
[![npm version][npm-version-src]][npm-version-href]
|
||||
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
||||
[![Discord Chat][discord-src]](discord-href)
|
||||
[![License][license-src]][license-href]
|
||||
[![Nuxt][nuxt-src]][nuxt-href]
|
||||
|
||||
- [✨ Release Notes](https://github.com/primefaces/primevue/packages/nuxt-module/blob/main/CHANGELOG.md#changelog)
|
||||
- [📖 Documentation](https://primevue.org/nuxt/)
|
||||
My new Nuxt module for doing amazing things.
|
||||
|
||||
- [✨ Release Notes](/CHANGELOG.md)
|
||||
<!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
|
||||
<!-- - [📖 Documentation](https://example.com) -->
|
||||
|
||||
## Features
|
||||
|
||||
<!-- Highlight some of the features your module provide here -->
|
||||
- ⛰ Foo
|
||||
- 🚠 Bar
|
||||
- 🌲 Baz
|
||||
|
||||
## Quick Setup
|
||||
|
||||
1. Add `@primevue/nuxt-module` dependency to your project
|
||||
Install the module to your Nuxt application with one command:
|
||||
|
||||
```bash
|
||||
npx nuxi@latest module add primevue
|
||||
npx nuxi module add my-module
|
||||
```
|
||||
|
||||
2. Add `@primevue/nuxt-module` to the `modules` section of `nuxt.config.{ts,js}`
|
||||
That's it! You can now use My Module in your Nuxt app ✨
|
||||
|
||||
```js
|
||||
{
|
||||
modules: ['@primevue/nuxt-module'];
|
||||
}
|
||||
```
|
||||
|
||||
That's it! You can now use `@primevue/nuxt-module` in your Nuxt app ✨
|
||||
## Contribution
|
||||
|
||||
<details>
|
||||
<summary>Local development</summary>
|
||||
|
||||
```bash
|
||||
# Install dependencies
|
||||
npm install
|
||||
|
||||
# Generate type stubs
|
||||
npm run dev:prepare
|
||||
|
||||
# Develop with the playground
|
||||
npm run dev
|
||||
|
||||
# Build the playground
|
||||
npm run dev:build
|
||||
|
||||
# Run ESLint
|
||||
npm run lint
|
||||
|
||||
# Run Vitest
|
||||
npm run test
|
||||
npm run test:watch
|
||||
|
||||
# Release new version
|
||||
npm run release
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
<!-- Badges -->
|
||||
[npm-version-src]: https://img.shields.io/npm/v/my-module/latest.svg?style=flat&colorA=020420&colorB=00DC82
|
||||
[npm-version-href]: https://npmjs.com/package/my-module
|
||||
|
||||
[npm-version-src]: https://img.shields.io/npm/v/@primevue/nuxt-module/latest.svg?color
|
||||
[npm-version-href]: https://npmjs.com/package/@primevue/nuxt-module
|
||||
[npm-downloads-src]: https://img.shields.io/npm/dm/@primevue/nuxt-module
|
||||
[npm-downloads-href]: https://npmjs.com/package/@primevue/nuxt-module
|
||||
[discord-src]: https://img.shields.io/discord/557940238991753223.svg?colorB=7289da&label=chat&logo=discord
|
||||
[license-src]: https://img.shields.io/npm/l/@primevue/nuxt-module.svg?style=flat&colorB=yellow
|
||||
[license-href]: https://npmjs.com/package/@primevue/nuxt-module
|
||||
[npm-downloads-src]: https://img.shields.io/npm/dm/my-module.svg?style=flat&colorA=020420&colorB=00DC82
|
||||
[npm-downloads-href]: https://npm.chart.dev/my-module
|
||||
|
||||
[license-src]: https://img.shields.io/npm/l/my-module.svg?style=flat&colorA=020420&colorB=00DC82
|
||||
[license-href]: https://npmjs.com/package/my-module
|
||||
|
||||
[nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
|
||||
[nuxt-href]: https://nuxt.com
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
"primevue nuxt3",
|
||||
"primevue 4"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"type": "module",
|
||||
"sideEffects": false,
|
||||
"main": "./src/module.ts",
|
||||
"types": "./src/types.d.ts",
|
||||
"files": [
|
||||
|
@ -58,38 +58,36 @@
|
|||
"build": "NODE_ENV=production INPUT_DIR=src/ OUTPUT_DIR=dist/ pnpm run build:package",
|
||||
"build:package": "pnpm run build:prebuild && pnpm run prepack",
|
||||
"build:prebuild": "node ./scripts/prebuild.mjs",
|
||||
"prepack": "nuxt-module-build",
|
||||
"prepack": "nuxt-module-build build",
|
||||
"dev": "nuxi dev playground",
|
||||
"dev:build": "nuxi build playground",
|
||||
"dev:prepare": "nuxt-module-build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
||||
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
||||
"dev:link": "pnpm link --global && npm link",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest watch"
|
||||
"test:watch": "vitest watch",
|
||||
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nuxt/kit": "^3.7.3",
|
||||
"@nuxt/kit": "^3",
|
||||
"@primeuix/styled": "catalog:",
|
||||
"@primeuix/utils": "catalog:",
|
||||
"primevue": "workspace:*",
|
||||
"@primevue/auto-import-resolver": "workspace:*",
|
||||
"@primevue/metadata": "workspace:*",
|
||||
"unplugin-vue-components": "0.27.0",
|
||||
"unplugin-vue-components": "28.4.1",
|
||||
"pathe": "^1.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.17.17",
|
||||
"@nuxt/devtools": "^0.8.5",
|
||||
"@nuxt/eslint-config": "^0.2.0",
|
||||
"@nuxt/module-builder": "^0.8.3",
|
||||
"@nuxt/schema": "^3.7.3",
|
||||
"@nuxt/test-utils": "^3.7.3",
|
||||
"changelogen": "^0.5.5",
|
||||
"nitropack": "^2.6.3",
|
||||
"nuxt": "3.3.2",
|
||||
"vitest": "^1.6.0",
|
||||
"@primeuix/themes": "catalog:"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.11.0"
|
||||
"@primeuix/themes": "catalog:",
|
||||
"@nuxt/devtools": "^2.1.0",
|
||||
"@nuxt/eslint-config": "^1.1.0",
|
||||
"@nuxt/module-builder": "^0.8.4",
|
||||
"@nuxt/schema": "^3",
|
||||
"@nuxt/test-utils": "^3",
|
||||
"@types/node": "latest",
|
||||
"changelogen": "^0.6.0",
|
||||
"nuxt": "catalog:app",
|
||||
"vitest": "^3.0.7",
|
||||
"vue-tsc": "~2.1.6"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
// @ts-ignore
|
||||
import Aura from '@primeuix/themes/aura';
|
||||
import { defineNuxtConfig } from 'nuxt/config';
|
||||
|
||||
export default defineNuxtConfig({
|
||||
compatibilityDate: '2025-02-27',
|
||||
devtools: { enabled: true },
|
||||
modules: ['../src/module'],
|
||||
primevue: {
|
||||
usePrimeVue: true,
|
||||
|
@ -32,6 +34,5 @@ export default defineNuxtConfig({
|
|||
include: undefined,
|
||||
exclude: undefined
|
||||
}
|
||||
},
|
||||
devtools: { enabled: true }
|
||||
}
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"build": "nuxi build",
|
||||
"generate": "nuxi generate"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nuxt": "3.3.2"
|
||||
"dependencies": {
|
||||
"nuxt": "catalog:app"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"extends": "../.nuxt/tsconfig.server.json"
|
||||
"extends": "../.nuxt/tsconfig.server.json"
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"extends": "./.nuxt/tsconfig.json"
|
||||
"extends": "./.nuxt/tsconfig.json"
|
||||
}
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
import path from 'path';
|
||||
import { removeBuild, resolvePath, updatePackageJson } from '../../../scripts/build-helper.mjs';
|
||||
|
||||
removeBuild(import.meta.url);
|
||||
updatePackageJson(path.resolve(resolvePath(import.meta.url).__dirname, '../package.json'));
|
|
@ -73,15 +73,7 @@ export default defineNuxtModule<ModuleOptions>({
|
|||
resolvers: [
|
||||
PrimeVueResolver({
|
||||
components: moduleOptions.components,
|
||||
directives: moduleOptions.directives,
|
||||
resolve: (meta: MetaType) => {
|
||||
registeredStyles.push({
|
||||
...meta,
|
||||
name: `${meta.name}Style`,
|
||||
as: `${meta.as}Style`,
|
||||
from: `${meta.from}/style`
|
||||
});
|
||||
}
|
||||
directives: moduleOptions.directives
|
||||
})
|
||||
]
|
||||
},
|
||||
|
|
|
@ -45,7 +45,8 @@ function registerComponents(resolvePath: any, moduleOptions: ModuleOptions) {
|
|||
global: true
|
||||
};
|
||||
|
||||
!moduleOptions.autoImport && addComponent(opt);
|
||||
//!moduleOptions.autoImport && addComponent(opt);
|
||||
addComponent(opt);
|
||||
|
||||
return {
|
||||
..._item,
|
||||
|
@ -111,7 +112,8 @@ function registerStyles(resolvePath: any, registered: any, moduleOptions: Module
|
|||
}
|
||||
];
|
||||
|
||||
if (!moduleOptions.autoImport && !options?.unstyled) {
|
||||
if (!options?.unstyled) {
|
||||
// !moduleOptions.autoImport && !options?.unstyled
|
||||
if (isNotEmpty(registered?.components)) {
|
||||
styles.push({
|
||||
name: 'BaseComponentStyle',
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
import { $fetch, setup } from '@nuxt/test-utils';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { setup, $fetch } from '@nuxt/test-utils/e2e'
|
||||
|
||||
describe('ssr', async () => {
|
||||
await setup({
|
||||
rootDir: fileURLToPath(new URL('./fixtures/basic', import.meta.url))
|
||||
});
|
||||
await setup({
|
||||
rootDir: fileURLToPath(new URL('./fixtures/basic', import.meta.url)),
|
||||
})
|
||||
|
||||
it('renders the index page', async () => {
|
||||
// Get response to a server-rendered page with `$fetch`.
|
||||
const html = await $fetch('/');
|
||||
|
||||
expect(html).toContain('<div>basic</div>');
|
||||
});
|
||||
});
|
||||
it('renders the index page', async () => {
|
||||
// Get response to a server-rendered page with `$fetch`.
|
||||
const html = await $fetch('/')
|
||||
expect(html).toContain('<div>basic</div>')
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<template>
|
||||
<div>basic</div>
|
||||
<div>basic</div>
|
||||
</template>
|
||||
|
||||
<script setup></script>
|
||||
<script setup>
|
||||
</script>
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import MyModule from '../../../src/module';
|
||||
import MyModule from '../../../src/module'
|
||||
|
||||
export default defineNuxtConfig({
|
||||
modules: [MyModule]
|
||||
});
|
||||
modules: [
|
||||
MyModule,
|
||||
],
|
||||
})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"private": true,
|
||||
"name": "basic",
|
||||
"type": "module"
|
||||
"private": true,
|
||||
"name": "basic",
|
||||
"type": "module"
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"extends": "./.nuxt/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "es2022",
|
||||
"moduleResolution": "Node",
|
||||
|
@ -9,5 +10,9 @@
|
|||
"@primevue/auto-import-resolver/*": ["../../packages/auto-import-resolver/src/*"]
|
||||
}
|
||||
},
|
||||
"exclude": ["node_modules"]
|
||||
"exclude": [
|
||||
"dist",
|
||||
"node_modules",
|
||||
"playground"
|
||||
]
|
||||
}
|
||||
|
|
5223
pnpm-lock.yaml
5223
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -8,3 +8,15 @@ catalog:
|
|||
'@primeuix/forms': ^0.0.4
|
||||
'@primeuix/styles': ^1.0.0
|
||||
'@primeuix/themes': ^1.0.0
|
||||
'tailwindcss-primeui': ^0.5.0
|
||||
'primeicons': ^7.0.0
|
||||
|
||||
catalogs:
|
||||
app:
|
||||
'nuxt': 3.15.4
|
||||
'vite': 6.0.11
|
||||
'sass': 1.45.0
|
||||
'sass-loader': 8.0.2
|
||||
'@docsearch/js': ^3
|
||||
'chart.js': 3.3.2
|
||||
'quill': 2.0.0
|
||||
|
|
Loading…
Reference in New Issue