@zxiaosi/sdk 0.0.1

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.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ ## 介绍
2
+
3
+ - `@zxiaosi/sdk` npm包仓库
@@ -0,0 +1,2 @@
1
+ const e=`hello world`;console.log(e);var t=e;module.exports=t;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["const hello = 'hello world';\r\n\r\nconsole.log(hello);\r\n\r\nexport default hello;\r\n"],"mappings":"AAAA,MAAM,EAAQ,cAEd,QAAQ,IAAI,EAAM,CAElB,IAAA,EAAe"}
@@ -0,0 +1,5 @@
1
+ //#region src/index.d.ts
2
+ declare const hello = "hello world";
3
+ //#endregion
4
+ export { hello as default };
5
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1,5 @@
1
+ //#region src/index.d.ts
2
+ declare const hello = "hello world";
3
+ //#endregion
4
+ export { hello as default };
5
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1,2 @@
1
+ const e=`hello world`;console.log(e);var t=e;export{t as default};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["const hello = 'hello world';\r\n\r\nconsole.log(hello);\r\n\r\nexport default hello;\r\n"],"mappings":"AAAA,MAAM,EAAQ,cAEd,QAAQ,IAAI,EAAM,CAElB,IAAA,EAAe"}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@zxiaosi/sdk",
3
+ "version": "0.0.1",
4
+ "description": "A micro frontend kit",
5
+ "license": "MIT",
6
+ "author": "zxiaosi",
7
+ "type": "module",
8
+ "main": "dist/cjs/index.cjs",
9
+ "module": "dist/esm/index.mjs",
10
+ "types": "dist/esm/index.d.mts",
11
+ "files": [
12
+ "dist",
13
+ "rolldown.config.ts",
14
+ "tsconfig.json"
15
+ ],
16
+ "scripts": {
17
+ "build": "npx rimraf dist && rolldown -c rolldown.config.ts",
18
+ "publish": "npm run build && npm publish"
19
+ },
20
+ "dependencies": {
21
+ "@ant-design/pro-layout": "^7.22.7",
22
+ "axios": "^1.12.2",
23
+ "qiankun": "^2.10.16",
24
+ "react-intl-universal": "^2.12.0"
25
+ },
26
+ "devDependencies": {
27
+ "@babel/preset-env": "^7.28.3",
28
+ "@babel/preset-react": "^7.27.1",
29
+ "@rollup/plugin-babel": "^6.0.4",
30
+ "@types/react": "^18.3.12",
31
+ "@types/react-dom": "^18.3.0",
32
+ "es-toolkit": "^1.39.10",
33
+ "rolldown": "^1.0.0-beta.40",
34
+ "rolldown-plugin-dts": "^0.16.8",
35
+ "rollup-plugin-node-externals": "^8.1.1"
36
+ },
37
+ "peerDependencies": {
38
+ "@ant-design/icons": "^5.6.1",
39
+ "antd": "^5.27.4",
40
+ "echarts": "^6.0.0",
41
+ "echarts-for-react": "^3.0.4",
42
+ "react": "^18.3.1",
43
+ "react-dom": "^18.3.1",
44
+ "react-router-dom": "^6.30.1",
45
+ "zustand": "^5.0.8"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public"
49
+ }
50
+ }
@@ -0,0 +1,78 @@
1
+ import babel, { RollupBabelInputPluginOptions } from '@rollup/plugin-babel';
2
+ import { defineConfig } from 'rolldown';
3
+ import { dts } from 'rolldown-plugin-dts';
4
+ import nodeExternals from 'rollup-plugin-node-externals';
5
+
6
+ /** babel 配置 */
7
+ const babelOptions: RollupBabelInputPluginOptions = {
8
+ presets: [
9
+ [
10
+ '@babel/preset-env',
11
+ {
12
+ modules: false, // 不转换模块语法, 让 Rollup 处理模块语法
13
+ targets: {
14
+ node: 'current', // 当前 Node.js 版本
15
+ },
16
+ },
17
+ ],
18
+ '@babel/preset-react',
19
+ ], // 使用 React 和 ES6+ 预设
20
+ exclude: 'node_modules/**', // 排除 node_modules 中的文件
21
+ babelHelpers: 'bundled', // 使用打包的 Babel 辅助函数, 避免重复打包
22
+ };
23
+
24
+ /** 通用配置 */
25
+ const common = defineConfig({
26
+ input: './src/index.ts',
27
+ platform: 'browser', // 作用于浏览器环境
28
+ tsconfig: './tsconfig.json', // 指定 tsconfig 文件
29
+ output: {
30
+ sourcemap: true, // 生成 sourcemap 文件
31
+ minify: true, // 启用代码压缩, 调试时可以关闭
32
+ },
33
+ });
34
+
35
+ const config = defineConfig([
36
+ {
37
+ ...common,
38
+ plugins: [
39
+ nodeExternals(), // 排除 deps、peerDeps 中的依赖
40
+ babel(babelOptions),
41
+ dts(),
42
+ ],
43
+ output: {
44
+ dir: 'dist/esm',
45
+ format: 'es',
46
+ entryFileNames: '[name].mjs',
47
+ chunkFileNames: '[name]-[hash].mjs',
48
+ ...common.output,
49
+ },
50
+ },
51
+ {
52
+ ...common,
53
+ plugins: [
54
+ nodeExternals(), // 排除 deps、peerDeps 中的依赖
55
+ babel(babelOptions),
56
+ ],
57
+ output: {
58
+ dir: 'dist/cjs',
59
+ format: 'cjs',
60
+ entryFileNames: '[name].cjs',
61
+ chunkFileNames: '[name]-[hash].cjs',
62
+ ...common.output,
63
+ },
64
+ },
65
+ {
66
+ ...common,
67
+ plugins: [dts({ emitDtsOnly: true })],
68
+ output: {
69
+ dir: 'dist/cjs',
70
+ format: 'esm',
71
+ entryFileNames: '[name].cjs',
72
+ chunkFileNames: '[name]-[hash].cjs',
73
+ ...common.output,
74
+ },
75
+ },
76
+ ]);
77
+
78
+ export default config;
package/tsconfig.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "resolveJsonModule": true,
4
+ "esModuleInterop": true,
5
+ "moduleResolution": "node",
6
+ "jsx": "react-jsx",
7
+ "module": "commonjs",
8
+ "target": "es5",
9
+ "allowJs": false,
10
+ "noUnusedLocals": false,
11
+ "preserveConstEnums": true,
12
+ "skipLibCheck": true,
13
+ "sourceMap": true,
14
+ "inlineSources": true,
15
+ "declaration": true,
16
+ "experimentalDecorators": true,
17
+ "downlevelIteration": true,
18
+ "lib": ["DOM", "ESNext"],
19
+ "baseUrl": ".",
20
+ "paths": {
21
+ "@/*": ["src/*"]
22
+ }
23
+ },
24
+ "include": ["src"],
25
+ "exclude": ["rolldown.config.ts", "tsconfig.json"]
26
+ }