Skip to content

Commit

Permalink
fix: fix window system clean script execution problems
Browse files Browse the repository at this point in the history
  • Loading branch information
vince292007 committed Sep 26, 2024
1 parent a46c85d commit fd1c4d4
Show file tree
Hide file tree
Showing 12 changed files with 329 additions and 403 deletions.
2 changes: 1 addition & 1 deletion docs/src/en/guide/essentials/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The execution command is: `pnpm run [script]` or `npm run [script]`.
// Check types
"check:type": "turbo run typecheck",
// Clean the project (delete node_modules, dist, .turbo, etc.)
"clean": "vsh clean",
"clean": "node ./scripts/clean.mjs",
// Commit code
"commit": "czg",
// Start the project (by default, the dev scripts of all packages in the entire repository will run)
Expand Down
17 changes: 0 additions & 17 deletions docs/src/en/guide/project/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,6 @@ Check the dependency situation of the entire project and output `unused dependen
pnpm vsh check-dep
```

### vsh clean

Delete the project's `node_modules`, `dist`, `.turbo` directories, etc., to clean the project.

#### Usage

```bash
pnpm vsh clean
```

#### Options

| Option | Description |
| --- | --- |
| `-r,--recursive` | Recursively delete the entire project, default `true` |
| `--del-lock` | Whether to delete the `pnpm-lock.yaml` file, default `true` |

### vsh lint

Lint checks the project to see if the code in the project conforms to standards.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/guide/essentials/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ npm 脚本是项目常见的配置,用于执行一些常见的任务,比如
// 检查类型
"check:type": "turbo run typecheck",
// 清理项目(删除node_modules、dist、.turbo)等目录
"clean": "vsh clean",
"clean": "node ./scripts/clean.mjs",
// 提交代码
"commit": "czg",
// 启动项目(默认会运行整个仓库所有包的dev脚本)
Expand Down
10 changes: 0 additions & 10 deletions docs/src/guide/project/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@ pnpm vsh check-circular
pnpm vsh check-dep
```

### vsh clean

删除项目的`node_modules``dist``.turbo`等目录,清理项目。

#### 用法

```bash
pnpm vsh clean
```

#### 选项

| 选项 | 说明 |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"check:cspell": "cspell lint **/*.ts **/README.md .changeset/*.md --no-progress",
"check:dep": "vsh check-dep",
"check:type": "turbo run typecheck",
"clean": "vsh clean",
"clean": "node ./scripts/clean.mjs",
"commit": "czg",
"dev": "turbo-run dev",
"dev:antd": "pnpm -F @vben/web-antd run dev",
Expand Down
48 changes: 24 additions & 24 deletions packages/@core/preferences/__tests__/preferences.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,30 @@ describe('preferences', () => {
expect(preferences).toEqual(defaultPreferences);
});

// it('initializes preferences with overrides', async () => {
// const overrides: any = {
// app: {
// locale: 'en-US',
// },
// };
// await preferenceManager.initPreferences({
// namespace: 'testNamespace',
// overrides,
// });

// // 等待防抖动操作完成
// // await new Promise((resolve) => setTimeout(resolve, 300)); // 等待100毫秒

// const expected = {
// ...defaultPreferences,
// app: {
// ...defaultPreferences.app,
// ...overrides.app,
// },
// };

// expect(preferenceManager.getPreferences()).toEqual(expected);
// });
it('initializes preferences with overrides', async () => {
const overrides: any = {
app: {
locale: 'en-US',
},
};
await preferenceManager.initPreferences({
namespace: 'testNamespace',
overrides,
});

// 等待防抖动操作完成
// await new Promise((resolve) => setTimeout(resolve, 300)); // 等待100毫秒

const expected = {
...defaultPreferences,
app: {
...defaultPreferences.app,
...overrides.app,
},
};

expect(preferenceManager.getPreferences()).toEqual(expected);
});

it('updates theme mode correctly', () => {
preferenceManager.updatePreferences({
Expand Down
2 changes: 1 addition & 1 deletion packages/@core/preferences/src/preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class PreferenceManager {
const mergedPreference = merge(
{},
// overrides,
this.loadCachedPreferences() || defaultPreferences,
this.loadCachedPreferences() || {},
this.initialPreferences,
);

Expand Down
Loading

0 comments on commit fd1c4d4

Please sign in to comment.