ftdsy-attr 1.0.0 → 1.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/package.json CHANGED
@@ -1,11 +1,18 @@
1
1
  {
2
2
  "name": "ftdsy-attr",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "main": "dist/ftdsy-attr",
5
+ "exports": {
6
+ ".": "./dist/ftdsy-attr.js"
7
+ },
8
+ "files": [
9
+ "dist"
10
+ ],
5
11
  "type": "module",
6
12
  "scripts": {
7
13
  "dev": "NODE_ENV=development rollup -c -w",
8
- "build": "NODE_ENV=production rollup -c"
14
+ "build": "NODE_ENV=production rollup -c",
15
+ "serve": "live-server test --port=3000 --host=localhost"
9
16
  },
10
17
  "keywords": [],
11
18
  "author": "",
@@ -14,13 +21,19 @@
14
21
  "@babel/core": "^7.26.9",
15
22
  "@babel/preset-env": "^7.26.9",
16
23
  "@rollup/plugin-babel": "^6.0.4",
24
+ "@rollup/plugin-json": "^6.1.0",
17
25
  "@rollup/plugin-node-resolve": "^16.0.0",
18
26
  "@rollup/plugin-terser": "^0.4.4",
27
+ "@rollup/plugin-url": "^8.0.2",
28
+ "live-server": "^1.2.2",
19
29
  "rollup": "^4.34.9",
20
- "rollup-plugin-serve": "^3.0.0"
30
+ "rollup-plugin-copy": "^3.5.0",
31
+ "rollup-plugin-serve": "^3.0.0",
32
+ "rollup-plugin-string": "^3.0.0"
21
33
  },
22
34
  "dependencies": {
23
35
  "@rollup/plugin-commonjs": "^28.0.3",
36
+ "@tensorflow/tfjs": "^4.15.0",
24
37
  "rollup-plugin-livereload": "^2.0.5"
25
38
  },
26
39
  "description": ""
package/.babelrc DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "presets": ["@babel/preset-env"]
3
- }
package/.idea/52Attr.iml DELETED
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/temp" />
6
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
- <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
- </content>
9
- <orderEntry type="inheritedJdk" />
10
- <orderEntry type="sourceFolder" forTests="false" />
11
- </component>
12
- </module>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectDictionaryState">
4
- <dictionary name="52ios" />
5
- </component>
6
- </project>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/52Attr.iml" filepath="$PROJECT_DIR$/.idea/52Attr.iml" />
6
- </modules>
7
- </component>
8
- </project>
package/rollup.config.js DELETED
@@ -1,52 +0,0 @@
1
-
2
- import { nodeResolve } from '@rollup/plugin-node-resolve'; // 解析第三方模块
3
- import babel from '@rollup/plugin-babel'; // 使用 Babel 转译代码
4
- import commonjs from '@rollup/plugin-commonjs'; // 将 CommonJS 模块转换为 ES Modules
5
- import terser from "@rollup/plugin-terser"; // 代码压缩
6
- import serve from 'rollup-plugin-serve'; // 开发服务器
7
- import livereload from 'rollup-plugin-livereload'; // 实时刷新
8
-
9
- // 公共配置
10
- const commonConfig = {
11
- input: 'src/main.js',
12
- output: {
13
- file: 'dist/ftdsy-attr.js',
14
- format: 'es',
15
- name: 'FtDsyAttr',
16
- sourcemap: true,
17
- },
18
- plugins: [
19
- nodeResolve(),
20
- commonjs(),
21
- babel({
22
- babelHelpers: 'bundled',
23
- exclude: 'node_modules/**',
24
- }),
25
- ],
26
- };
27
-
28
- // 开发环境配置
29
- const devConfig = {
30
- ...commonConfig,
31
- plugins: [
32
- ...commonConfig.plugins,
33
- serve({
34
- open: true,
35
- contentBase: 'dist',
36
- port: 3000,
37
- }),
38
- livereload('dist'),
39
- ],
40
- };
41
-
42
- // 生产环境配置
43
- const prodConfig = {
44
- ...commonConfig,
45
- plugins: [
46
- ...commonConfig.plugins,
47
- terser(), // 生产环境压缩代码
48
- ],
49
- };
50
-
51
- // 根据环境变量选择配置
52
- export default process.env.NODE_ENV === 'production' ? prodConfig : devConfig;
@@ -1,101 +0,0 @@
1
-
2
- const platformList = [
3
- {
4
- id: 1,
5
- title: '拼多多',
6
- code: 'pdd',
7
- shopType: 1,
8
- },
9
- {
10
- id: 2,
11
- title: '淘宝',
12
- code: 'tb',
13
- shopType: 1
14
- },
15
- {
16
- id: 2,
17
- title: '天猫',
18
- code: 'tm',
19
- shopType: 2
20
- },
21
- {
22
- id: 3,
23
- title: '京东',
24
- code: 'jd',
25
- shopType: 1
26
- },
27
- {
28
- id: 4,
29
- title: '抖音',
30
- code: 'dy',
31
- shopType: 1
32
- },
33
- {
34
- id: 5,
35
- title: '虾皮',
36
- code: 'xp',
37
- shopType: 1
38
- },
39
- {
40
- id: 6,
41
- title: '小红书',
42
- code: 'xhs',
43
- shopType: 1
44
- },
45
- {
46
- id: 7,
47
- title: '快手',
48
- code: 'ks',
49
- shopType: 1
50
- },
51
- {
52
- id: 8,
53
- title: '52电商园',
54
- code: 'dsy',
55
- shopType: 1
56
- },
57
- {
58
- id: 9,
59
- title: '1688',
60
- code: '1688',
61
- shopType: 1
62
- },
63
- {
64
- id: 10,
65
- title: '虾皮本土',
66
- code: 'xpbt',
67
- shopType: 1
68
- },
69
- {
70
- id: 11,
71
- title: '淘工厂',
72
- code: 'tgc',
73
- shopType: 1
74
- },
75
- {
76
- id: 12,
77
- title: '微信小店',
78
- code: 'sph',
79
- shopType: 1
80
- },
81
- {
82
- id: 13,
83
- title: 'TikTok',
84
- code: 'tk',
85
- shopType: 1
86
- }
87
- ];
88
-
89
- export function checkPlatform(pt_type) {
90
-
91
- let platform
92
- if (pt_type instanceof Number) {
93
- // 通过平台id查询
94
- platform = platformList.find(item => item.id == pt_type)
95
- } else {
96
- // 通过平台code查询
97
- platform = platformList.find(item => item.code === pt_type)
98
- }
99
- return platform
100
- }
101
-