@easy-editor/materials-dashboard-scroll-list 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +0,0 @@
1
- /**
2
- * Scroll List Configure
3
- * 滚动列表组件配置
4
- */
5
- import type { Configure } from '@easy-editor/core';
6
- export declare const configure: Configure;
7
- export default configure;
@@ -1,16 +0,0 @@
1
- /**
2
- * 物料常量配置
3
- * 统一管理全局变量名等配置,确保 meta.ts 和 rollup.config.js 使用相同的值
4
- */
5
- /**
6
- * UMD 全局变量基础名称
7
- * 用于构建:
8
- * - 元数据:${GLOBAL_NAME}Meta (例如: EasyEditorMaterialsRankingListMeta)
9
- * - 组件:${GLOBAL_NAME}Component (例如: EasyEditorMaterialsRankingListComponent)
10
- * - 完整构建:${GLOBAL_NAME} (例如: EasyEditorMaterialsRankingList)
11
- */
12
- export declare const COMPONENT_NAME = "EasyEditorMaterialsScrollList";
13
- /**
14
- * 包名
15
- */
16
- export declare const PACKAGE_NAME = "@easy-editor/materials-dashboard-scroll-list";
@@ -1,6 +0,0 @@
1
- /**
2
- * Scroll List Entry
3
- * 滚动列表组件入口
4
- */
5
- export { ScrollList as component } from './component';
6
- export { default as meta } from './meta';
@@ -1,7 +0,0 @@
1
- /**
2
- * Scroll List Meta
3
- * 滚动列表组件元数据
4
- */
5
- import type { ComponentMetadata } from '@easy-editor/core';
6
- export declare const meta: ComponentMetadata;
7
- export default meta;
@@ -1,7 +0,0 @@
1
- /**
2
- * Scroll List Snippets
3
- * 滚动列表组件代码片段
4
- */
5
- import type { Snippet } from '@easy-editor/core';
6
- export declare const snippets: Snippet[];
7
- export default snippets;
package/rollup.config.js DELETED
@@ -1,222 +0,0 @@
1
- import babel from '@rollup/plugin-babel'
2
- import commonjs from '@rollup/plugin-commonjs'
3
- import nodeResolve from '@rollup/plugin-node-resolve'
4
- import json from '@rollup/plugin-json'
5
- import { terser } from 'rollup-plugin-terser'
6
- import cleanup from 'rollup-plugin-cleanup'
7
- import postcss from 'rollup-plugin-postcss'
8
- import pkg from './package.json' with { type: 'json' }
9
-
10
- const GLOBAL_NAME = 'EasyEditorMaterialsRankingList'
11
-
12
- // 外部依赖(不打包进组件)
13
- const external = ['react', 'react-dom', 'react/jsx-runtime', '@easy-editor/core']
14
-
15
- const globals = {
16
- react: 'React',
17
- 'react-dom': 'ReactDOM',
18
- 'react/jsx-runtime': 'jsxRuntime',
19
- '@easy-editor/core': 'EasyEditorCore',
20
- }
21
-
22
- const plugins = [
23
- nodeResolve({
24
- extensions: ['.js', '.ts', '.jsx', '.tsx'],
25
- }),
26
- commonjs(),
27
- json(),
28
- postcss({
29
- modules: {
30
- generateScopedName: '[name]__[local]___[hash:base64:5]',
31
- },
32
- autoModules: true,
33
- minimize: true,
34
- inject: true,
35
- }),
36
- babel({
37
- extensions: ['.js', '.ts', '.jsx', '.tsx'],
38
- exclude: 'node_modules/**',
39
- babelrc: false,
40
- babelHelpers: 'bundled',
41
- presets: [
42
- ['@babel/preset-react', { runtime: 'automatic' }],
43
- [
44
- '@babel/preset-typescript',
45
- {
46
- allowDeclareFields: true,
47
- },
48
- ],
49
- ],
50
- }),
51
- cleanup({
52
- comments: ['some', /PURE/],
53
- extensions: ['.js', '.ts'],
54
- }),
55
- ]
56
-
57
- export default [
58
- /* ---------------------------------- 元数据构建 --------------------------------- */
59
- // 元数据 ESM 构建(用于动态 import)
60
- {
61
- input: 'src/meta.ts',
62
- output: [
63
- {
64
- file: 'dist/meta.esm.js',
65
- format: 'esm',
66
- sourcemap: true,
67
- banner: `/* @easy-editor/materials-dashboard-ranking-list v${pkg.version} (meta, esm) */`,
68
- exports: 'named',
69
- },
70
- ],
71
- plugins,
72
- external,
73
- },
74
- // 元数据 UMD 构建(备用方案)
75
- {
76
- input: 'src/meta.ts',
77
- output: [
78
- {
79
- file: 'dist/meta.js',
80
- format: 'umd',
81
- name: `${GLOBAL_NAME}Meta`,
82
- globals,
83
- sourcemap: true,
84
- banner: `/* @easy-editor/materials-dashboard-ranking-list v${pkg.version} (meta) */`,
85
- exports: 'named',
86
- },
87
- ],
88
- plugins,
89
- external,
90
- },
91
- // 元数据压缩版本(UMD,备用方案)
92
- {
93
- input: 'src/meta.ts',
94
- output: [
95
- {
96
- file: 'dist/meta.min.js',
97
- format: 'umd',
98
- name: `${GLOBAL_NAME}Meta`,
99
- globals,
100
- sourcemap: true,
101
- banner: `/* @easy-editor/materials-dashboard-ranking-list v${pkg.version} (meta, minified) */`,
102
- exports: 'named',
103
- },
104
- ],
105
- plugins: [...plugins, terser()],
106
- external,
107
- },
108
-
109
- /* ---------------------------------- 组件构建 ---------------------------------- */
110
- // 组件 ESM 构建(用于动态 import)
111
- {
112
- input: 'src/component.tsx',
113
- output: [
114
- {
115
- file: 'dist/component.esm.js',
116
- format: 'esm',
117
- sourcemap: true,
118
- banner: `/* @easy-editor/materials-dashboard-ranking-list v${pkg.version} (component, esm) */`,
119
- exports: 'named',
120
- },
121
- ],
122
- plugins,
123
- external,
124
- },
125
- // 组件 UMD 构建(备用方案)
126
- {
127
- input: 'src/component.tsx',
128
- output: [
129
- {
130
- file: 'dist/component.js',
131
- format: 'umd',
132
- name: `${GLOBAL_NAME}Component`,
133
- globals,
134
- sourcemap: true,
135
- banner: `/* @easy-editor/materials-dashboard-ranking-list v${pkg.version} (component) */`,
136
- exports: 'named',
137
- },
138
- ],
139
- plugins,
140
- external,
141
- },
142
- // 组件压缩版本(UMD,备用方案)
143
- {
144
- input: 'src/component.tsx',
145
- output: [
146
- {
147
- file: 'dist/component.min.js',
148
- format: 'umd',
149
- name: `${GLOBAL_NAME}Component`,
150
- globals,
151
- sourcemap: true,
152
- banner: `/* @easy-editor/materials-dashboard-ranking-list v${pkg.version} (component, minified) */`,
153
- exports: 'named',
154
- },
155
- ],
156
- plugins: [...plugins, terser()],
157
- external,
158
- },
159
-
160
- /* ---------------------------------- 完整构建 ---------------------------------- */
161
- // UMD 构建(用于 CDN 和浏览器)
162
- {
163
- input: 'src/index.tsx',
164
- output: [
165
- {
166
- file: 'dist/index.js',
167
- format: 'umd',
168
- name: GLOBAL_NAME,
169
- globals,
170
- sourcemap: true,
171
- banner: `/* @easy-editor/materials-dashboard-ranking-list v${pkg.version} */`,
172
- exports: 'named',
173
- },
174
- ],
175
- plugins,
176
- external,
177
- },
178
- // ESM 构建(用于现代打包工具)
179
- {
180
- input: 'src/index.tsx',
181
- output: [
182
- {
183
- file: 'dist/index.esm.js',
184
- format: 'esm',
185
- sourcemap: true,
186
- },
187
- ],
188
- plugins,
189
- external,
190
- },
191
- // CJS 构建(用于 Node.js)
192
- {
193
- input: 'src/index.tsx',
194
- output: [
195
- {
196
- file: 'dist/index.cjs',
197
- format: 'cjs',
198
- sourcemap: true,
199
- exports: 'named',
200
- },
201
- ],
202
- plugins,
203
- external,
204
- },
205
- // 压缩版本(用于生产环境)
206
- {
207
- input: 'src/index.tsx',
208
- output: [
209
- {
210
- file: 'dist/index.min.js',
211
- format: 'umd',
212
- name: GLOBAL_NAME,
213
- globals,
214
- sourcemap: true,
215
- banner: `/* @easy-editor/materials-dashboard-ranking-list v${pkg.version} (minified) */`,
216
- exports: 'named',
217
- },
218
- ],
219
- plugins: [...plugins, terser()],
220
- external,
221
- },
222
- ]
@@ -1,12 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.json",
3
- "compilerOptions": {
4
- "jsx": "react-jsx",
5
- "strictPropertyInitialization": false,
6
- "outDir": "./dist",
7
- "skipLibCheck": true,
8
- "esModuleInterop": true,
9
- "allowSyntheticDefaultImports": true
10
- },
11
- "include": ["./src"]
12
- }
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "./tsconfig.build.json",
3
- "compilerOptions": {
4
- "noEmit": true
5
- },
6
- "include": ["./src"]
7
- }
package/vite.config.ts DELETED
@@ -1,54 +0,0 @@
1
- /**
2
- * Vite Configuration for Material Development
3
- * 物料开发 Vite 配置
4
- */
5
-
6
- import { defineConfig } from 'vite'
7
- import react from '@vitejs/plugin-react'
8
- import { materialDevPlugin } from './.vite/plugins/vite-plugin-material-dev'
9
- import { externalDeps } from './.vite/plugins/vite-plugin-external-deps'
10
-
11
- export default defineConfig({
12
- plugins: [
13
- react(),
14
- // 外部化 React/ReactDOM,使用父应用提供的实例
15
- externalDeps({
16
- externals: ['react', 'react-dom', 'react/jsx-runtime', '@easy-editor/core'],
17
- globals: {
18
- react: 'React',
19
- 'react-dom': 'ReactDOM',
20
- 'react/jsx-runtime': 'jsxRuntime',
21
- '@easy-editor/core': 'EasyEditorCore',
22
- },
23
- }),
24
- materialDevPlugin({
25
- entry: '/src/index.tsx',
26
- }),
27
- ],
28
- server: {
29
- port: 5001,
30
- host: 'localhost',
31
- cors: true,
32
- hmr: {
33
- port: 5001,
34
- },
35
- },
36
- build: {
37
- target: 'esnext',
38
- rollupOptions: {
39
- // 确保生产构建也外部化这些依赖
40
- external: ['react', 'react-dom', 'react/jsx-runtime', '@easy-editor/core'],
41
- output: {
42
- globals: {
43
- react: 'React',
44
- 'react-dom': 'ReactDOM',
45
- 'react/jsx-runtime': 'jsxRuntime',
46
- '@easy-editor/core': 'EasyEditorCore',
47
- },
48
- },
49
- },
50
- },
51
- resolve: {
52
- dedupe: ['react', 'react-dom'],
53
- },
54
- })