Skip to content

Commit d34b02e

Browse files
authored
chore: update to compile code (#2)
* chore: update version number * 1.0.1 * chore: update release address * 1.0.2 * 1.0.3 * 1.0.4 * 1.0.5 * 1.0.6 * 1.0.7 * chore: update registry * 1.0.8 * 1.0.9 * 1.0.10 * chore: update pkg * chore: compile code * chore: export file of typescript * fix: revise the strategy of obtaining the dimension name which is null * refactor: refactor code * refactor: refactor code
1 parent bbbc758 commit d34b02e

File tree

7 files changed

+147
-29664
lines changed

7 files changed

+147
-29664
lines changed

.npmrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
registry=https://registry.npm.terminus.io/
1+
registry=https://registry.npmjs.org/
22
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
33
puppeteer_skip_chromium_download=true
4-
@terminus:registry = "https://registry.npm.terminus.io"
4+
@terminus:registry = "https://registry.npmjs.org/"

package-lock.json

+98-29,624
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "@terminus/dashboard-configurator",
3-
"version": "1.2.6",
2+
"name": "@erda-ui/dashboard-configurator",
3+
"version": "1.0.14",
44
"description": "Dice Charts with Echart",
5-
"main": "./src/index.ts",
6-
"types": "./src/types/index.d.ts",
5+
"main": "./dist/index.js",
6+
"types": "./dist/index.d.ts",
77
"repository": {
88
"type": "git",
9-
"url": "https://gittar.app.terminus.io/terminus-dice/dashboard-configurator"
9+
"url": "https://github.com/Erda-FE/dashboard-configuration.git"
1010
},
1111
"keywords": [
1212
"dice",
@@ -155,9 +155,9 @@
155155
}
156156
},
157157
"files": [
158-
"src",
158+
"dist",
159159
"README.md",
160160
"package.json",
161161
"CHANGELOG.md"
162162
]
163-
}
163+
}

src/components/DcChartEditor/data-config/dice-form/data-loader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export const createLoadDataFn = ({
205205
const time = map(uniqBy(dataSource, timeDimension.key), (item) => item[timeDimension.key]);
206206
const groups = chunk(dataSource, time.length);
207207
const metricData = map(groups, (group) => {
208-
const nameItem: any = find(group, (item: any) => !!item[valueDimension.key] || isNumber(item[valueDimension.key])) || {};
208+
const nameItem: any = find(group, (item: any) => (!!item[valueDimension.key] || isNumber(item[valueDimension.key])) && Object.values(item).every((value) => value !== null)) || {};
209209
return {
210210
data: map(group, (item: any) => item[valueDimension.key]),
211211
name: reduce(otherDimensions, (name, { key }, index) => `${name}${nameItem[key]}${index !== otherDimensions.length - 1 ? ' / ' : ''}`, ''),

src/styles/_mixin.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@use 'sass:math';
1+
// @use 'sass:math';
22
@import './variable';
33

44
// util

tools/release.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ const confirmChangelog = async (version) => {
8989
const goRelease = async (version) => {
9090
const npm = [
9191
`npm version ${version}`,
92-
'npm whoami --registry=https://registry.npm.terminus.io',
93-
'npm publish --registry=https://registry.npm.terminus.io',
92+
'npm whoami --registry=https://registry.npmjs.org',
93+
'npm publish --registry=https://registry.npmjs.org',
9494
];
9595
const git = [
9696
'git add --all',
@@ -102,7 +102,7 @@ const goRelease = async (version) => {
102102
const npmSpinner = ora(STYLE.message('开始发包...')).start();
103103
npm.forEach(command => TIP.message(execSync(command).toString()));
104104
npmSpinner.stop();
105-
TIP.success('已发布到 https://registry.npm.terminus.io');
105+
TIP.success('已发布到 https://registry.npmjs.org');
106106

107107
const changelogSpinner = ora(STYLE.message('开始生成 changelog...')).start();
108108
execSync(GEN_CHANGELOG);

webpack.config.js

+35-26
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
77
const TerserPlugin = require("terser-webpack-plugin");
88
const GitRevisionPlugin = require('git-revision-webpack-plugin');
99
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
10+
const CopyWebpackPlugin = require('copy-webpack-plugin');
1011
// const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
1112

1213
// const smp = new SpeedMeasurePlugin();
@@ -118,22 +119,22 @@ module.exports = () => {
118119
},
119120
{
120121
test: /\.svg$/,
121-
include: [
122-
resolve('node_modules/@terminus/nusi'),
123-
],
124-
type: 'asset',
125-
parser: {
126-
dataUrlCondition: {
127-
maxSize: 8 * 1024, // 8kb
128-
},
122+
include: [
123+
resolve('node_modules/@terminus/nusi'),
124+
],
125+
type: 'asset',
126+
parser: {
127+
dataUrlCondition: {
128+
maxSize: 8 * 1024, // 8kb
129129
},
130+
},
130131
},
131132
{
132133
test: /\.(png|jpe?g|gif)$/i,
133-
include: [
134-
resolve('node_modules/@terminus/nusi'),
135-
],
136-
type: 'asset/resource',
134+
include: [
135+
resolve('node_modules/@terminus/nusi'),
136+
],
137+
type: 'asset/resource',
137138
},
138139
],
139140
},
@@ -153,20 +154,20 @@ module.exports = () => {
153154
minimize: isProd,
154155
moduleIds: 'named',
155156
chunkIds: 'named',
156-
splitChunks: {
157-
chunks: 'all',
158-
minSize: 30000,
159-
minChunks: 1,
160-
maxAsyncRequests: 5,
161-
maxInitialRequests: 5,
162-
cacheGroups: {
163-
vendors: {
164-
test: /[\\/]node_modules[\\/]/,
165-
reuseExistingChunk: true,
166-
priority: -10,
167-
},
168-
},
169-
},
157+
// splitChunks: {
158+
// chunks: 'all',
159+
// minSize: 30000,
160+
// minChunks: 1,
161+
// maxAsyncRequests: 5,
162+
// maxInitialRequests: 5,
163+
// cacheGroups: {
164+
// vendors: {
165+
// test: /[\\/]node_modules[\\/]/,
166+
// reuseExistingChunk: true,
167+
// priority: -10,
168+
// },
169+
// },
170+
// },
170171
minimizer: isProd
171172
? [
172173
new webpack.BannerPlugin(banner),
@@ -203,6 +204,14 @@ module.exports = () => {
203204
filename: '[name].css',
204205
// chunkFilename: '[id].css',
205206
}),
207+
new CopyWebpackPlugin({
208+
patterns: [
209+
{
210+
from: './src/types/index.d.ts',
211+
to: './',
212+
},
213+
]
214+
})
206215
]
207216
: [
208217
new webpack.DllReferencePlugin({

0 commit comments

Comments
 (0)