浏览代码

Update: 第一个组件发布

洪海涛 3 年之前
父节点
当前提交
bfe56c0c39

+ 0 - 18
.bitmap

@@ -15,12 +15,6 @@
         "mainFile": "index.js",
         "rootDir": "src/components/baseHeader"
     },
-    "platformui/breadcrumbs": {
-        "scope": "remote-scope",
-        "version": "0.0.1",
-        "mainFile": "index.js",
-        "rootDir": "src/components/breadcrumbs"
-    },
     "platformui/codemirror": {
         "scope": "",
         "version": "",
@@ -141,17 +135,5 @@
         "mainFile": "index.js",
         "rootDir": "src/components/tagModular"
     },
-    "platformui/utils": {
-        "scope": "",
-        "version": "",
-        "mainFile": "index.js",
-        "rootDir": "src/utils"
-    },
-    "zhihui/action-dynamic": {
-        "scope": "",
-        "version": "",
-        "mainFile": "index.js",
-        "rootDir": "src/components/actionDynamic"
-    },
     "$schema-version": "14.9.0"
 }

+ 19 - 4
package.json

@@ -17,8 +17,7 @@
     "dev": "webpack-dev-server"
   },
   "dependencies": {
-    "@ant-design/icons": "^4.6.4",
-    "antd": "^4.16.13",
+    "antd": "^3.25.2",
     "clsx": "^1.1.1"
   },
   "devDependencies": {
@@ -30,7 +29,7 @@
     "@babel/preset-react": "^7.10.4",
     "@babel/runtime": "^7.15.3",
     "@tinymce/tinymce-react": "^3.12.6",
-    "antd": "^4.16.13",
+    "antd": "^3.25.2",
     "axios": "^0.21.1",
     "babel-loader": "^8.0.5",
     "babel-plugin-import": "^1.13.3",
@@ -62,11 +61,27 @@
     "webpack-parallel-uglify-plugin": "^1.1.2"
   },
   "peerDependencies": {
-    "antd": "^4.16.13",
+    "antd": "^3.25.2",
     "react": ">=16.6.0",
     "react-dom": ">=16.6.0"
   },
   "browser": {
     "child_process": false
+  },
+  "babel": {
+    "presets": [
+      "@babel/preset-env",
+      "@babel/preset-react"
+    ],
+    "plugins": [
+      "transform-class-properties",
+      "@babel/plugin-transform-runtime",
+      [
+        "@babel/plugin-proposal-decorators",
+        {
+          "legacy": true
+        }
+      ]
+    ]
   }
 }

文件差异内容过多而无法显示
+ 349 - 399
pnpm-lock.yaml


+ 1 - 0
src/components/actionDynamic/actionDynamic.composition.jsx

@@ -1,5 +1,6 @@
 import React from 'react';
 import ActionDynamic from './index';
+import 'antd/dist/antd.css'
 
 export const BasicActionDynamic = () => (
   <ActionDynamic commentsList={[

+ 1 - 0
src/components/actionDynamic/actionDynamic.docs.mdx

@@ -4,6 +4,7 @@ labels: ['label1', 'label2', 'label3']
 ---
 
 import ActionDynamic from './index';
+import 'antd/dist/antd.css'
 
 ## React Component for rendering text
 

+ 0 - 2
src/components/actionDynamic/actionDynamic.spec.jsx

@@ -1,9 +1,7 @@
-
 import React from 'react';
 import { render } from '@testing-library/react';
 import { BasicActionDynamic } from './actionDynamic.composition';
 
-
 it('should render with the correct text', () => {
   const actionDynamic = render(<BasicActionDynamic />);
   // const rendered = getByText('hello from Button');

+ 1 - 0
src/components/actionDynamic/index.js

@@ -2,6 +2,7 @@ import React, { useState } from 'react'
 import clsx from 'clsx'
 import { Tabs, Input, Button } from 'antd'
 import styles from './style.module.less'
+
 const { TabPane } = Tabs
 const { TextArea } = Input;
 export default function ActionDynamic(props) {

+ 22 - 97
workspace.jsonc

@@ -1,7 +1,7 @@
 /**
  * this is the main configuration file of your bit workspace.
  * for full documentation, please see: https://harmony-docs.bit.dev/workspace/configurations
- **/{
+ **/ {
   "$schema": "https://static.bit.dev/teambit/schemas/schema.json",
 
   /**
@@ -11,7 +11,7 @@
     /**
      * the name of the component workspace. used for development purposes.
      **/
-    "name": "my-workspace-name",
+    "name": "platformui",
     /**
      * set the icon to be shown on the Bit server.
      **/
@@ -30,6 +30,7 @@
      **/
     "defaultScope": "didi"
   },
+
   /**
    * main configuration for component dependency resolution.
    **/
@@ -38,40 +39,24 @@
      * choose the package manager for Bit to use. you can choose between 'yarn', 'pnpm'
      */
     "packageManager": "teambit.dependencies/pnpm",
-    "resolveModules": {
-      "aliases": {
-        "@": "src"
-      }
-    },
     "policy": {
-      // "devDependencies": {
-      //   "babel-plugin-import": "^1.13.3"
-      // },
-      "dependencies": {},
-      "peerDependencies": {
-        "@testing-library/react": "11.2.6",
-        "react": "16.13.1",
+      "dependencies": {
+        "@testing-library/react": "12.0.0",
         "antd": "^3.25.2",
-        "react-dom": "16.13.1"
+        "clsx": "1.1.1",
+        "lodash": "4.17.21",
+        "moment": "2.29.1"
+      },
+      "peerDependencies": {
+        "react": ">=16.6.0",
+        "react-dom": ">=16.6.0"
       }
     },
-
-    // "babel": {
-    //   "presets": [
-    //     "@babel/preset-env",
-    //     "@babel/preset-react"
-    //   ],
-    //   "plugins": [
-    //     "transform-class-properties",
-    //     "@babel/plugin-transform-runtime",
-    //     [
-    //       "@babel/plugin-proposal-decorators",
-    //       {
-    //         "legacy": true
-    //       }
-    //     ]
-    //   ]
-    // }
+    "packageManagerArgs": [],
+    "devFilePatterns": ["**/*.spec.ts"],
+    "strictPeerDependencies": true,
+    "installFromBitDevRegistry": true,
+    "savePrefix": ""
   },
 
   /**
@@ -85,79 +70,19 @@
     /**
      * "*" is a special rule which applied on all components in the workspace.
      **/
-     "{platformui/**}": {
+    // "*": {}
+    "{platformui/**}": {
       "teambit.react/react": {},
       "teambit.pkg/pkg": {
-        "packageManagerPublishArgs": [
-          "--access public"
-        ],
+        "packageManagerPublishArgs": ["--access public"],
         "packageJson": {
           "name": "@{scope}/{name}",
           "private": false,
           "publishConfig": {
             "registry": "http://registry.npm.xiaojukeji.com"
-          },
-          "babel": {
-            "presets": [
-              "@babel/preset-env",
-              "@babel/preset-react"
-            ],
-            "plugins": [
-              "transform-class-properties",
-              "@babel/plugin-transform-runtime",
-              [
-                "@babel/plugin-proposal-decorators",
-                {
-                  "legacy": true
-                }
-              ]
-            ]
           }
         }
-      },
-      "teambit.dependencies/dependency-resolver": {
-        "policy": {
-          // "peerDependencies": {
-          //   "enzyme": {
-          //     "version": "^3.11.0",
-          //     "resolveFromEnv": true
-          //   }
-          // },
-          "babel": {
-            "presets": [
-              "@babel/preset-env",
-              "@babel/preset-react"
-            ],
-            "plugins": [
-              "transform-class-properties",
-              "@babel/plugin-transform-runtime",
-              [
-                "@babel/plugin-proposal-decorators",
-                {
-                  "legacy": true
-                }
-              ]
-            ]
-          }
-        },
-        "babel": {
-          "presets": [
-            "@babel/preset-env",
-            "@babel/preset-react"
-          ],
-          "plugins": [
-            "transform-class-properties",
-            "@babel/plugin-transform-runtime",
-            [
-              "@babel/plugin-proposal-decorators",
-              {
-                "legacy": true
-              }
-            ]
-          ]
-        }
-      },
-
+      }
     }
   }
-}
+}

部分文件因为文件数量过多而无法显示