-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Aligned package versions, added script to bump versions on snapshot r…
…eleases
- Loading branch information
Showing
17 changed files
with
84 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const { exec } = require("child_process"); | ||
const { readFile, writeFile } = require("fs"); | ||
const { join } = require("path"); | ||
|
||
const args = process.argv.slice(2); | ||
const version = args[0]; | ||
|
||
if (version == null || version === "") { | ||
throw new Error("Version is required"); | ||
} | ||
|
||
exec("pnpm m ls --json --depth=-1", (_, stdout) => { | ||
const modules = JSON.parse(stdout).filter( | ||
(module) => module.private !== true, | ||
); | ||
|
||
for (const module of modules) { | ||
const filePath = join(module.path, "package.json"); | ||
|
||
readFile(filePath, "utf8", (err, data) => { | ||
if (err) { | ||
throw new Error(err); | ||
} | ||
// Parse JSON | ||
const obj = JSON.parse(data); | ||
|
||
// Change a property | ||
obj.version = version; | ||
|
||
// Convert object back to JSON | ||
const json = JSON.stringify(obj, null, 2); | ||
|
||
// Write JSON file | ||
writeFile(filePath, json, "utf8", (err) => { | ||
if (err) { | ||
throw new Error(err); | ||
} else { | ||
console.log("File successfully updated."); | ||
} | ||
}); | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,23 +29,16 @@ jobs: | |
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
- name: Install | ||
run: npm ci | ||
run: pnpm i | ||
- name: Install @nut-tree/libnut@next | ||
run: npm i @nut-tree/libnut@next | ||
run: | | ||
pnpm --filter @nut-tree/libnut i @nut-tree/libnut-darwin@next @nut-tree/libnut-linux@next @nut-tree/libnut-win32@next | ||
- name: Compile | ||
run: npm run compile | ||
- name: Init window e2e test subpackage | ||
run: npm --prefix e2e/window-test ci | ||
run: pnpm run compile | ||
- name: Run tests | ||
uses: GabrielBB/xvfb-action@v1 | ||
with: | ||
run: | | ||
npx playwright install --with-deps | ||
npm test | ||
- name: Run Electron e2e test subpackage | ||
uses: GabrielBB/xvfb-action@v1 | ||
with: | ||
run: npm --prefix e2e/electron-test cit | ||
run: pnpm run coverage | ||
|
||
deploy: | ||
needs: | ||
|
@@ -63,13 +56,14 @@ jobs: | |
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
- name: Install | ||
run: npm ci | ||
run: pnpm i | ||
- name: Install @nut-tree/libnut@next | ||
run: npm i @nut-tree/libnut@next | ||
run: | | ||
pnpm --filter @nut-tree/libnut i @nut-tree/libnut-darwin@next @nut-tree/libnut-linux@next @nut-tree/libnut-win32@next | ||
- name: Create snapshot release | ||
run: bash ./.build/pre-release.sh | ||
- name: Publish snapshot release to npm | ||
run: npm run publish-next | ||
run: pnpm run publish:next | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- uses: actions/setup-node@v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# nut.js examples | ||
|
||
The projects contained in this folder are meant to be used as examples for how to use nut.js. | ||
Especially the image matching samples will probably not run out of the box on you machine, nonetheless they should give you a good starting point for your own projects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,9 @@ | |
"compile": "pnpm -r run compile", | ||
"coverage": "pnpm -r run coverage", | ||
"coverage:clean": "pnpm -r run coverage:clean", | ||
"prepare": "husky install" | ||
"prepare": "husky install", | ||
"publish:next": "pnpm -r run publish:next", | ||
"publish": "pnpm -r run publish" | ||
}, | ||
"packageManager": "[email protected]", | ||
"workspaces": [ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters