Skip to content

Commit 5819b3f

Browse files
authored
Add engines property and remove the usage of npx (#30)
* No need to use npx as nim is in path * chore: add node v12 as minimum requirement * Remove yarn.lock
1 parent e5e0149 commit 5819b3f

File tree

4 files changed

+9
-9584
lines changed

4 files changed

+9
-9584
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
**/**/node_modules
2+
yarn.lock

index.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ process.env.NIM_DISABLE_AUTOUPDATE = '1';
1818
* @param {*} run - function provided under utils by Netlify to build event functions.
1919
*/
2020
async function deployProject(run) {
21-
await run.command(`npx nim project deploy . --exclude=web`);
21+
await run.command(`nim project deploy . --exclude=web`);
2222
}
2323

2424
/**
@@ -31,7 +31,7 @@ async function deployActions({run, functionsDir, timeout, memory}) {
3131
for (const file of files) {
3232
const [actionName, extension] = file.split('.');
3333
let command =
34-
`npx nim action update ${actionName} ${join(functionsDir, file)} ` +
34+
`nim action update ${actionName} ${join(functionsDir, file)} ` +
3535
`--timeout=${Number(timeout)} --memory=${Number(memory)} ` +
3636
`--web=raw `;
3737

@@ -71,10 +71,10 @@ module.exports = {
7171
// Login if not logged in before.
7272
if (loggedIn) {
7373
console.log('\nUsing the following namespace.');
74-
await utils.run.command('npx nim auth current');
74+
await utils.run.command('nim auth current');
7575
} else {
7676
await utils.run.command(
77-
`npx nim auth login ${process.env.NIMBELLA_LOGIN_TOKEN}`
77+
`nim auth login ${process.env.NIMBELLA_LOGIN_TOKEN}`
7878
);
7979

8080
// Cache the nimbella config to avoid logging in for consecutive builds.
@@ -108,9 +108,7 @@ module.exports = {
108108
// Execute after build is done.
109109
onPostBuild: async ({constants, utils, inputs}) => {
110110
try {
111-
const {stdout: namespace} = await utils.run.command(
112-
`npx nim auth current`
113-
);
111+
const {stdout: namespace} = await utils.run.command(`nim auth current`);
114112

115113
if (process.env.CONTEXT === 'production') {
116114
if (isProject) {

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
"space": true,
3737
"prettier": true
3838
},
39+
"engines": {
40+
"node": ">=12.0.0"
41+
},
3942
"devDependencies": {
4043
"xo": "^0.33.0"
4144
}

0 commit comments

Comments
 (0)