forked from nut-tree/nut.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Monorepo build * Added global gitignore * Excluded .idea folder * Added step to set up pnpm * Added packageManager info to root level package.json * Replaced npx with pnpx * Fixed trailing comma * NPM_TOKEN * NPM_TOKEN * NPM_TOKEN * Added missing root level coverage:clean target * Streamlined naming of samples * Run coverage instead of test * Updated lock file * Updated sonar settings * Updated sonar settings * Aligned package versions, added script to bump versions on snapshot releases
- Loading branch information
Showing
240 changed files
with
11,710 additions
and
43,963 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 |
---|---|---|
|
@@ -13,48 +13,50 @@ jobs: | |
sonar: | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, 'skip ci')" | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
steps: | ||
- name: Set up Git repository | ||
uses: actions/checkout@v3 | ||
- name: Set up node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: https://registry.npmjs.org/ | ||
token: ${{ secrets.NPM_TOKEN }} | ||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
- name: Install | ||
run: npm ci | ||
run: | | ||
pnpm whoami | ||
pnpm i | ||
- name: Compile | ||
run: npm run compile | ||
- name: Init window e2e test subpackage | ||
run: npm --prefix e2e/window-test ci | ||
run: pnpm -r run compile | ||
- name: Clean coverage report | ||
run: npm run coverage:clean | ||
run: pnpm run coverage:clean | ||
- name: Generate coverage report | ||
uses: GabrielBB/xvfb-action@v1 | ||
env: | ||
NODE_OPTIONS: "--max-old-space-size=8192" | ||
with: | ||
run: npm run coverage -- --coverageDirectory=coverage/unit | ||
- name: Run Electron e2e test subpackage | ||
uses: GabrielBB/xvfb-action@v1 | ||
with: | ||
run: npm --prefix e2e/electron-test cit | ||
- name: Merge coverage reports | ||
run: | | ||
npm run coverage:merge | ||
npm run coverage:merge-report | ||
run: pnpm run coverage | ||
- name: Send results to SonarCloud | ||
uses: SonarSource/[email protected] | ||
uses: SonarSource/[email protected] | ||
with: | ||
projectBaseDir: core/nut.js | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
|
||
test: | ||
needs: | ||
- sonar | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
strategy: | ||
matrix: | ||
os: [windows-latest, macos-latest] | ||
node: [18] | ||
os: [ windows-latest, macos-latest ] | ||
node: [ 18 ] | ||
runs-on: ${{matrix.os}} | ||
steps: | ||
- name: Set up Git repository | ||
|
@@ -63,19 +65,16 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{matrix.node}} | ||
registry-url: https://registry.npmjs.org/ | ||
token: ${{ secrets.NPM_TOKEN }} | ||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
- name: Install | ||
run: npm ci | ||
run: pnpm i | ||
- name: Compile | ||
run: npm run compile | ||
- name: Init window e2e test subpackage | ||
run: npm --prefix e2e/window-test ci | ||
run: pnpm run compile | ||
- name: Generate coverage report | ||
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 | ||
pnpm run coverage |
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 |
---|---|---|
|
@@ -24,24 +24,21 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{matrix.node}} | ||
registry-url: https://registry.npmjs.org/ | ||
token: ${{ secrets.NPM_TOKEN }} | ||
- 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: | ||
|
@@ -54,15 +51,19 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: "https://registry.npmjs.org" | ||
registry-url: https://registry.npmjs.org/ | ||
token: ${{ secrets.NPM_TOKEN }} | ||
- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,10 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{matrix.node}} | ||
registry-url: https://registry.npmjs.org/ | ||
token: ${{ secrets.NPM_TOKEN }} | ||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
- name: Install | ||
run: npm ci | ||
- name: Compile | ||
|
@@ -46,7 +50,10 @@ jobs: | |
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: "https://registry.npmjs.org" | ||
registry-url: https://registry.npmjs.org/ | ||
token: ${{ secrets.NPM_TOKEN }} | ||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
- name: Install | ||
run: npm ci | ||
- name: Run typedoc | ||
|
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
{ | ||
"name": "@nut-tree/configs", | ||
"private": true, | ||
"version": "4.0.0", | ||
"description": "Shared configs for nut.js", | ||
"author": { | ||
"name": "dry Software UG (haftungsbeschränkt)", | ||
"email": "[email protected]", | ||
"url": "https://dry.software" | ||
} | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.