diff --git a/.browserslistrc b/.browserslistrc deleted file mode 100644 index dc3bc09..0000000 --- a/.browserslistrc +++ /dev/null @@ -1,4 +0,0 @@ -> 1% -last 2 versions -not dead -not ie 11 diff --git a/.env b/.env index 0f051fc..3ca497c 100644 --- a/.env +++ b/.env @@ -1,11 +1,11 @@ # 项目基本地址 VITE_BASE_URL=/ # 项目名称 -VITE_APP_NAME=N-Admin后台管理系统 +VITE_APP_NAME=NPin 后台管理系统 # 项目标题 -VITE_APP_TITLE=N-Admin后台管理系统 +VITE_APP_TITLE=NPin 后台管理系统 # 项目描述 -VITE_APP_DESC=N-Admin Background Management System +VITE_APP_DESC=NPin Background Management System # API访问地址 VITE_API_URL=/api @@ -20,12 +20,14 @@ VITE_ICON_LOCAL_PREFIX=nl VITE_ICON_UNOCSS_PREFIX=i # 是否开启请求代理 VITE_HTTP_PROXY=false + # 是否开启打包文件大小结果分析 -VITE_VISUALIZER=true +# VITE_VISUALIZER=true + # 是否开启打包压缩 gzip | brotliCompress | deflate | deflateRaw VITE_COMPRESS='none' # 是否应用pwa -VITE_PWA=false +VITE_PWA=true # 是否启用Markdown插件 VITE_MARKDOWN=true # 是否开启Mock diff --git a/.gitignore b/.gitignore index 689f001..3eba26f 100644 --- a/.gitignore +++ b/.gitignore @@ -32,7 +32,4 @@ pnpm-debug.log* *.sln *.sw? -package-lock.json -pnpm-lock.yaml - .history \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 6f913a9..3e3a684 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16-alpine as build-stage +FROM node:20-alpine as build-stage WORKDIR /app RUN corepack enable diff --git a/README.md b/README.md index e98c063..d03afc3 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# N-Admin-UI-Vitesse \ No newline at end of file +# NPinFront-UI-Vitesse diff --git a/build/primevue/index.ts b/build/primevue/index.ts new file mode 100644 index 0000000..a6a9390 --- /dev/null +++ b/build/primevue/index.ts @@ -0,0 +1,187 @@ +import type { ComponentResolver, SideEffectsInfo } from 'unplugin-vue-components' + +const components = [ + // Form + 'AutoComplete', + 'Calendar', + 'CascadeSelect', + 'Checkbox', + 'Chips', + 'ColorPicker', + 'Dropdown', + 'Editor', + 'FloatLabel', + 'IconField', + 'InputGroup', + 'InputMask', + 'InputNumber', + 'InputOtp', + 'InputSwitch', + 'InputText', + 'Knob', + 'Listbox', + 'MultiSelect', + 'Password', + 'RadioButton', + 'Rating', + 'SelectButton', + 'Slider', + 'Textarea', + 'ToggleButton', + 'TreeSelect', + + // Button + 'Button', + 'SpeedDial', + 'SplitButton', + + // Data + 'DataTable', + 'DataView', + 'OrderList', + 'OrgChart', + 'Paginator', + 'PickList', + 'Tree', + 'TreeTable', + 'Timeline', + 'VirtualScroller', + + // Panel + 'Accordion', + 'Card', + 'Deferred', + 'Divider', + 'Fieldset', + 'Panel', + 'ScrollPanel', + 'Splitter', + 'Stepper', + 'TabView', + 'TabPanel', + 'Toolbar', + + // Overlay + 'ConfirmDialog', + 'ConfirmPopup', + 'DynamicDialog', + 'Tooltip', // need to add directive + // must be registered globally in order for the XXX service to work properly + 'OverlayPanel', + 'Sidebar', + + // File + 'FileUpload', + + // Menu + 'Breadcrumb', + 'ContextMenu', + 'Dock', + 'Menu', + 'Menubar', + 'MegaMenu', + 'PanelMenu', + 'Steps', + 'TabMenu', + 'TieredMenu', + + // Messages + 'Toast', + // Toast must be registered globally in order for the XXX service to work properly + 'Message', + 'InlineMessage', + + // Media + 'Carousel', + 'Galleria', + 'Image', + + // Misc + 'Avatar', + 'Badge', + 'BlockUI', + 'Chip', + 'FocusTrap', + 'Inplace', + 'MeterGroup', + 'ScrollTop', + 'Skeleton', + 'ProgressBar', + 'ProgressSpinner', + 'AnimateOnScroll', + 'Ripple', + 'StyleClass', + 'Tag', + 'Terminal', +] + +export interface PrimeVueResolverOptions { + /** + * import style along with components + * + * @default true + */ + importStyle?: boolean + /** + * import `primeicons' icons + * + * requires package `primeicons` + * + * @default true + */ + importIcons?: boolean + /** + * imports a free theme - set theme name here (e.g. saga-blue) + * + * @default '' + */ + importTheme?: string + /** + * prefix for components (e.g. 'P' to resolve Menu from PMenu) + * + * @default '' + */ + prefix?: string +} + +/** + * Resolver for PrimeVue - If you're using a component with the same tag as an native HTML element (e.g. button) the component must be in uppercase + * + * @link https://github.com/primefaces/primevue + */ +export function PrimeVueResolver(options: PrimeVueResolverOptions = {}): ComponentResolver { + return { + type: 'component', + resolve: (name: string) => { + const sideEffects: SideEffectsInfo = [] + + if (options.importStyle) { + sideEffects.push('primevue/resources/primevue.min.css') + } + + if (options.importIcons) { + sideEffects.push('primeicons/primeicons.css') + } + + if (options.importTheme) { + sideEffects.push( + `primevue/resources/themes/${options.importTheme}/theme.css`, + ) + } + + if (options.prefix) { + if (!name.startsWith(options.prefix)) { + return + } + name = name.substring(options.prefix.length) + } + + if (components.includes(name)) { + return { + from: `primevue/${name.toLowerCase()}`, + sideEffects, + } + } + }, + } +} diff --git a/eslint.config.js b/eslint.config.mjs similarity index 80% rename from eslint.config.js rename to eslint.config.mjs index 16f53d4..c97a1db 100644 --- a/eslint.config.js +++ b/eslint.config.mjs @@ -1,8 +1,9 @@ import antfu from '@antfu/eslint-config' -import unocss from '@unocss/eslint-plugin' export default antfu( { + unocss: true, + formatters: true, languageOptions: {}, rules: { 'curly': 'off', @@ -12,5 +13,4 @@ export default antfu( 'no-console': 'off', }, }, - unocss.configs.flat, ) diff --git a/index.html b/index.html index 0b566f9..ec4018c 100644 --- a/index.html +++ b/index.html @@ -1,32 +1,34 @@ - + +
+ + + + + + + +