Skip to content

Commit

Permalink
Merge branch 'master' into latest
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed Dec 15, 2023
2 parents cc22a81 + 6fa8fbb commit 4c5ad1a
Show file tree
Hide file tree
Showing 126 changed files with 4,896 additions and 4,310 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
- name: Install dependencies
run: yarn

- name: Build
run: yarn build
# - name: Build
# run: yarn build

# 自动发布完成后 触发 github.release.published 事件
# 如果是 action 自带的 机器人 token, 出于安全考虑, github 会禁止循环触发, 使用真实用户的 token 可解决这个问题
Expand Down
16 changes: 13 additions & 3 deletions .releaserc.base.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const path = require('path');

module.exports = {
extends: 'semantic-release-monorepo',
branches: [
'latest',
{ name: 'beta', channel: 'beta', prerelease: true },
{ name: 'alpha', channel: 'alpha', prerelease: true },
{ name: 'next', channel: 'next', prerelease: true },
],
extends: 'semantic-release-monorepo',
plugins: [
[
'@semantic-release/commit-analyzer',
Expand All @@ -26,11 +28,19 @@ module.exports = {
'@semantic-release/npm',
[
'@semantic-release/git',
{
{
message: 'chore(release): 🤖 ${nextRelease.gitTag} [skip ci]',
},
},
],
'@semantic-release/github',
[
'@semantic-release/exec',
{
prepareCmd:
`node ${path.resolve(__dirname, './scripts/add-version.js')} ` +
'${nextRelease.gitTag}',
},
],
],
preset: 'angular',
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"@rollup/plugin-typescript": "^8.2.5",
"@rushstack/eslint-patch": "^1.1.3",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@size-limit/esbuild": "^11.0.0",
"@size-limit/esbuild-why": "^11.0.0",
Expand Down
2,485 changes: 1,162 additions & 1,323 deletions packages/s2-core/CHANGELOG.md

Large diffs are not rendered by default.

50 changes: 15 additions & 35 deletions packages/s2-core/__tests__/bugs/issue-725-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,11 @@ import { assembleDataCfg } from '../util';
import type { S2DataConfig } from '@/common/interface';
import { PivotSheet } from '@/sheet-type';
import { PivotDataSet } from '@/data-set';
import { EXTRA_FIELD } from '@/common/constant';
import { getDimensionsWithoutPathPre } from '@/utils/dataset/pivot-data-set';

jest.mock('@/sheet-type');

const MockPivotSheet = PivotSheet as unknown as jest.Mock<PivotSheet>;
let dataSet: PivotDataSet;

describe('Multi Measure Correct Render Tests1', () => {
const dataCfg: S2DataConfig = assembleDataCfg({
...mockDataConfig,
});

beforeEach(() => {
MockPivotSheet.mockClear();
const mockSheet = new MockPivotSheet();
dataSet = new PivotDataSet(mockSheet);
dataSet.setDataCfg(dataCfg);
});

test('should get correct values', () => {
expect(
getDimensionsWithoutPathPre(dataSet.getDimensionValues(EXTRA_FIELD)),
).toEqual(['price', 'cost']);
});
});

describe('Group Sort When Have Same Child Measure', () => {
const dataCfg: S2DataConfig = assembleDataCfg({
...mockDataConfig,
Expand All @@ -51,22 +29,24 @@ describe('Group Sort When Have Same Child Measure', () => {
});

beforeEach(() => {
MockPivotSheet.mockClear();
const mockSheet = new MockPivotSheet();
dataSet = new PivotDataSet(mockSheet);
dataSet.setDataCfg(dataCfg);
});

test('should get correct group sort', () => {
expect(
getDimensionsWithoutPathPre(dataSet.getDimensionValues('type')),
).toEqual(['办公用品', '家具产品', '家具产品', '办公用品']);
expect(
getDimensionsWithoutPathPre(
dataSet.getDimensionValues('type', { city: '白山' }),
),
).toEqual(['办公用品', '家具产品']);
expect(
getDimensionsWithoutPathPre(
dataSet.getDimensionValues('type', { city: '抚顺' }),
),
).toEqual(['家具产品', '办公用品']);
expect(dataSet.getDimensionValues('type')).toEqual([
'办公用品',
'家具产品',
]);
expect(dataSet.getDimensionValues('type', { city: '白山' })).toEqual([
'办公用品',
'家具产品',
]);
expect(dataSet.getDimensionValues('type', { city: '抚顺' })).toEqual([
'家具产品',
'办公用品',
]);
});
});
44 changes: 2 additions & 42 deletions packages/s2-core/__tests__/data/data-custom-trees.ts
Original file line number Diff line number Diff line change
@@ -1,62 +1,22 @@
export const dataCustomTrees = [
{
'measure-a': 1,
type: '家具',
sub_type: '桌子',
},
{
'measure-a': 1,
'measure-b': 2,
type: '家具',
sub_type: '桌子',
},
{
'measure-c': 3,
type: '家具',
sub_type: '桌子',
},
{
'measure-d': 4,
type: '家具',
sub_type: '桌子',
},
{
'measure-e': 5,
type: '家具',
sub_type: '桌子',
},
{
'measure-f': 6,
type: '家具',
sub_type: '桌子',
},
{
'measure-a': 11,
type: '家具',
sub_type: '椅子',
},
{
'measure-a': 11,
'measure-b': 22,
type: '家具',
sub_type: '椅子',
},
{
'measure-c': 33,
type: '家具',
sub_type: '椅子',
},
{
'measure-d': 44,
type: '家具',
sub_type: '椅子',
},
{
'measure-e': 55,
type: '家具',
sub_type: '椅子',
},
{
'measure-f': 66,
type: '家具',
sub_type: '椅子',
},
];
Loading

0 comments on commit 4c5ad1a

Please sign in to comment.