From c1785bce2227c2e83341e6a1763d70adb95cb734 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Tue, 24 Oct 2023 19:06:20 +0100 Subject: [PATCH] Update rollup --- package-build.json | 36 ------------------------------- package.json | 2 +- rollup.config.js | 53 ++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 52 insertions(+), 39 deletions(-) delete mode 100644 package-build.json diff --git a/package-build.json b/package-build.json deleted file mode 100644 index 06f00f2c4..000000000 --- a/package-build.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "primevue", - "version": "3.37.0", - "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" - ], - "web-types": "./web-types.json", - "vetur": { - "tags": "./vetur-tags.json", - "attributes": "./vetur-attributes.json" - }, - "peerDependencies": { - "vue": "^3.0.0" - } -} \ No newline at end of file diff --git a/package.json b/package.json index 8a6feba3a..cce8c7c5b 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "preview": "nuxt preview", "postinstall": "nuxt prepare", "build:lib": "npm run build:check && npm run build:package", - "build:package": "NODE_ENV=production rollup -c && node build-meta && node api-generator/build-api && gulp build-styles", + "build:package": "NODE_ENV=production rollup -c && node api-generator/build-api && gulp build-styles", "build:check": "npm run format:check && npm run security:check", "security:check": "npm audit --production --audit-level high", "format": "prettier --write \"**/*.{js,vue,d.ts}\" --cache", diff --git a/rollup.config.js b/rollup.config.js index d799b7c40..bc6296fa7 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,8 +3,10 @@ import postcss from 'rollup-plugin-postcss'; import { terser } from 'rollup-plugin-terser'; import vue from 'rollup-plugin-vue'; -const fs = require('fs-extra'); -const path = require('path'); +import fs from 'fs-extra'; +import path from 'path'; + +import pkg from './package.json'; let entries = []; @@ -440,6 +442,52 @@ function addServices() { addEntry('dynamicdialogeventbus', 'DynamicDialogEventBus.js', 'dynamicdialogeventbus'); } +function addPackageJson() { + const outputDir = 'dist'; + 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" + ], + "web-types": "./web-types.json", + "vetur": { + "tags": "./vetur-tags.json", + "attributes": "./vetur-attributes.json" + }, + "peerDependencies": { + "vue": "^3.0.0" + } +}`; + + !fs.existsSync(outputDir) && fs.mkdirSync(outputDir); + fs.writeFileSync(path.resolve(outputDir, 'package.json'), packageJson); +} + addUtils(); addStyle(); addBase(); @@ -451,5 +499,6 @@ addSFC(); addIcon(); addPassThrough(); addCore(); +addPackageJson(); export default entries;