diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 2c8e130b83..9472771d34 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -68,3 +68,4 @@ jobs: GIT_HEAD: ${{env.GIT_HEAD}} REGISTRY: https://registry.npmjs.com/ FORCE_COLOR: 2 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/.vitepress/build/crowdin-credentials.ts b/docs/.vitepress/build/crowdin-credentials.ts index 386113ea88..c4fe167a7b 100644 --- a/docs/.vitepress/build/crowdin-credentials.ts +++ b/docs/.vitepress/build/crowdin-credentials.ts @@ -2,7 +2,7 @@ import path from 'path' import fs from 'fs/promises' import chalk from 'chalk' import consola from 'consola' -import { docRoot, errorAndExit } from '@element-plus/build' +import { docRoot, errorAndExit } from '@element-plus/build-utils' const credentialPlaceholder = 'API_TOKEN_PLACEHOLDER' diff --git a/docs/.vitepress/build/crowdin-generate.ts b/docs/.vitepress/build/crowdin-generate.ts index 5dbb9ebe1e..0f8a4dc116 100644 --- a/docs/.vitepress/build/crowdin-generate.ts +++ b/docs/.vitepress/build/crowdin-generate.ts @@ -2,7 +2,7 @@ import fs from 'fs' import path from 'path' import chalk from 'chalk' import consola from 'consola' -import { docRoot, errorAndExit } from '@element-plus/build' +import { docRoot, errorAndExit } from '@element-plus/build-utils' // NB: this file is only for generating files that enables developers to develop the website. const componentLocaleRoot = path.resolve(docRoot, '.vitepress/crowdin') diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index a3d4fd6171..55d0274de0 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,6 +1,6 @@ import consola from 'consola' import { REPO_BRANCH, REPO_PATH } from '@element-plus/build-constants' -import { docsDirName } from '@element-plus/build' +import { docsDirName } from '@element-plus/build-utils' import { languages } from './utils/lang' import { head } from './config/head' import { sidebars } from './config/sidebars' diff --git a/docs/.vitepress/config/head.ts b/docs/.vitepress/config/head.ts index 9062ce950b..75c9f3fac1 100644 --- a/docs/.vitepress/config/head.ts +++ b/docs/.vitepress/config/head.ts @@ -1,8 +1,9 @@ import fs from 'fs' import path from 'path' -import { vpRoot } from '@element-plus/build' +import { vpRoot } from '@element-plus/build-utils' import { languages } from '../utils/lang' import { features } from './features' + import type { HeadConfig } from 'vitepress' export const head: HeadConfig[] = [ diff --git a/docs/.vitepress/config/plugins.ts b/docs/.vitepress/config/plugins.ts index 5cb20378ce..edaf733bc6 100644 --- a/docs/.vitepress/config/plugins.ts +++ b/docs/.vitepress/config/plugins.ts @@ -2,7 +2,7 @@ import path from 'path' import fs from 'fs' import MarkdownIt from 'markdown-it' import mdContainer from 'markdown-it-container' -import { docRoot } from '@element-plus/build' +import { docRoot } from '@element-plus/build-utils' import { highlight } from '../utils/highlight' import type Token from 'markdown-it/lib/token' import type Renderer from 'markdown-it/lib/renderer' diff --git a/docs/.vitepress/plugins/markdown-transform.ts b/docs/.vitepress/plugins/markdown-transform.ts index 13a16c1a86..9bf8245e9c 100644 --- a/docs/.vitepress/plugins/markdown-transform.ts +++ b/docs/.vitepress/plugins/markdown-transform.ts @@ -1,9 +1,10 @@ import fs from 'fs' import path from 'path' -import { docRoot, docsDirName, projRoot } from '@element-plus/build' +import { docRoot, docsDirName, projRoot } from '@element-plus/build-utils' import { REPO_BRANCH, REPO_PATH } from '@element-plus/build-constants' import { getLang } from '../utils/lang' import footerLocale from '../i18n/component/footer.json' + import type { Plugin } from 'vite' type Append = Record<'headers' | 'footers' | 'scriptSetups', string[]> diff --git a/docs/.vitepress/utils/lang.ts b/docs/.vitepress/utils/lang.ts index 05a0c54a14..4fd0d60512 100644 --- a/docs/.vitepress/utils/lang.ts +++ b/docs/.vitepress/utils/lang.ts @@ -1,6 +1,6 @@ import fs from 'fs' import path from 'path' -import { docRoot } from '@element-plus/build' +import { docRoot } from '@element-plus/build-utils' export const languages = fs.readdirSync(path.resolve(__dirname, '../crowdin')) diff --git a/docs/vite.config.ts b/docs/vite.config.ts index 3c2f83197b..a9d27cea01 100644 --- a/docs/vite.config.ts +++ b/docs/vite.config.ts @@ -13,8 +13,9 @@ import { epPackage, getPackageDependencies, projRoot, -} from '@element-plus/build' +} from '@element-plus/build-utils' import { MarkdownTransform } from './.vitepress/plugins/markdown-transform' + import type { Alias } from 'vite' const alias: Alias[] = [] diff --git a/internal/build-utils/package.json b/internal/build-utils/package.json index 3ae460e08c..5b0d23a207 100644 --- a/internal/build-utils/package.json +++ b/internal/build-utils/package.json @@ -1,8 +1,8 @@ { "name": "@element-plus/build-utils", "version": "0.0.1", - "description": "Build utils for Element Plus", "private": true, + "description": "Build utils for Element Plus", "keywords": [ "element-plus" ], @@ -15,6 +15,10 @@ "dev": "pnpm run stub", "stub": "unbuild --stub" }, + "dependencies": { + "@pnpm/find-workspace-packages": "^4.0.0", + "consola": "^2.15.3" + }, "devDependencies": { "unbuild": "^0.7.2" } diff --git a/internal/build-utils/src/index.ts b/internal/build-utils/src/index.ts index 668241973c..e131ecd0ba 100644 --- a/internal/build-utils/src/index.ts +++ b/internal/build-utils/src/index.ts @@ -1 +1,4 @@ export * from './fs' +export * from './log' +export * from './paths' +export * from './pkg' diff --git a/internal/build/src/utils/log.ts b/internal/build-utils/src/log.ts similarity index 100% rename from internal/build/src/utils/log.ts rename to internal/build-utils/src/log.ts diff --git a/internal/build/src/utils/paths.ts b/internal/build-utils/src/paths.ts similarity index 95% rename from internal/build/src/utils/paths.ts rename to internal/build-utils/src/paths.ts index 73050b7e0a..2a8187b588 100644 --- a/internal/build/src/utils/paths.ts +++ b/internal/build-utils/src/paths.ts @@ -1,6 +1,6 @@ import { resolve } from 'path' -export const projRoot = resolve(__dirname, '..', '..', '..', '..') +export const projRoot = resolve(__dirname, '..', '..', '..') export const pkgRoot = resolve(projRoot, 'packages') export const compRoot = resolve(pkgRoot, 'components') export const themeRoot = resolve(pkgRoot, 'theme-chalk') diff --git a/internal/build-utils/src/pkg.ts b/internal/build-utils/src/pkg.ts new file mode 100644 index 0000000000..ba5d3aa5f6 --- /dev/null +++ b/internal/build-utils/src/pkg.ts @@ -0,0 +1,37 @@ +import findWorkspacePackages from '@pnpm/find-workspace-packages' +import { projRoot } from './paths' + +import type { ProjectManifest } from '@pnpm/types' + +export const getWorkspacePackages = () => findWorkspacePackages(projRoot) +export const getWorkspaceNames = async (dir = projRoot) => { + const pkgs = await findWorkspacePackages(projRoot) + return pkgs + .filter((pkg) => pkg.dir.startsWith(dir)) + .map((pkg) => pkg.manifest.name) + .filter((name): name is string => !!name) +} + +export const getPackageManifest = (pkgPath: string) => { + // eslint-disable-next-line @typescript-eslint/no-var-requires + return require(pkgPath) as ProjectManifest +} + +export const getPackageDependencies = ( + pkgPath: string +): Record<'dependencies' | 'peerDependencies', string[]> => { + const manifest = getPackageManifest(pkgPath) + const { dependencies = {}, peerDependencies = {} } = manifest + + return { + dependencies: Object.keys(dependencies), + peerDependencies: Object.keys(peerDependencies), + } +} + +export const excludeFiles = (files: string[]) => { + const excludes = ['node_modules', 'test', 'mock', 'gulpfile', 'dist'] + return files.filter( + (path) => !excludes.some((exclude) => path.includes(exclude)) + ) +} diff --git a/internal/build/gulpfile.ts b/internal/build/gulpfile.ts index 251689b4c5..63ff46dd18 100644 --- a/internal/build/gulpfile.ts +++ b/internal/build/gulpfile.ts @@ -3,15 +3,12 @@ import { copyFile, mkdir } from 'fs/promises' import { copy } from 'fs-extra' import { parallel, series } from 'gulp' import { - buildConfig, buildOutput, epOutput, epPackage, projRoot, - run, - runTask, - withTaskName, -} from './src' +} from '@element-plus/build-utils' +import { buildConfig, run, runTask, withTaskName } from './src' import type { TaskFunction } from 'gulp' import type { Module } from './src' diff --git a/internal/build/package.json b/internal/build/package.json index 7b84b1dbbf..5399129880 100644 --- a/internal/build/package.json +++ b/internal/build/package.json @@ -1,7 +1,7 @@ { "name": "@element-plus/build", - "private": true, "version": "0.0.1", + "private": true, "description": "Build Toolchain for Element Plus", "main": "./dist/index.cjs", "module": "./dist/index.mjs", diff --git a/internal/build/src/build-info.ts b/internal/build/src/build-info.ts index 8970beda2b..25df7b48cf 100644 --- a/internal/build/src/build-info.ts +++ b/internal/build/src/build-info.ts @@ -1,6 +1,7 @@ import path from 'path' import { PKG_NAME } from '@element-plus/build-constants' -import { epOutput } from './utils' +import { epOutput } from '@element-plus/build-utils' + import type { ModuleFormat } from 'rollup' export const modules = ['esm', 'cjs'] as const diff --git a/internal/build/src/tasks/full-bundle.ts b/internal/build/src/tasks/full-bundle.ts index f5184f35ef..91482b657c 100644 --- a/internal/build/src/tasks/full-bundle.ts +++ b/internal/build/src/tasks/full-bundle.ts @@ -10,14 +10,12 @@ import { parallel } from 'gulp' import glob from 'fast-glob' import { camelCase, upperFirst } from 'lodash' import { PKG_BRAND_NAME } from '@element-plus/build-constants' +import { epOutput, epRoot, localeRoot } from '@element-plus/build-utils' import { version } from '../../../../packages/element-plus/version' import { ElementPlusAlias } from '../plugins/element-plus-alias' import { - epOutput, - epRoot, formatBundleFilename, generateExternal, - localeRoot, withTaskName, writeBundles, } from '../utils' diff --git a/internal/build/src/tasks/helper.ts b/internal/build/src/tasks/helper.ts index 4e96001ec6..fdf8ebe91a 100644 --- a/internal/build/src/tasks/helper.ts +++ b/internal/build/src/tasks/helper.ts @@ -1,6 +1,11 @@ import path from 'path' import helper from 'components-helper' -import { epOutput, epPackage, getPackageManifest, projRoot } from '../utils' +import { + epOutput, + epPackage, + getPackageManifest, + projRoot, +} from '@element-plus/build-utils' import type { TaskFunction } from 'gulp' import type { InstallOptions } from 'components-helper' diff --git a/internal/build/src/tasks/modules.ts b/internal/build/src/tasks/modules.ts index f4636ffcd4..ae5a92d5a1 100644 --- a/internal/build/src/tasks/modules.ts +++ b/internal/build/src/tasks/modules.ts @@ -6,13 +6,8 @@ import { nodeResolve } from '@rollup/plugin-node-resolve' import commonjs from '@rollup/plugin-commonjs' import esbuild from 'rollup-plugin-esbuild' import glob from 'fast-glob' -import { - epRoot, - excludeFiles, - generateExternal, - pkgRoot, - writeBundles, -} from '../utils' +import { epRoot, excludeFiles, pkgRoot } from '@element-plus/build-utils' +import { generateExternal, writeBundles } from '../utils' import { ElementPlusAlias } from '../plugins/element-plus-alias' import { buildConfigEntries, target } from '../build-info' diff --git a/internal/build/src/tasks/types-definitions.ts b/internal/build/src/tasks/types-definitions.ts index 060373c422..c9b30e3810 100644 --- a/internal/build/src/tasks/types-definitions.ts +++ b/internal/build/src/tasks/types-definitions.ts @@ -10,10 +10,10 @@ import { buildOutput, epRoot, excludeFiles, - pathRewriter, pkgRoot, projRoot, -} from '../utils' +} from '@element-plus/build-utils' +import { pathRewriter } from '../utils' import typeSafe from '../type-safe.json' import type { SourceFile } from 'ts-morph' diff --git a/internal/build/src/utils/gulp.ts b/internal/build/src/utils/gulp.ts index 26038afc2b..b63d0d24d4 100644 --- a/internal/build/src/utils/gulp.ts +++ b/internal/build/src/utils/gulp.ts @@ -1,5 +1,5 @@ +import { buildRoot } from '@element-plus/build-utils' import { run } from './process' -import { buildRoot } from './paths' import type { TaskFunction } from 'gulp' diff --git a/internal/build/src/utils/index.ts b/internal/build/src/utils/index.ts index ca17b20ffe..34be4d5a07 100644 --- a/internal/build/src/utils/index.ts +++ b/internal/build/src/utils/index.ts @@ -1,6 +1,4 @@ export * from './gulp' -export * from './log' -export * from './paths' export * from './pkg' export * from './process' export * from './rollup' diff --git a/internal/build/src/utils/pkg.ts b/internal/build/src/utils/pkg.ts index 16c848bc52..a203363c22 100644 --- a/internal/build/src/utils/pkg.ts +++ b/internal/build/src/utils/pkg.ts @@ -1,36 +1,7 @@ -import findWorkspacePackages from '@pnpm/find-workspace-packages' import { PKG_PREFIX } from '@element-plus/build-constants' import { buildConfig } from '../build-info' -import { projRoot } from './paths' import type { Module } from '../build-info' -import type { ProjectManifest } from '@pnpm/types' - -export const getWorkspacePackages = () => findWorkspacePackages(projRoot) -export const getWorkspaceNames = async (dir = projRoot) => { - const pkgs = await findWorkspacePackages(projRoot) - return pkgs - .filter((pkg) => pkg.dir.startsWith(dir)) - .map((pkg) => pkg.manifest.name) - .filter((name): name is string => !!name) -} - -export const getPackageManifest = (pkgPath: string) => { - // eslint-disable-next-line @typescript-eslint/no-var-requires - return require(pkgPath) as ProjectManifest -} - -export const getPackageDependencies = ( - pkgPath: string -): Record<'dependencies' | 'peerDependencies', string[]> => { - const manifest = getPackageManifest(pkgPath) - const { dependencies = {}, peerDependencies = {} } = manifest - - return { - dependencies: Object.keys(dependencies), - peerDependencies: Object.keys(peerDependencies), - } -} /** used for type generator */ export const pathRewriter = (module: Module) => { @@ -42,10 +13,3 @@ export const pathRewriter = (module: Module) => { return id } } - -export const excludeFiles = (files: string[]) => { - const excludes = ['node_modules', 'test', 'mock', 'gulpfile', 'dist'] - return files.filter( - (path) => !excludes.some((exclude) => path.includes(exclude)) - ) -} diff --git a/internal/build/src/utils/process.ts b/internal/build/src/utils/process.ts index c94e9be215..0e2e73adb8 100644 --- a/internal/build/src/utils/process.ts +++ b/internal/build/src/utils/process.ts @@ -1,7 +1,7 @@ import { spawn } from 'child_process' import chalk from 'chalk' import consola from 'consola' -import { projRoot } from './paths' +import { projRoot } from '@element-plus/build-utils' export const run = async (command: string, cwd: string = projRoot) => new Promise((resolve, reject) => { diff --git a/internal/build/src/utils/rollup.ts b/internal/build/src/utils/rollup.ts index 95a4d9a1f7..318e55b5bd 100644 --- a/internal/build/src/utils/rollup.ts +++ b/internal/build/src/utils/rollup.ts @@ -1,5 +1,4 @@ -import { epPackage } from './paths' -import { getPackageDependencies } from './pkg' +import { epPackage, getPackageDependencies } from '@element-plus/build-utils' import type { OutputOptions, RollupBuild } from 'rollup' diff --git a/internal/eslint-config/index.js b/internal/eslint-config/index.js index 2d9c115379..4dd6afa7bb 100644 --- a/internal/eslint-config/index.js +++ b/internal/eslint-config/index.js @@ -54,26 +54,41 @@ module.exports = defineConfig({ order: [ 'name', 'version', + 'private', + 'packageManager', 'description', - 'keywords', - 'license', - 'repository', - 'funding', - 'author', 'type', + 'keywords', + 'homepage', + 'bugs', + 'license', + 'author', + 'contributors', + 'funding', 'files', - 'exports', 'main', 'module', + 'exports', 'unpkg', + 'jsdelivr', + 'browser', 'bin', + 'man', + 'directories', + 'repository', + 'publishConfig', 'scripts', - 'husky', - 'lint-staged', 'peerDependencies', 'peerDependenciesMeta', + 'optionalDependencies', 'dependencies', 'devDependencies', + 'engines', + 'config', + 'overrides', + 'pnpm', + 'husky', + 'lint-staged', 'eslintConfig', ], }, diff --git a/internal/eslint-config/package.json b/internal/eslint-config/package.json index eba82ff130..06f4dcc6b4 100644 --- a/internal/eslint-config/package.json +++ b/internal/eslint-config/package.json @@ -7,6 +7,9 @@ "index.js" ], "main": "index.js", + "publishConfig": { + "access": "public" + }, "peerDependencies": { "eslint": "^8.0.0" }, diff --git a/internal/metadata/package.json b/internal/metadata/package.json index 20d5e9a7d7..337c062f09 100644 --- a/internal/metadata/package.json +++ b/internal/metadata/package.json @@ -18,6 +18,13 @@ "build:components": "esno src/components.ts", "dev": "cross-env DEV=1 pnpm run build" }, + "dependencies": { + "chalk": "^4.1.2", + "consola": "^2.15.3", + "fast-glob": "^3.2.11", + "lodash-es": "^4.17.21", + "octokit": "^1.7.1" + }, "devDependencies": { "@element-plus/build": "^0.0.1", "@element-plus/build-constants": "^0.0.1", @@ -25,8 +32,6 @@ "@types/lodash-es": "^4.17.6", "concurrently": "^7.1.0", "cross-env": "^7.0.3", - "esno": "^0.14.1", - "fast-glob": "^3.2.11", - "lodash-es": "^4.17.21" + "esno": "^0.14.1" } } diff --git a/internal/metadata/src/components.ts b/internal/metadata/src/components.ts index 865a54c42e..604d36be42 100644 --- a/internal/metadata/src/components.ts +++ b/internal/metadata/src/components.ts @@ -2,8 +2,7 @@ import path from 'path' import glob from 'fast-glob' import chalk from 'chalk' import consola from 'consola' -import { projRoot } from '@element-plus/build' -import { ensureDir, writeJson } from '@element-plus/build-utils' +import { ensureDir, projRoot, writeJson } from '@element-plus/build-utils' const pathOutput = path.resolve(__dirname, '..', 'dist') diff --git a/internal/metadata/src/contributor.ts b/internal/metadata/src/contributor.ts index 6c63931ce1..ef27fc0eb2 100644 --- a/internal/metadata/src/contributor.ts +++ b/internal/metadata/src/contributor.ts @@ -5,13 +5,17 @@ import { Octokit } from 'octokit' import consola from 'consola' import chalk from 'chalk' import { chunk, mapValues } from 'lodash-es' -import { errorAndExit, projRoot } from '@element-plus/build' +import { + ensureDir, + errorAndExit, + projRoot, + writeJson, +} from '@element-plus/build-utils' import { REPO_BRANCH, REPO_NAME, REPO_OWNER, } from '@element-plus/build-constants' -import { ensureDir, writeJson } from '@element-plus/build-utils' interface FetchOption { key: string diff --git a/package.json b/package.json index 036e47655f..32cb08198f 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,6 @@ "play", "docs" ], - "engines": { - "node": ">= 16" - }, "scripts": { "cz": "git-cz", "test": "pnpm test:jest && pnpm test:vitest", @@ -36,22 +33,9 @@ "docs:crowdin-credentials": "pnpm run -C docs crowdin-credentials", "stub": "pnpm run -r --parallel stub", "prepare": "husky install", - "postinstall": "concurrently \"pnpm gen:version\" \"pnpm stub\" && pnpm run -C internal/metadata dev", + "postinstall": "pnpm stub && concurrently \"pnpm gen:version\" \"pnpm run -C internal/metadata dev\"", "preinstall": "npx only-allow pnpm -y" }, - "config": { - "commitizen": { - "path": "./node_modules/cz-conventional-changelog" - } - }, - "lint-staged": { - "*.{vue,js,ts,jsx,tsx,md,json}": "eslint --fix" - }, - "browserslist": [ - "> 1%", - "not ie 11", - "not op_mini all" - ], "peerDependencies": { "vue": "^3.2.0" }, @@ -87,6 +71,7 @@ "@commitlint/cli": "^16.2.3", "@commitlint/config-conventional": "^16.2.1", "@element-plus/build": "workspace:^0.0.1", + "@element-plus/build-utils": "workspace:^0.0.1", "@element-plus/eslint-config": "workspace:*", "@pnpm/find-workspace-packages": "^4.0.0", "@pnpm/logger": "^4.0.0", @@ -135,9 +120,25 @@ "vue-router": "^4.0.14", "vue-tsc": "^0.33.9" }, + "engines": { + "node": ">= 16" + }, + "config": { + "commitizen": { + "path": "./node_modules/cz-conventional-changelog" + } + }, "pnpm": { "overrides": { "jsdom": "16.4.0" } - } + }, + "lint-staged": { + "*.{vue,js,ts,jsx,tsx,md,json}": "eslint --fix" + }, + "browserslist": [ + "> 1%", + "not ie 11", + "not op_mini all" + ] } diff --git a/packages/components/package.json b/packages/components/package.json index 76737e2eea..adb3a7481c 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -5,11 +5,11 @@ "main": "index.ts", "module": "index.ts", "unpkg": "index.js", + "jsdelivr": "index.js", "peerDependencies": { "vue": "^3.2.0" }, "types": "index.d.ts", - "jsdelivr": "index.js", "sideEffects": false, "gitHead": "c69724230befa8fede0e6b9c37fb0b7e39fd7cdd" } diff --git a/packages/element-plus/package.json b/packages/element-plus/package.json index b4629b2592..5343d24a23 100644 --- a/packages/element-plus/package.json +++ b/packages/element-plus/package.json @@ -2,7 +2,6 @@ "name": "element-plus", "version": "0.0.0-dev.1", "description": "A Component Library for Vue 3", - "homepage": "https://element-plus.org/", "keywords": [ "element-plus", "element", @@ -11,11 +10,13 @@ "ui", "vue" ], - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/element-plus/element-plus.git" + "homepage": "https://element-plus.org/", + "bugs": { + "url": "https://github.com/element-plus/element-plus/issues" }, + "license": "MIT", + "main": "lib/index.js", + "module": "es/index.mjs", "exports": { ".": { "require": "./lib/index.js", @@ -29,11 +30,16 @@ "./lib/*": "./lib/*.js", "./*": "./*" }, - "main": "lib/index.js", - "module": "es/index.mjs", - "style": "dist/index.css", "unpkg": "dist/index.full.js", "jsdelivr": "dist/index.full.js", + "repository": { + "type": "git", + "url": "git+https://github.com/element-plus/element-plus.git" + }, + "publishConfig": { + "access": "public" + }, + "style": "dist/index.css", "sideEffects": [ "dist/*", "theme-chalk/*.css", @@ -41,9 +47,6 @@ "es/components/*/style/*", "lib/components/*/style/*" ], - "bugs": { - "url": "https://github.com/element-plus/element-plus/issues" - }, "peerDependencies": { "vue": "^3.2.0" }, diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 87f62cf547..27b541e69e 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -1,7 +1,7 @@ { "name": "@element-plus/test-utils", - "private": true, "version": "0.0.5", + "private": true, "license": "MIT", "main": "dist/index.js" } diff --git a/packages/theme-chalk/gulpfile.ts b/packages/theme-chalk/gulpfile.ts index 825e311d87..34b186f36a 100644 --- a/packages/theme-chalk/gulpfile.ts +++ b/packages/theme-chalk/gulpfile.ts @@ -7,7 +7,7 @@ import autoprefixer from 'gulp-autoprefixer' import cleanCSS from 'gulp-clean-css' import rename from 'gulp-rename' import consola from 'consola' -import { epOutput } from '@element-plus/build' +import { epOutput } from '@element-plus/build-utils' const distFolder = path.resolve(__dirname, 'dist') const distBundle = path.resolve(epOutput, 'theme-chalk') diff --git a/packages/theme-chalk/package.json b/packages/theme-chalk/package.json index 9aca08b179..c77d38acf9 100644 --- a/packages/theme-chalk/package.json +++ b/packages/theme-chalk/package.json @@ -8,24 +8,24 @@ "theme-chalk", "theme-light" ], - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/element-plus/element-plus.git" + "homepage": "https://github.com/element-plus/element-plus/blob/dev/packages/theme-chalk/README.md", + "bugs": { + "url": "https://github.com/element-plus/element-plus#issues" }, + "license": "MIT", "author": "yi.shyang@ele.me", "main": "index.css", "unpkg": "index.css", "jsdelivr": "index.css", + "repository": { + "type": "git", + "url": "git+https://github.com/element-plus/element-plus.git" + }, "style": "index.css", "scripts": { "clean": "rimraf dist", "build": "gulp --require sucrase/register/ts" }, - "bugs": { - "url": "https://github.com/element-plus/element-plus#issues" - }, - "homepage": "https://github.com/element-plus/element-plus/blob/dev/packages/theme-chalk/README.md", "devDependencies": { "@element-plus/build": "workspace:*", "@types/gulp-autoprefixer": "^0.0.33", diff --git a/packages/tokens/package.json b/packages/tokens/package.json index 11d3680ee2..b1d22021d9 100644 --- a/packages/tokens/package.json +++ b/packages/tokens/package.json @@ -5,10 +5,10 @@ "main": "index.ts", "module": "index.ts", "unpkg": "index.js", + "jsdelivr": "index.js", "peerDependencies": { "vue": "^3.2.0" }, "types": "index.d.js", - "jsdelivr": "index.js", "gitHead": "c69724230befa8fede0e6b9c37fb0b7e39fd7cdd" } diff --git a/play/vite.config.ts b/play/vite.config.ts index ccc18b0b80..22094a0e30 100644 --- a/play/vite.config.ts +++ b/play/vite.config.ts @@ -9,13 +9,8 @@ import mkcert from 'vite-plugin-mkcert' import glob from 'fast-glob' import DefineOptions from 'unplugin-vue-define-options/vite' import esbuild from 'rollup-plugin-esbuild' -import { - epPackage, - epRoot, - getPackageDependencies, - pkgRoot, - projRoot, -} from '@element-plus/build' +import { getPackageDependencies } from '@element-plus/build' +import { epPackage, epRoot, pkgRoot, projRoot } from '@element-plus/build-utils' import './vite.init' const esbuildPlugin = () => ({ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6c20e2ced6..97d0a6cb21 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,6 +13,7 @@ importers: '@commitlint/cli': ^16.2.3 '@commitlint/config-conventional': ^16.2.1 '@element-plus/build': workspace:^0.0.1 + '@element-plus/build-utils': workspace:^0.0.1 '@element-plus/components': workspace:* '@element-plus/constants': workspace:* '@element-plus/directives': workspace:* @@ -114,6 +115,7 @@ importers: '@commitlint/cli': 16.2.3 '@commitlint/config-conventional': 16.2.1 '@element-plus/build': link:internal/build + '@element-plus/build-utils': link:internal/build-utils '@element-plus/eslint-config': link:internal/eslint-config '@pnpm/find-workspace-packages': 4.0.0_@pnpm+logger@4.0.0 '@pnpm/logger': 4.0.0 @@ -274,7 +276,12 @@ importers: internal/build-utils: specifiers: + '@pnpm/find-workspace-packages': ^4.0.0 + consola: ^2.15.3 unbuild: ^0.7.2 + dependencies: + '@pnpm/find-workspace-packages': 4.0.0_@pnpm+logger@4.0.0 + consola: 2.15.3 devDependencies: unbuild: 0.7.2 @@ -314,11 +321,20 @@ importers: '@element-plus/build-constants': ^0.0.1 '@element-plus/build-utils': ^0.0.1 '@types/lodash-es': ^4.17.6 + chalk: ^4.1.2 concurrently: ^7.1.0 + consola: ^2.15.3 cross-env: ^7.0.3 esno: ^0.14.1 fast-glob: ^3.2.11 lodash-es: ^4.17.21 + octokit: ^1.7.1 + dependencies: + chalk: 4.1.2 + consola: 2.15.3 + fast-glob: 3.2.11 + lodash-es: 4.17.21 + octokit: 1.7.1 devDependencies: '@element-plus/build': link:../build '@element-plus/build-constants': link:../build-constants @@ -327,8 +343,6 @@ importers: concurrently: 7.1.0 cross-env: 7.0.3 esno: 0.14.1 - fast-glob: 3.2.11 - lodash-es: 4.17.21 packages/components: specifiers: {} @@ -2250,14 +2264,13 @@ packages: dependencies: '@octokit/auth-app': 3.6.1 '@octokit/auth-unauthenticated': 2.1.0 - '@octokit/core': 3.5.1 + '@octokit/core': 3.6.0 '@octokit/oauth-app': 3.6.0 - '@octokit/plugin-paginate-rest': 2.17.0_@octokit+core@3.5.1 + '@octokit/plugin-paginate-rest': 2.17.0_@octokit+core@3.6.0 '@octokit/types': 6.34.0 '@octokit/webhooks': 9.22.0 transitivePeerDependencies: - encoding - dev: true /@octokit/auth-app/3.6.1: resolution: {integrity: sha512-6oa6CFphIYI7NxxHrdVOzhG7hkcKyGyYocg7lNDSJVauVOLtylg8hNJzoUyPAYKKK0yUeoZamE/lMs2tG+S+JA==} @@ -2274,7 +2287,6 @@ packages: universal-user-agent: 6.0.0 transitivePeerDependencies: - encoding - dev: true /@octokit/auth-oauth-app/4.3.0: resolution: {integrity: sha512-cETmhmOQRHCz6cLP7StThlJROff3A/ln67Q961GuIr9zvyFXZ4lIJy9RE6Uw5O7D8IXWPU3jhDnG47FTSGQr8Q==} @@ -2288,7 +2300,6 @@ packages: universal-user-agent: 6.0.0 transitivePeerDependencies: - encoding - dev: true /@octokit/auth-oauth-device/3.1.2: resolution: {integrity: sha512-w7Po4Ck6N2aAn2VQyKLuojruiyKROTBv4qs6IwE5rbwF7HhBXXp4A/NKmkpoFIZkiXQtM+N8QtkSck4ApYWdGg==} @@ -2299,7 +2310,6 @@ packages: universal-user-agent: 6.0.0 transitivePeerDependencies: - encoding - dev: true /@octokit/auth-oauth-user/1.3.0: resolution: {integrity: sha512-3QC/TAdk7onnxfyZ24BnJRfZv8TRzQK7SEFUS9vLng4Vv6Hv6I64ujdk/CUkREec8lhrwU764SZ/d+yrjjqhaQ==} @@ -2312,34 +2322,17 @@ packages: universal-user-agent: 6.0.0 transitivePeerDependencies: - encoding - dev: true /@octokit/auth-token/2.5.0: resolution: {integrity: sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==} dependencies: '@octokit/types': 6.34.0 - dev: true /@octokit/auth-unauthenticated/2.1.0: resolution: {integrity: sha512-+baofLfSL0CAv3CfGQ9rxiZZQEX8VNJMGuuS4PgrMRBUL52Ho5+hQYb63UJQshw7EXYMPDZxbXznc0y33cbPqw==} dependencies: '@octokit/request-error': 2.1.0 '@octokit/types': 6.34.0 - dev: true - - /@octokit/core/3.5.1: - resolution: {integrity: sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==} - dependencies: - '@octokit/auth-token': 2.5.0 - '@octokit/graphql': 4.8.0 - '@octokit/request': 5.6.3 - '@octokit/request-error': 2.1.0 - '@octokit/types': 6.34.0 - before-after-hook: 2.2.2 - universal-user-agent: 6.0.0 - transitivePeerDependencies: - - encoding - dev: true /@octokit/core/3.6.0: resolution: {integrity: sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==} @@ -2353,7 +2346,6 @@ packages: universal-user-agent: 6.0.0 transitivePeerDependencies: - encoding - dev: true /@octokit/endpoint/6.0.12: resolution: {integrity: sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==} @@ -2361,7 +2353,6 @@ packages: '@octokit/types': 6.34.0 is-plain-object: 5.0.0 universal-user-agent: 6.0.0 - dev: true /@octokit/graphql/4.8.0: resolution: {integrity: sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==} @@ -2371,7 +2362,6 @@ packages: universal-user-agent: 6.0.0 transitivePeerDependencies: - encoding - dev: true /@octokit/oauth-app/3.6.0: resolution: {integrity: sha512-OxPw4ItQXaC2GuEXyZB7EmZ2rHvNFX4y3yAsqdFIRW7qg2HyoEPxacxza6c8wqbEEvu84b98AJ5BXm+IjPWrww==} @@ -2379,7 +2369,7 @@ packages: '@octokit/auth-oauth-app': 4.3.0 '@octokit/auth-oauth-user': 1.3.0 '@octokit/auth-unauthenticated': 2.1.0 - '@octokit/core': 3.5.1 + '@octokit/core': 3.6.0 '@octokit/oauth-authorization-url': 4.3.3 '@octokit/oauth-methods': 1.2.6 '@types/aws-lambda': 8.10.93 @@ -2387,11 +2377,9 @@ packages: universal-user-agent: 6.0.0 transitivePeerDependencies: - encoding - dev: true /@octokit/oauth-authorization-url/4.3.3: resolution: {integrity: sha512-lhP/t0i8EwTmayHG4dqLXgU+uPVys4WD/qUNvC+HfB1S1dyqULm5Yx9uKc1x79aP66U1Cb4OZeW8QU/RA9A4XA==} - dev: true /@octokit/oauth-methods/1.2.6: resolution: {integrity: sha512-nImHQoOtKnSNn05uk2o76om1tJWiAo4lOu2xMAHYsNr0fwopP+Dv+2MlGvaMMlFjoqVd3fF3X5ZDTKCsqgmUaQ==} @@ -2403,20 +2391,9 @@ packages: btoa-lite: 1.0.0 transitivePeerDependencies: - encoding - dev: true /@octokit/openapi-types/11.2.0: resolution: {integrity: sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA==} - dev: true - - /@octokit/plugin-paginate-rest/2.17.0_@octokit+core@3.5.1: - resolution: {integrity: sha512-tzMbrbnam2Mt4AhuyCHvpRkS0oZ5MvwwcQPYGtMv4tUa5kkzG58SVB0fcsLulOZQeRnOgdkZWkRUiyBlh0Bkyw==} - peerDependencies: - '@octokit/core': '>=2' - dependencies: - '@octokit/core': 3.5.1 - '@octokit/types': 6.34.0 - dev: true /@octokit/plugin-paginate-rest/2.17.0_@octokit+core@3.6.0: resolution: {integrity: sha512-tzMbrbnam2Mt4AhuyCHvpRkS0oZ5MvwwcQPYGtMv4tUa5kkzG58SVB0fcsLulOZQeRnOgdkZWkRUiyBlh0Bkyw==} @@ -2425,7 +2402,6 @@ packages: dependencies: '@octokit/core': 3.6.0 '@octokit/types': 6.34.0 - dev: true /@octokit/plugin-request-log/1.0.4_@octokit+core@3.6.0: resolution: {integrity: sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==} @@ -2435,16 +2411,6 @@ packages: '@octokit/core': 3.6.0 dev: true - /@octokit/plugin-rest-endpoint-methods/5.13.0_@octokit+core@3.5.1: - resolution: {integrity: sha512-uJjMTkN1KaOIgNtUPMtIXDOjx6dGYysdIFhgA52x4xSadQCz3b/zJexvITDVpANnfKPW/+E0xkOvLntqMYpviA==} - peerDependencies: - '@octokit/core': '>=3' - dependencies: - '@octokit/core': 3.5.1 - '@octokit/types': 6.34.0 - deprecation: 2.3.1 - dev: true - /@octokit/plugin-rest-endpoint-methods/5.13.0_@octokit+core@3.6.0: resolution: {integrity: sha512-uJjMTkN1KaOIgNtUPMtIXDOjx6dGYysdIFhgA52x4xSadQCz3b/zJexvITDVpANnfKPW/+E0xkOvLntqMYpviA==} peerDependencies: @@ -2453,24 +2419,21 @@ packages: '@octokit/core': 3.6.0 '@octokit/types': 6.34.0 deprecation: 2.3.1 - dev: true /@octokit/plugin-retry/3.0.9: resolution: {integrity: sha512-r+fArdP5+TG6l1Rv/C9hVoty6tldw6cE2pRHNGmFPdyfrc696R6JjrQ3d7HdVqGwuzfyrcaLAKD7K8TX8aehUQ==} dependencies: '@octokit/types': 6.34.0 bottleneck: 2.19.5 - dev: true - /@octokit/plugin-throttling/3.6.1_@octokit+core@3.5.1: + /@octokit/plugin-throttling/3.6.1_@octokit+core@3.6.0: resolution: {integrity: sha512-T5DOcDQP0K/Ng5pnOEqCHDFojsftYL5o91MNbbR3nj1yAOACoGj3wDYCx0+5yJkbvRjYUdU0GsUt5/wYBba1cA==} peerDependencies: '@octokit/core': ^3.5.0 dependencies: - '@octokit/core': 3.5.1 + '@octokit/core': 3.6.0 '@octokit/types': 6.34.0 bottleneck: 2.19.5 - dev: true /@octokit/request-error/2.1.0: resolution: {integrity: sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==} @@ -2478,7 +2441,6 @@ packages: '@octokit/types': 6.34.0 deprecation: 2.3.1 once: 1.4.0 - dev: true /@octokit/request/5.6.3: resolution: {integrity: sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==} @@ -2491,7 +2453,6 @@ packages: universal-user-agent: 6.0.0 transitivePeerDependencies: - encoding - dev: true /@octokit/rest/18.12.0: resolution: {integrity: sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q==} @@ -2508,15 +2469,12 @@ packages: resolution: {integrity: sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==} dependencies: '@octokit/openapi-types': 11.2.0 - dev: true /@octokit/webhooks-methods/2.0.0: resolution: {integrity: sha512-35cfQ4YWlnZnmZKmIxlGPUPLtbkF8lr/A/1Sk1eC0ddLMwQN06dOuLc+dI3YLQS+T+MoNt3DIQ0NynwgKPilig==} - dev: true /@octokit/webhooks-types/5.2.0: resolution: {integrity: sha512-OZhKy1w8/GF4GWtdiJc+o8sloWAHRueGB78FWFLZnueK7EHV9MzDVr4weJZMflJwMK4uuYLzcnJVnAoy3yB35g==} - dev: true /@octokit/webhooks/9.22.0: resolution: {integrity: sha512-wUd7nGfDRHG6xkz311djmq6lIB2tQ+r94SNkyv9o0bQhOsrkwH8fQCM7uVsbpkGUU2lqCYsVoa8z/UC9HJgRaw==} @@ -2525,7 +2483,6 @@ packages: '@octokit/webhooks-methods': 2.0.0 '@octokit/webhooks-types': 5.2.0 aggregate-error: 3.1.0 - dev: true /@pnpm/cli-meta/3.0.0: resolution: {integrity: sha512-7qFkZf45PQbTTVbRvzUGt7illwXUUWdkv8PekgvpFMEjxZC1zx7mY4mMF9P66QOh5NgarbGSvc7Nqt9yEDh00Q==} @@ -2849,7 +2806,6 @@ packages: /@types/aws-lambda/8.10.93: resolution: {integrity: sha512-Vsyi9ogDAY3REZDjYnXMRJJa62SDvxHXxJI5nGDQdZW058dDE+av/anynN2rLKbCKXDRNw3D/sQmqxVflZFi4A==} - dev: true /@types/babel__core/7.1.19: resolution: {integrity: sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw==} @@ -2882,7 +2838,6 @@ packages: /@types/btoa-lite/1.0.0: resolution: {integrity: sha512-wJsiX1tosQ+J5+bY5LrSahHxr2wT+uME5UDwdN1kg4frt40euqA+wzECkmq4t5QbveHiJepfdThgQrPw6KiSlg==} - dev: true /@types/chai-subset/1.3.3: resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==} @@ -3007,7 +2962,6 @@ packages: resolution: {integrity: sha512-zm6xBQpFDIDM6o9r6HSgDeIcLy82TKWctCXEPbJJcXb5AKmi5BNNdLXneixK4lplX3PqIVcwLBCGE/kAGnlD4A==} dependencies: '@types/node': 17.0.23 - dev: true /@types/linkify-it/3.0.2: resolution: {integrity: sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==} @@ -3023,7 +2977,6 @@ packages: /@types/lru-cache/5.1.1: resolution: {integrity: sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==} - dev: true /@types/markdown-it/12.2.3: resolution: {integrity: sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==} @@ -3711,7 +3664,6 @@ packages: dependencies: clean-stack: 2.2.0 indent-string: 4.0.0 - dev: true /ajv/6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} @@ -4228,7 +4180,6 @@ packages: /before-after-hook/2.2.2: resolution: {integrity: sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==} - dev: true /better-path-resolve/1.0.0: resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} @@ -4270,7 +4221,6 @@ packages: /bottleneck/2.19.5: resolution: {integrity: sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==} - dev: true /boxen/5.1.2: resolution: {integrity: sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==} @@ -4347,7 +4297,6 @@ packages: /btoa-lite/1.0.0: resolution: {integrity: sha1-M3dm2hWAEhD92VbCLpxokaudAzc=} - dev: true /buffer-crc32/0.2.13: resolution: {integrity: sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=} @@ -4355,7 +4304,6 @@ packages: /buffer-equal-constant-time/1.0.1: resolution: {integrity: sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=} - dev: true /buffer-equal/1.0.0: resolution: {integrity: sha1-WWFrSYME1Var1GaWayLu2j7KX74=} @@ -4625,7 +4573,6 @@ packages: /clean-stack/2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} engines: {node: '>=6'} - dev: true /cli-boxes/2.2.1: resolution: {integrity: sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==} @@ -5251,7 +5198,6 @@ packages: /deprecation/2.3.1: resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} - dev: true /detect-file/1.0.0: resolution: {integrity: sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=} @@ -5354,7 +5300,6 @@ packages: resolution: {integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==} dependencies: safe-buffer: 5.2.1 - dev: true /electron-to-chromium/1.4.103: resolution: {integrity: sha512-c/uKWR1Z/W30Wy/sx3dkZoj4BijbXX85QKWu9jJfjho3LBAXNEGAEW3oWiGb+dotA6C6BzCTxL2/aLes7jlUeg==} @@ -6788,7 +6733,6 @@ packages: /fromentries/1.3.2: resolution: {integrity: sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==} - dev: true /fs-constants/1.0.0: resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} @@ -8442,7 +8386,6 @@ packages: lodash.once: 4.1.1 ms: 2.1.3 semver: 5.7.1 - dev: true /jsprim/1.4.2: resolution: {integrity: sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==} @@ -8464,14 +8407,12 @@ packages: buffer-equal-constant-time: 1.0.1 ecdsa-sig-formatter: 1.0.11 safe-buffer: 5.2.1 - dev: true /jws/3.2.2: resolution: {integrity: sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==} dependencies: jwa: 1.4.1 safe-buffer: 5.2.1 - dev: true /kind-of/3.2.2: resolution: {integrity: sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=} @@ -8670,6 +8611,7 @@ packages: /lodash-es/4.17.21: resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} + dev: false /lodash-unified/1.0.2_da03a4540fbd16bbaafbb96724306afd: resolution: {integrity: sha512-OGbEy+1P+UT26CYi4opY4gebD8cWRDxAT6MAObIVQMiqYdxZr1g3QHWCToVsm31x2NkLS4K3+MC2qInaRMa39g==} @@ -8693,27 +8635,21 @@ packages: /lodash.includes/4.3.0: resolution: {integrity: sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=} - dev: true /lodash.isboolean/3.0.3: resolution: {integrity: sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=} - dev: true /lodash.isinteger/4.0.4: resolution: {integrity: sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=} - dev: true /lodash.isnumber/3.0.3: resolution: {integrity: sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=} - dev: true /lodash.isplainobject/4.0.6: resolution: {integrity: sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=} - dev: true /lodash.isstring/4.0.1: resolution: {integrity: sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=} - dev: true /lodash.map/4.6.0: resolution: {integrity: sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=} @@ -8725,7 +8661,6 @@ packages: /lodash.once/4.1.1: resolution: {integrity: sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=} - dev: true /lodash/4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} @@ -9179,7 +9114,6 @@ packages: optional: true dependencies: whatwg-url: 5.0.0 - dev: true /node-int64/0.4.0: resolution: {integrity: sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=} @@ -9362,16 +9296,15 @@ packages: resolution: {integrity: sha512-1b7eRgU8uWetHOWr8f9ptnVo2EKbrkOfocMeQdpgCt7tl/LK67HptFsy2Xg4fMjsJ/+onoBJW0hy/fO0In3/uA==} dependencies: '@octokit/app': 12.0.5 - '@octokit/core': 3.5.1 + '@octokit/core': 3.6.0 '@octokit/oauth-app': 3.6.0 - '@octokit/plugin-paginate-rest': 2.17.0_@octokit+core@3.5.1 - '@octokit/plugin-rest-endpoint-methods': 5.13.0_@octokit+core@3.5.1 + '@octokit/plugin-paginate-rest': 2.17.0_@octokit+core@3.6.0 + '@octokit/plugin-rest-endpoint-methods': 5.13.0_@octokit+core@3.6.0 '@octokit/plugin-retry': 3.0.9 - '@octokit/plugin-throttling': 3.6.1_@octokit+core@3.5.1 + '@octokit/plugin-throttling': 3.6.1_@octokit+core@3.6.0 '@octokit/types': 6.34.0 transitivePeerDependencies: - encoding - dev: true /once/1.4.0: resolution: {integrity: sha1-WDsap3WWHUsROsF9nFC6753Xa9E=} @@ -11169,7 +11102,6 @@ packages: /tr46/0.0.3: resolution: {integrity: sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=} - dev: true /tr46/2.1.0: resolution: {integrity: sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==} @@ -11513,11 +11445,9 @@ packages: dependencies: '@types/jsonwebtoken': 8.5.8 jsonwebtoken: 8.5.1 - dev: true /universal-user-agent/6.0.0: resolution: {integrity: sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==} - dev: true /universalify/0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} @@ -12156,7 +12086,6 @@ packages: /webidl-conversions/3.0.1: resolution: {integrity: sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=} - dev: true /webidl-conversions/5.0.0: resolution: {integrity: sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==} @@ -12190,7 +12119,6 @@ packages: dependencies: tr46: 0.0.3 webidl-conversions: 3.0.1 - dev: true /whatwg-url/8.7.0: resolution: {integrity: sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==} diff --git a/scripts/build-table.ts b/scripts/build-table.ts index ce4bf195b0..19e711b040 100644 --- a/scripts/build-table.ts +++ b/scripts/build-table.ts @@ -1,8 +1,6 @@ import fs from 'fs/promises' import path from 'path' -main() - async function main() { const threshold = process.env.THRESHOLD || 40 let output: string @@ -54,3 +52,5 @@ ${table} await fs.writeFile(path.resolve(__dirname, '..', 'tmp/diff.md'), output) } + +main() diff --git a/scripts/gen-version.ts b/scripts/gen-version.ts index 137473ddcc..b591ffe4d9 100644 --- a/scripts/gen-version.ts +++ b/scripts/gen-version.ts @@ -1,17 +1,26 @@ -import fs from 'fs' +import { writeFile } from 'fs/promises' import path from 'path' +import consola from 'consola' +import { epRoot } from '@element-plus/build-utils' import pkg from '../packages/element-plus/package.json' // need to be checked -const tagVer = process.env.TAG_VERSION -let version = '' -if (tagVer) { - version = tagVer.startsWith('v') ? tagVer.slice(1) : tagVer -} else { - version = pkg.version +function getVersion() { + const tagVer = process.env.TAG_VERSION + if (tagVer) { + return tagVer.startsWith('v') ? tagVer.slice(1) : tagVer + } else { + return pkg.version + } } -fs.writeFileSync( - path.resolve(__dirname, '../packages/element-plus/version.ts'), - `export const version = '${version}' -` -) +const version = getVersion() + +async function main() { + consola.info(`Version: ${version}`) + await writeFile( + path.resolve(epRoot, 'version.ts'), + `export const version = '${version}'\n` + ) +} + +main() diff --git a/scripts/publish.sh b/scripts/publish.sh index e1555f505c..ea87730a6c 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -8,7 +8,16 @@ pnpm update:version pnpm build cd dist/element-plus -npm publish --access public +npm publish +cd - + +cd internal/eslint-config +npm publish +cd - + +cd internal/metadata +pnpm build +npm publish cd - echo "✅ Publish completed" diff --git a/scripts/update-version.ts b/scripts/update-version.ts index c9b0d6fc44..4271710996 100644 --- a/scripts/update-version.ts +++ b/scripts/update-version.ts @@ -1,18 +1,17 @@ -import { writeFile } from 'fs/promises' import consola from 'consola' import chalk from 'chalk' -import { epPackage, getPackageManifest } from '@element-plus/build' +import { errorAndExit, getWorkspacePackages } from '@element-plus/build-utils' +import type { Project } from '@pnpm/find-workspace-packages' async function main() { const tagVersion = process.env.TAG_VERSION const gitHead = process.env.GIT_HEAD if (!tagVersion || !gitHead) { - consola.error( + errorAndExit( new Error( 'No tag version or git head were found, make sure that you set the environment variable $TAG_VERSION \n' ) ) - process.exit(1) } consola.log(chalk.cyan('Start updating version')) @@ -21,21 +20,27 @@ async function main() { consola.debug(chalk.yellow(`Updating package.json for element-plus`)) - const json: Record = getPackageManifest(epPackage) + const pkgs = Object.fromEntries( + (await getWorkspacePackages()).map((pkg) => [pkg.manifest.name!, pkg]) + ) + const elementPlus = pkgs['element-plus'] + const eslintConfig = pkgs['@element-plus/eslint-config'] + const metadata = pkgs['@element-plus/metadata'] - json.version = tagVersion - json.gitHead = gitHead + const writeVersion = async (project: Project) => { + await project.writeProjectManifest({ + ...project.manifest, + version: tagVersion, + gitHead, + } as any) + } - if (!(process.argv.includes('-d') || process.argv.includes('--dry-run'))) { - try { - await writeFile(epPackage, JSON.stringify(json, null, 2), { - encoding: 'utf-8', - }) - } catch { - process.exit(1) - } - } else { - consola.log(json) + try { + writeVersion(elementPlus) + writeVersion(eslintConfig) + writeVersion(metadata) + } catch (err) { + errorAndExit(err) } consola.debug(chalk.green(`$GIT_HEAD: ${gitHead}`))