diff --git a/docs/dev/Creating UI5 Web Components Packages.md b/docs/dev/Creating UI5 Web Components Packages.md index 52792f3dd73e..97095672bc78 100644 --- a/docs/dev/Creating UI5 Web Components Packages.md +++ b/docs/dev/Creating UI5 Web Components Packages.md @@ -108,8 +108,10 @@ Task | Purpose clean | Deletes the `dist/` directory with the build output build | Production build to the `dist/` directory lint | Run a static code scan with `eslint` -start | Build the project for development and run the dev server -test | Run the test specs from the `test/specs/` directory +start | Build the project for development, run the dev server and watch for changes +watch | Watch for changes only +serve | Run the dev server only +test | Run the dev server and execute the specs from the `test/specs/` directory create-ui5-element | Create an empty web component with the given name ### Files in the main directory diff --git a/packages/fiori/package.json b/packages/fiori/package.json index 7644f98ecf42..f324f2cc79a2 100644 --- a/packages/fiori/package.json +++ b/packages/fiori/package.json @@ -14,6 +14,8 @@ "clean": "wc-dev clean", "lint": "wc-dev lint", "start": "wc-dev start", + "watch": "wc-dev watch", + "serve": "wc-dev serve", "build": "wc-dev build", "test": "wc-dev test", "create-ui5-element": "wc-create-ui5-element", diff --git a/packages/main/package.json b/packages/main/package.json index 1503cf201131..38847ae29e62 100644 --- a/packages/main/package.json +++ b/packages/main/package.json @@ -14,6 +14,8 @@ "clean": "wc-dev clean", "lint": "wc-dev lint", "start": "wc-dev start", + "watch": "wc-dev watch", + "serve": "wc-dev serve", "build": "wc-dev build", "test": "wc-dev test", "create-ui5-element": "wc-create-ui5-element", diff --git a/packages/tools/bin/dev.js b/packages/tools/bin/dev.js index 3916727cfee0..7bf2f2618fe0 100755 --- a/packages/tools/bin/dev.js +++ b/packages/tools/bin/dev.js @@ -3,12 +3,17 @@ const child_process = require("child_process"); let command = process.argv[2]; +const argument = process.argv[3]; -// Support for running the test task with a spec parameter -if (command === "test") { - const spec = process.argv[3]; - if (spec) { - command = `test.spec --spec ${spec}`; +if (command === "watch") { + if (["src", "test", "bundles", "styles", "templates", "samples"].includes(argument)) { + command = `watch.${argument}`; + } +} else if (command === "test") { + if (argument === "--no-server") { // yarn test --no-server + command = `test.run`; + } else if (argument) { // yarn test test/specs/Button.spec.js + command = `test.spec --spec ${argument}`; } } diff --git a/packages/tools/lib/init-package/index.js b/packages/tools/lib/init-package/index.js index 149ba156c543..4d294cc9718b 100644 --- a/packages/tools/lib/init-package/index.js +++ b/packages/tools/lib/init-package/index.js @@ -94,6 +94,8 @@ const updatePackageFile = () => { "clean": "wc-dev clean", "lint": "wc-dev lint", "start": "wc-dev start", + "watch": "wc-dev watch", + "serve": "wc-dev serve", "build": "wc-dev build", "test": "wc-dev test", "create-ui5-element": "wc-create-ui5-element",