Skip to content

Commit 9db3b4e

Browse files
Use "node --run" instead of "npm run" This has the advantage that the package manager is no longer involved after the installation process.
1 parent 86934c8 commit 9db3b4e

File tree

11 files changed

+39
-35
lines changed

11 files changed

+39
-35
lines changed

.github/CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,31 @@ We hold our code to standard, and these standards are documented below.
88

99
We use [prettier](https://prettier.io/) for automatic formatting a lot all our files. The configuration is in our `prettier.config.mjs` file.
1010

11-
To run prettier, use `npm run lint:prettier`.
11+
To run prettier, use `node --run lint:prettier`.
1212

1313
### JavaScript: Run ESLint
1414

1515
We use [ESLint](https://eslint.org) to lint our JavaScript files. The configuration is in our `eslint.config.mjs` file.
1616

17-
To run ESLint, use `npm run lint:js`.
17+
To run ESLint, use `node --run lint:js`.
1818

1919
### CSS: Run StyleLint
2020

2121
We use [StyleLint](https://stylelint.io) to lint our CSS. The configuration is in our `.stylelintrc.json` file.
2222

23-
To run StyleLint, use `npm run lint:css`.
23+
To run StyleLint, use `node --run lint:css`.
2424

2525
### Markdown: Run markdownlint
2626

2727
We use [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2) to lint our markdown files. The configuration is in our `.markdownlint.json` file.
2828

29-
To run markdownlint, use `npm run markdownlint:css`.
29+
To run markdownlint, use `node --run markdownlint:css`.
3030

3131
## Testing
3232

3333
We use [Jest](https://jestjs.io) for JavaScript testing.
3434

35-
To run all tests, use `npm run test`.
35+
To run all tests, use `node --run test`.
3636

3737
The specific test commands are defined in `package.json`.
38-
So you can also run the specific tests with other commands, e.g. `npm run test:unit` or `npx jest tests/e2e/env_spec.js`.
38+
So you can also run the specific tests with other commands, e.g. `node --run test:unit` or `npx jest tests/e2e/env_spec.js`.

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ body:
4444
description: |
4545
Please keep in mind that some problems are specific to certain start options.
4646
options:
47-
- "npm run start"
48-
- "npm run start:wayland"
49-
- "npm run start:windows"
50-
- "npm run start:x11"
51-
- "npm run server"
47+
- "node --run start"
48+
- "node --run start:wayland"
49+
- "node --run start:windows"
50+
- "node --run start:x11"
51+
- "node --run server"
5252
- "node clientonly --address ... --port ..."
5353
validations:
5454
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Hello and thank you for wanting to contribute to the MagicMirror² project!
1010
> - What does the pull request accomplish? Use a list if needed.
1111
> - If it includes major visual changes please add screenshots.
1212
>
13-
> 3. Please run `npm run lint:prettier` before submitting so that
13+
> 3. Please run `node --run lint:prettier` before submitting so that
1414
> style issues are fixed.
1515
> 4. Don't forget to add an entry about your changes to
1616
> the CHANGELOG.md file.

.github/workflows/automated-tests.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ jobs:
2626
cache: "npm"
2727
- name: "Install dependencies"
2828
run: |
29-
npm run install-mm:dev
29+
node --run install-mm:dev
3030
- name: "Run linter tests"
3131
run: |
32-
npm run test:prettier
33-
npm run test:js
34-
npm run test:css
35-
npm run test:markdown
32+
node --run test:prettier
33+
node --run test:js
34+
node --run test:css
35+
node --run test:markdown
3636
test:
3737
runs-on: ubuntu-24.04
3838
timeout-minutes: 30
@@ -54,7 +54,7 @@ jobs:
5454
cache: "npm"
5555
- name: "Install MagicMirror²"
5656
run: |
57-
npm run install-mm:dev
57+
node --run install-mm:dev
5858
- name: "Run tests"
5959
run: |
6060
# Fix chrome-sandbox permissions:
@@ -64,4 +64,4 @@ jobs:
6464
WLR_BACKENDS=headless WLR_LIBINPUT_NO_DEVICES=1 WLR_RENDERER=pixman labwc &
6565
export WAYLAND_DISPLAY=wayland-0
6666
touch css/custom.css
67-
npm run test
67+
node --run test

.github/workflows/electron-rebuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
node-version: ${{ matrix.node-version }}
1919
check-latest: true
2020
- name: Install MagicMirror
21-
run: npm run install-mm
21+
run: node --run install-mm
2222
- name: Install @electron/rebuild
2323
run: npm install @electron/rebuild
2424
- name: Install node-libgpiod deps

.github/workflows/spellcheck.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ jobs:
2626
cache: "npm"
2727
- name: Install dependencies
2828
run: |
29-
npm run install-mm:dev
29+
node --run install-mm:dev
3030
- name: Run Spellcheck
31-
run: npm run test:spelling
31+
run: node --run test:spelling

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,7 @@ Temporary Items
8484

8585
# Ignore positions file (#3518)
8686
js/positions.js
87+
88+
# Ignore lock files other than package-lock.json
89+
pnpm-lock.yaml
90+
yarn.lock

js/defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const defaults = {
6262
position: "middle_center",
6363
classes: "xsmall",
6464
config: {
65-
text: "If you get this message while your config file is already created,<br>" + "it probably contains an error. To validate your config file run in your MagicMirror² directory<br>" + "<pre>npm run config:check</pre>"
65+
text: "If you get this message while your config file is already created,<br>" + "it probably contains an error. To validate your config file run in your MagicMirror² directory<br>" + "<pre>node --run config:check</pre>"
6666
}
6767
},
6868
{

js/electron.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function createWindow () {
112112
const port = process.env.MM_PORT || config.port;
113113
mainWindow.loadURL(`${prefix}${address}:${port}`);
114114

115-
// Open the DevTools if run with "npm start dev"
115+
// Open the DevTools if run with "node --run start:dev"
116116
if (process.argv.includes("dev")) {
117117
if (process.env.JEST_WORKER_ID !== undefined) {
118118
// if we are running with jest

modules/default/updatenotification/update_helper.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ class Updater {
133133
});
134134
}
135135

136-
// restart rules (pm2 or npm start)
136+
// restart rules (pm2 or node --run start)
137137
restart () {
138138
if (this.usePM2) this.pm2Restart();
139-
else this.npmRestart();
139+
else this.nodeRestart();
140140
}
141141

142142
// restart MagicMiror with "pm2": use PM2Id for restart it
@@ -150,12 +150,12 @@ class Updater {
150150
});
151151
}
152152

153-
// restart MagicMiror with "npm start"
154-
npmRestart () {
153+
// restart MagicMiror with "node --run start"
154+
nodeRestart () {
155155
Log.info("updatenotification: Restarting MagicMirror...");
156156
const out = process.stdout;
157157
const err = process.stderr;
158-
const subprocess = Spawn("npm start", { cwd: this.root_path, shell: true, detached: true, stdio: ["ignore", out, err] });
158+
const subprocess = Spawn("node --run start", { cwd: this.root_path, shell: true, detached: true, stdio: ["ignore", out, err] });
159159
subprocess.unref(); // detach the newly launched process from the master process
160160
process.exit();
161161
}

0 commit comments

Comments
 (0)