Skip to content

Commit 3438fa5

Browse files
committed
chore: remove watch.js and updated CONTRIBUTING.md
1 parent 00567dc commit 3438fa5

File tree

5 files changed

+8
-91
lines changed

5 files changed

+8
-91
lines changed

CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ We use [Github issues](https://github.com/ikun-svelte/ikun-ui/issues) for bug re
2525
## Sending a pull request
2626

2727
1. Fork [the repository](https://github.com/ikun-svelte/ikun-ui),and create your branch from `main`. For new feature, please submit your changes directly to the `feature` branch. Other changes should go against `main` branch.
28-
2. Use `pnpm install` install the dependencies
29-
3. Run `pnpm run build` to build all components, presets, utils
30-
4. Please run `pnpm run play` to debug the component, and `pnpm run dev:docs` to debug the documentation site
31-
5. Modify according to your needs, whether it is to modify presets or components, you need to manually run `pnpm run build` in the corresponding directory after modification. Additionally, you can use `pnpm run watch` for automatic building of your changes.
28+
2. Use `pnpm install` install the dependencies.
29+
3. Run `pnpm run dev` to pre build all components, presets, utils.
30+
4. Please run `pnpm run play` to debug the component, and `pnpm run dev:docs` to debug the documentation site.
31+
5. Modify according to your needs.
3232
6. Make changes to the codebase. Please add tests if applicable.
3333
7. Make sure the test suite passes with `pnpm run test`.
3434
8. Commit your changes, adhering to the [Commit Guidelines](#commit-guidelines).

CONTRIBUTING.zh-CN.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424

2525
1. Fork [此仓库](https://github.com/ikun-svelte/ikun-ui),从 `main` 创建分支。新功能实现请发 pull request 到 `feature` 分支。其他更改发到 `main` 分支。
2626
2. 使用 `pnpm install` 安装依赖。
27-
3. 运行 `pnpm run build` 对所有组件、预设、utils进行构建
28-
4. 调试组件请运行 `pnpm run play` ,调试文档站点请运行 `pnpm run dev:docs`
29-
5. 根据你的需求进行修改,无论是修改预设还是组件,修改后都需要手动的到对应目录下运行 `pnpm run build`。你也可以运行`pnpm run watch`自动构建你的更改
27+
3. 运行 `pnpm run dev` 对所有组件、预设、utils进行构建
28+
4. 调试组件请运行 `pnpm run play` ,调试文档站点请运行 `pnpm run dev:docs`
29+
5. 根据你的需求进行修改。
3030
6. 对代码库进行更改。如果适用的话,请确保写了相应的测试。
3131
7. 确认执行 `pnpm run test` 后所有的测试都是通过的。
3232
8. 提交 git commit, 请同时遵守 [Commit 规范](#commit-指南)

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"build-lib": "tsup --config tsup.config.ts",
5353
"build:utils": "pnpm run --filter @ikun-ui/utils build",
5454
"build:components": "esno scripts/build.js",
55-
"watch": "esno scripts/watch.js",
5655
"build#docs": "pnpm run --filter @ikun-ui/docs docs:build",
5756
"preview:docs": "pnpm run --filter @ikun-ui/docs docs:preview",
5857
"test": "pnpm run test:unit && pnpm run test:e2e",

scripts/utils.js

+1-35
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,6 @@ export async function runCommand(command, dir, userOptions) {
3636
});
3737
}
3838

39-
/**
40-
* Avoid excessive execution of 'watch.js'.
41-
*/
42-
class TaskRunnerState {
43-
/**@type {boolean}`*/
44-
_value;
45-
/**@type {TaskRunnerState | null} */
46-
static instance = null;
47-
constructor() {
48-
if (TaskRunnerState.instance) {
49-
return TaskRunnerState.instance;
50-
}
51-
this._value = false;
52-
TaskRunnerState.instance = this;
53-
}
54-
get value() {
55-
return this._value;
56-
}
57-
/**
58-
* @param {boolean} val
59-
* @returns {void}
60-
*/
61-
set value(val) {
62-
this._value = val;
63-
}
64-
}
65-
6639
function runTaskPool(list, limit, asyncHandle) {
6740
let recursion = (arr) => {
6841
return asyncHandle(arr.shift()).then(() => {
@@ -77,7 +50,7 @@ function runTaskPool(list, limit, asyncHandle) {
7750
}
7851
}
7952

80-
function runTaskCommand({ rootDir, pkgPath, buildCommand, userOptions, action, taskRunnerState }) {
53+
function runTaskCommand({ rootDir, pkgPath, buildCommand, userOptions, action }) {
8154
return new Promise((resolve, reject) => {
8255
const packageJsonPath = path.join(rootDir, pkgPath);
8356
try {
@@ -99,17 +72,11 @@ function runTaskCommand({ rootDir, pkgPath, buildCommand, userOptions, action, t
9972
log('error', `Error reading or parsing package.json at ${packageJsonPath}`);
10073
log('error', error);
10174
reject();
102-
} finally {
103-
taskRunnerState.value = false;
10475
}
10576
});
10677
}
10778

10879
export function runTask(buildCommand, root, action, userOptions) {
109-
const taskRunnerState = new TaskRunnerState();
110-
if (taskRunnerState.value) return;
111-
taskRunnerState.value = true;
112-
11380
// set log prefix
11481
setGlobalPrefix('[ikun-ui]: ');
11582
const rootDir = path.resolve(root);
@@ -128,7 +95,6 @@ export function runTask(buildCommand, root, action, userOptions) {
12895
buildCommand,
12996
userOptions,
13097
action,
131-
taskRunnerState,
13298
pkgPath: m
13399
};
134100
});

scripts/watch.js

-48
This file was deleted.

0 commit comments

Comments
 (0)