Changes for package build

pull/3420/head
Bahadir Sofuoglu 2022-09-14 17:49:38 +03:00
parent 4d3a071e66
commit ce39190abe
5 changed files with 76 additions and 1 deletions

21
LICENSE.md Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2018-2021 PrimeTek
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

17
build-meta.js Normal file
View File

@ -0,0 +1,17 @@
const fs = require('fs-extra');
const path = require('path');
fs.readdirSync(path.resolve(__dirname, './components/'), { withFileTypes: true })
.filter((dir) => dir.isDirectory())
.forEach(({ name: folderName }) => {
fs.readdirSync(path.resolve(__dirname, './components/' + folderName)).forEach((file) => {
if (file === 'package.json' || file.endsWith('d.ts') || file.endsWith('vue')) {
fs.copySync(path.resolve(__dirname, './components/' + folderName) + '/' + file, 'dist/' + folderName + '/' + file);
}
});
});
fs.copySync(path.resolve(__dirname, './components/ts-helpers.d.ts'), 'dist/ts-helpers.d.ts');
fs.copySync(path.resolve(__dirname, './package-build.json'), 'dist/package.json');
fs.copySync(path.resolve(__dirname, './README.md'), 'dist/README.md');
fs.copySync(path.resolve(__dirname, './LICENSE.md'), 'dist/LICENSE.md');

32
package-build.json Normal file
View File

@ -0,0 +1,32 @@
{
"name": "primevue",
"version": "3.17.0",
"homepage": "https://www.primefaces.org/primevue",
"repository": {
"type": "git",
"url": "https://github.com/primefaces/primevue.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/primefaces/primevue/issues"
},
"keywords": [
"primevue",
"vue",
"ui framework",
"component framework",
"ui library",
"component library",
"material",
"bootstrap"
],
"web-types": "./web-types.json",
"vetur": {
"tags": "./vetur-tags.json",
"attributes": "./vetur-attributes.json"
},
"peerDependencies": {
"vue": "^3.0.0",
"primeicons": "^5.0.0"
}
}

View File

@ -13,9 +13,13 @@
"generate": "nuxt generate", "generate": "nuxt generate",
"preview": "nuxt preview", "preview": "nuxt preview",
"postinstall": "nuxt prepare", "postinstall": "nuxt prepare",
"build:package": "NODE_ENV=production rollup -c && node build-meta && node api-generator/build-api && gulp build-styles",
"build:check": "npm run lint && npm run format:check && npm run security:check && npm run test:unit",
"security:check": "npm audit --production --audit-level high",
"format": "prettier --write \"**/*.{js,vue,d.ts}\"", "format": "prettier --write \"**/*.{js,vue,d.ts}\"",
"format:check": "prettier --check \"**/*.{js,vue,d.ts}\"", "format:check": "prettier --check \"**/*.{js,vue,d.ts}\"",
"test:unit": "vitest" "test:unit": "vitest",
"test:build": "NODE_ENV=production rollup -c"
}, },
"devDependencies": { "devDependencies": {
"@fullcalendar/core": "^5.11.0", "@fullcalendar/core": "^5.11.0",

View File

@ -118,6 +118,7 @@ function addCore() {
Object.entries(core).forEach(([filePath, value]) => { Object.entries(core).forEach(([filePath, value]) => {
const code = Object.keys(coreDependencies).reduce((val, d) => { const code = Object.keys(coreDependencies).reduce((val, d) => {
const name = d.replace('primevue/', ''); const name = d.replace('primevue/', '');
val += value[name] + '\n'; val += value[name] + '\n';
return val; return val;