Skip to content

Commit

Permalink
publish latest
Browse files Browse the repository at this point in the history
  • Loading branch information
dmail committed Dec 30, 2024
1 parent d7c997b commit 300297c
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 13 deletions.
9 changes: 4 additions & 5 deletions dist/jsenv_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -11510,15 +11510,14 @@ const watchSourceFiles = (
callback,
{ sourceFileConfig = {}, keepProcessAlive, cooldownBetweenFileEvents },
) => {
let rootDirectoryUrl = sourceDirectoryUrl;
// Project should use a dedicated directory (usually "src/")
// passed to the dev server via "sourceDirectoryUrl" param
// In that case all files inside the source directory should be watched
// But some project might want to use their root directory as source directory
// In that case source directory might contain files matching "node_modules/*" or ".git/*"
// And jsenv should not consider these as source files and watch them (to not hurt performances)
const watchPatterns = {};
const addDirectoryToWatch = (watchPatterns, directoryUrlRelativeToRoot) => {
const addDirectoryToWatch = (directoryUrlRelativeToRoot) => {
Object.assign(watchPatterns, {
[`${directoryUrlRelativeToRoot}**/*`]: true, // by default watch everything inside the source directory
// line below is commented until @jsenv/url-meta fixes the fact that is matches
Expand Down Expand Up @@ -11575,20 +11574,20 @@ const watchSourceFiles = (
break npm_workspaces;
}
const { workspaces } = packageContent;
if (workspaces.length === 0) {
if (!workspaces || !Array.isArray(workspaces) || workspaces.length === 0) {
break npm_workspaces;
}
for (const workspace of workspaces) {
if (workspace.endsWith("*")) {
const workspaceRelativeUrl = urlToRelativeUrl(
new URL(workspace.slice(0, -1), packageDirectoryUrl),
rootDirectoryUrl,
packageDirectoryUrl,
);
addDirectoryToWatch(workspaceRelativeUrl);
} else {
const workspaceRelativeUrl = urlToRelativeUrl(
new URL(workspace, packageDirectoryUrl),
rootDirectoryUrl,
packageDirectoryUrl,
);
addDirectoryToWatch(workspaceRelativeUrl);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/related/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jsenv/cli",
"version": "0.2.30",
"version": "0.2.31",
"description": "Command Line Interface for jsenv",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/related/cli/template-node-package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"devDependencies": {
"@jsenv/assert": "4.4.2",
"@jsenv/core": "39.9.1",
"@jsenv/core": "39.9.2",
"@jsenv/eslint-config-relax": "1.3.9",
"@jsenv/test": "3.5.34",
"eslint": "9.17.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/related/cli/template-web-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@babel/plugin-syntax-import-attributes": "7.26.0",
"@jsenv/custom-elements-redefine": "0.0.1",
"@jsenv/assert": "4.4.2",
"@jsenv/core": "39.9.1",
"@jsenv/core": "39.9.2",
"@jsenv/plugin-bundling": "2.7.21",
"@jsenv/plugin-minification": "1.5.12",
"@jsenv/eslint-config-relax": "1.3.9",
Expand Down
2 changes: 1 addition & 1 deletion packages/related/cli/template-web-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@babel/plugin-syntax-import-attributes": "7.26.0",
"@babel/plugin-transform-react-jsx": "7.25.9",
"@jsenv/assert": "4.4.2",
"@jsenv/core": "39.9.1",
"@jsenv/core": "39.9.2",
"@jsenv/plugin-preact": "1.6.32",
"@jsenv/plugin-bundling": "2.7.21",
"@jsenv/plugin-minification": "1.5.12",
Expand Down
2 changes: 1 addition & 1 deletion packages/related/cli/template-web-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@babel/plugin-syntax-import-attributes": "7.26.0",
"@babel/plugin-transform-react-jsx": "7.25.9",
"@jsenv/assert": "4.4.2",
"@jsenv/core": "39.9.1",
"@jsenv/core": "39.9.2",
"@jsenv/plugin-react": "1.5.54",
"@jsenv/plugin-bundling": "2.7.21",
"@jsenv/plugin-minification": "1.5.12",
Expand Down
2 changes: 1 addition & 1 deletion packages/related/cli/template-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"devDependencies": {
"@babel/plugin-syntax-import-attributes": "7.26.0",
"@jsenv/assert": "4.4.2",
"@jsenv/core": "39.9.1",
"@jsenv/core": "39.9.2",
"@jsenv/eslint-config-relax": "1.3.9",
"@jsenv/plugin-bundling": "2.7.21",
"@jsenv/plugin-minification": "1.5.12",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [0_js_module](../../preact_and_redux_build.test.mjs#L56)
# [0_js_module](../../preact_and_redux_build.test.mjs#L60)

```js
run({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [1_js_module_fallback](../../preact_and_redux_build.test.mjs#L71)
# [1_js_module_fallback](../../preact_and_redux_build.test.mjs#L75)

```js
run({
Expand Down

0 comments on commit 300297c

Please sign in to comment.