Skip to content

Commit 4e9d433

Browse files
committed
feat: updated the script system to zx
The script system has been updated to use Google's zx instead of the deprecated nps. This system provides more flexibility and reliablity , as well as full ES compatibility support. To address this change, other updates had to be made. Additionally, all versions of libraries had been updated. BREAKING CHANGE: The scripts system now is based on zx, previous scripts will not work and have to be migrated.
1 parent 6fc20bb commit 4e9d433

File tree

184 files changed

+4618
-4997
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+4618
-4997
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ A clear and concise description of what you expected to happen.
2020

2121
## Versions
2222

23-
- Library Version:
24-
- Node/NPM Version (if any):
25-
- Operating System Version:
26-
- Browser Version:
23+
- Library Version:
24+
- Node/NPM Version (if any):
25+
- Operating System Version:
26+
- Browser Version:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ merged into the project.
1111

1212
Before opening a pull request, please ensure:
1313

14-
- [ ] You have followed our [**guidelines**](https://gobstones.github.io/gobstones-guidelines/)
15-
- [ ] Double-check your branch is based on `main` and targets `main`
16-
- [ ] Pull request has tests (we are going for 100% coverage!)
17-
- [ ] Code is well-commented, linted and follows project conventions
18-
- [ ] Documentation is updated (if necessary)
19-
- [ ] Internal code generators and templates are updated (if necessary)
20-
- [ ] Description explains the issue/use-case resolved and auto-closes related
21-
issues
14+
- [ ] You have followed our [**guidelines**](https://gobstones.github.io/gobstones-guidelines/)
15+
- [ ] Double-check your branch is based on `main` and targets `main`
16+
- [ ] Pull request has tests (we are going for 100% coverage!)
17+
- [ ] Code is well-commented, linted and follows project conventions
18+
- [ ] Documentation is updated (if necessary)
19+
- [ ] Internal code generators and templates are updated (if necessary)
20+
- [ ] Description explains the issue/use-case resolved and auto-closes related
21+
issues
2222

2323
Be kind to code reviewers, please try to keep pull requests as small and focused
2424
as possible.

.github/workflows/on-commit-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ jobs:
1616
- name: Setup node version
1717
uses: actions/setup-node@v4
1818
with:
19-
node-version: '20'
19+
node-version: '22'
2020
- name: Installing project dependencies
2121
run: npm install

.github/workflows/on-commit-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup node version
1717
uses: actions/setup-node@v4
1818
with:
19-
node-version: '20'
19+
node-version: '22'
2020
- name: Installing project dependencies
2121
run: npm install
2222
- name: Linting the code

.github/workflows/on-tag-publish-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup node version
2828
uses: actions/setup-node@v4
2929
with:
30-
node-version: '20'
30+
node-version: '22'
3131
- name: Installing project dependencies
3232
run: npm install
3333
- name: Building the docs

.github/workflows/on-tag-release-github.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup node version
1515
uses: actions/setup-node@v4
1616
with:
17-
node-version: '20'
17+
node-version: '22'
1818
env:
1919
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2020
- name: Installing project dependencies

.github/workflows/on-tag-release-npm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup node version
1515
uses: actions/setup-node@v4
1616
with:
17-
node-version: '20'
17+
node-version: '22'
1818
env:
1919
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2020
- name: Installing project dependencies

.gitignore

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,44 @@
11
# OS generated files #
22
.DS_Store
3+
*.pem
34
Thumbs.db
45
.tmp/
56

67
# IDE generated file #
7-
.idea/
8+
/.idea
89

910
# PackageManager specific lock files
1011
pnpm-lock.yaml
1112
package-lock.json
1213
yarn.lock
1314

1415
# Node generated files
15-
node_modules/
16-
npm-debug.log
17-
yarn-error.log
16+
/node_modules
17+
npm-debug.log*
18+
yarn-debug.log*
19+
yarn-error.log*
20+
/.pnp
21+
.pnp.js
22+
.yarn/install-state.gz
1823

1924
# Build process generated files
2025
.rollup.cache
26+
*.tsbuildinfo
2127
tsconfig.build.json
2228

2329
# Test coverage generated folder
24-
coverage/
30+
/coverage
2531

2632
# Dist generated folder
27-
dist/
33+
/dist
34+
/build
35+
.next
2836

2937
# Docs generated folder
3038
docs/
3139

3240
# Verdaccio storage
33-
test/verdaccio/storage
41+
/verdaccio/storage
3442

35-
# Files that may be generated through teting or usage
36-
project-types/common/tsconfig.json
43+
# Temporary test folder
44+
/test/.temp

.husky/commit-msg

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1 @@
1-
# Read parameters
2-
COMMIT_MSG_FILE=$1
3-
4-
# Set failing on command fail, and undefined variable use
5-
set -eu
6-
7-
# This hook is invoked by git-commit and git-merge, and can be
8-
# bypassed with the --no-verify option. It takes a single
9-
# parameter, the name of the file that holds the proposed commit
10-
# log message.
11-
12-
# Exiting with a non-zero status causes the command to abort.
13-
14-
# The hook is allowed to edit the message file in place, and can
15-
# be used to normalize the message into some project standard format.
16-
# It can also be used to refuse the commit after inspecting the
17-
# message file.
18-
19-
# The default commit-msg hook, when enabled, detects duplicate
20-
# Signed-off-by trailers, and aborts the commit if one is found.
21-
22-
# We use this hook to run "commitlint", that verifies that the
23-
# message sent has the correct format for the project, aborting otherwise.
24-
25-
# Show welcome message
26-
echo "**************************"
27-
echo "Linting the commit message"
28-
echo "**************************"
29-
echo ""
30-
31-
# Run commitlint
32-
npx --no -- commitlint --edit ${1}
1+
NODE_NO_WARNINGS=1 NODE_OPTIONS=--experimental-strip-types zx "./.husky/commit-msg.ts" $@

.husky/commit-msg.ts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/env zx
2+
/*
3+
* *****************************************************************************
4+
* Copyright (C) National University of Quilmes 2018-2024
5+
* Gobstones (TM) is a trademark of the National University of Quilmes.
6+
*
7+
* This program is free software distributed under the terms of the
8+
* GNU Affero General Public License version 3.
9+
* Additional terms added in compliance to section 7 of such license apply.
10+
*
11+
* You may read the full license at https://gobstones.github.io/gobstones-guidelines/LICENSE.
12+
* *****************************************************************************
13+
*/
14+
15+
/**
16+
* This hook is invoked by git-commit and git-merge, and can be
17+
* bypassed with the --no-verify option. It takes a single
18+
* parameter, the name of the file that holds the proposed commit
19+
* log message.
20+
*
21+
* Exiting with a non-zero status causes the command to abort.
22+
*
23+
* The hook is allowed to edit the message file in place, and can
24+
* be used to normalize the message into some project standard format.
25+
* It can also be used to refuse the commit after inspecting the
26+
* message file.
27+
*
28+
* The default commit-msg hook, when enabled, detects duplicate
29+
* Signed-off-by trailers, and aborts the commit if one is found.
30+
*
31+
* We use this hook to run "commitlint", that verifies that the
32+
* message sent has the correct format for the project, aborting otherwise.
33+
*
34+
*
35+
* @author Alan Rodas Bonjour <alanrodas@gmail.com>
36+
*/
37+
import process from 'process';
38+
import { argv, echo, path } from 'zx';
39+
import { fileURLToPath } from 'url';
40+
import { $ } from '../.scripts/_helpers.ts';
41+
42+
const HOOKS_DIRECTORY = __dirname || path.dirname(fileURLToPath(import.meta.url));
43+
const SCRIPTS_DIRECTORY = path.join(path.dirname(HOOKS_DIRECTORY), '.scripts');
44+
45+
const COMMIT_MSG_FILE = argv._.length > 0 ? argv._[0] : undefined;
46+
47+
echo`
48+
**************************
49+
Linting the commit message
50+
**************************
51+
`;
52+
53+
// Run commitlint
54+
await $`npx --no -- commitlint --edit "${COMMIT_MSG_FILE}"`;
55+
56+
process.exit(0);

0 commit comments

Comments
 (0)