@oceanbase/codemod 1.0.0-alpha.1 → 1.0.0-alpha.2

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@oceanbase/codemod",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-alpha.2",
4
4
  "description": "Codemod for OceanBase Design upgrade",
5
5
  "keywords": [
6
6
  "oceanbase",
@@ -23,7 +23,7 @@
23
23
  "build": "father build"
24
24
  },
25
25
  "dependencies": {
26
- "@oceanbase/design": "^1.0.0-alpha.1",
26
+ "@oceanbase/design": "^1.0.0-alpha.2",
27
27
  "chalk": "^3.0.0",
28
28
  "command-exists": "^1.2.9",
29
29
  "execa": "^5.1.1",
@@ -47,5 +47,5 @@
47
47
  "enzyme": "^3.11.0",
48
48
  "enzyme-to-json": "^3.6.2"
49
49
  },
50
- "gitHead": "47b1ebfa75581585b83252085dddd33fc2c072a5"
50
+ "gitHead": "72910b1a2b037811f3ed5561ee5e897d7b744135"
51
51
  }
@@ -0,0 +1,10 @@
1
+ @import url('~@oceanbase/design/es/theme/index.less');
2
+
3
+ .container {
4
+ color: rgba(0, 0, 0, 0.85);
5
+ background: rgba(0, 0, 0,0.65);
6
+ background-color: rgba(0,0,0,0.45);
7
+ border-color: rgb(0 0 0 / 45%);
8
+ border: 1px solid #d9d9d9;
9
+ font-size: 14px;
10
+ }
@@ -0,0 +1,10 @@
1
+ @import url('~@oceanbase/design/es/theme/index.less');
2
+
3
+ .container {
4
+ color: @colorText;
5
+ background: @colorTextSecondary;
6
+ background-color: @colorTextTertiary;
7
+ border-color: @colorTextTertiary;
8
+ border: 1px solid @colorBorder;
9
+ font-size: @fontSize;
10
+ }
@@ -0,0 +1,10 @@
1
+ @import '~@oceanbase/design/es/theme/index.less';
2
+
3
+ .container {
4
+ color: rgba(0, 0, 0, 0.85);
5
+ background: rgba(0, 0, 0,0.65);
6
+ background-color: rgba(0,0,0,0.45);
7
+ border-color: rgb(0 0 0 / 45%);
8
+ border: 1px solid #d9d9d9;
9
+ font-size: 14px;
10
+ }
@@ -0,0 +1,10 @@
1
+ @import '~@oceanbase/design/es/theme/index.less';
2
+
3
+ .container {
4
+ color: @colorText;
5
+ background: @colorTextSecondary;
6
+ background-color: @colorTextTertiary;
7
+ border-color: @colorTextTertiary;
8
+ border: 1px solid @colorBorder;
9
+ font-size: @fontSize;
10
+ }
@@ -9,6 +9,8 @@ const tests = [
9
9
  'case-insensitive',
10
10
  'mixin',
11
11
  'obui-less-token-to-token',
12
+ 'exist-import',
13
+ 'exist-import-url',
12
14
  ];
13
15
 
14
16
  describe(testUnit, () => {
@@ -60,9 +60,15 @@ async function transform(file) {
60
60
  }
61
61
  }
62
62
  } else if (node.type === 'atrule' && node.name === 'import') {
63
- if (node.params === "'~@oceanbase/design/es/theme/index.less'") {
63
+ if (
64
+ node.params?.includes("'~@oceanbase/design/es/theme/index.less'") ||
65
+ node.params?.includes('"~@oceanbase/design/es/theme/index.less"')
66
+ ) {
64
67
  tokenLessImported = true;
65
- } else if (node.params === "'~@alipay/ob-ui/es/theme/index.less'") {
68
+ } else if (
69
+ node.params?.includes("'~@alipay/ob-ui/es/theme/index.less'") ||
70
+ node.params?.includes('"~@alipay/ob-ui/es/theme/index.less"')
71
+ ) {
66
72
  node.remove();
67
73
  }
68
74
  }
@@ -47,6 +47,7 @@ const TOKEN_MAP = {
47
47
  '#ff4d4f': 'colorError',
48
48
  '#f5222d': 'colorError',
49
49
  '#f8636b': 'colorError',
50
+ '#f93939': 'colorError',
50
51
  '#d9d9d9': 'colorBorder',
51
52
  '#bfbfbf': 'colorBorder',
52
53
  '#e8e8e8': 'colorBorder',
@@ -122,12 +123,12 @@ const TOKEN_MAP = {
122
123
  '#cdd5e4': 'colorBorder',
123
124
  '#f5f8fe': 'colorBgLayout',
124
125
  '#f5f7fa': 'colorBgLayout',
126
+ '#f8fafe': 'colorBgLayout',
125
127
  'rgba(140,140,140,0.1)': 'colorBgLayout',
126
128
  'rgb(240,242,245)': 'colorBgLayout',
127
129
  '#132039': 'colorText',
128
130
  '#364563': 'colorTextSecondary',
129
131
  '#8592ad': 'colorTextTertiary',
130
- '#f8fafe': 'colorFillQuaternary',
131
132
  };
132
133
 
133
134
  const TOKEN_MAP_KEYS = Object.keys(TOKEN_MAP).map(key => formatValue(key));