Skip to content

Commit

Permalink
- ci - Update github-ci for actions/cache, actions/setup-python from …
Browse files Browse the repository at this point in the history
…nodejs v16 to nodejs v20.

- ci - Update shell-function shRollupFetch() to fix blank date-committed.
  • Loading branch information
kaizhu256 committed Mar 11, 2024
1 parent 4242069 commit 478890a
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ import moduleFs from "fs";
"type": "git",
"url": "https://github.com/jslint-org/jslint.git"
},
"version": "2023.11.1"
"version": "2024.2.1"
}, undefined, 4)
}
].map(async function ({
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ jobs:
architecture: ${{ matrix.architecture }}
node-version: ${{ matrix.node_version }}
# https://github.com/actions/setup-python
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
# https://github.com/actions/cache
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
key: >
${{ hashFiles('./package.json') }}
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
- jslint - add new warning requiring paren around plus-separated concatenations.
- jslint - try to improve parser to be able to parse jquery.js without stopping.

# v2023.11.1-beta
# v2024.2.1-beta
- ci - Update github-ci for actions/cache, actions/setup-python from nodejs v16 to nodejs v20.
- ci - Update shell-function shRollupFetch() to fix blank date-committed.
- ci - bugfix - Fix google-chrome unable to create screenshot because user-data-dir is /dev/null.

# v2023.10.24
Expand Down
2 changes: 1 addition & 1 deletion jslint.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ let jslint_charset_ascii = (
+ "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"
+ "`abcdefghijklmnopqrstuvwxyz{|}~\u007f"
);
let jslint_edition = "v2023.11.1-beta";
let jslint_edition = "v2024.2.1-beta";
let jslint_export; // The jslint object to be exported.
let jslint_fudge = 1; // Fudge starting line and starting
// ... column to 1.
Expand Down
45 changes: 26 additions & 19 deletions jslint_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,12 @@ shBashrcWindowsInit() {
;;
esac
# alias curl.exe
# if (! alias curl &>/dev/null) && [ -f c:/windows/system32/curl.exe ]
# if (! alias curl 2>/dev/null) && [ -f c:/windows/system32/curl.exe ]
# then
# alias curl=c:/windows/system32/curl.exe
# fi
# alias node.exe
if (! alias node &>/dev/null)
if (! alias node 2>/dev/null)
then
alias node=node.exe
fi
Expand All @@ -212,7 +212,7 @@ import moduleUrl from "url";
let consoleError = console.error;
globalThis.debugInline = globalThis.debugInline || function (...argList) {
// this function will both print <argList> to stderr and return <argList>[0]
// This function will print <argv> to stderr and then return <argv>[0].
consoleError("\n\ndebugInline");
consoleError(...argList);
Expand Down Expand Up @@ -873,7 +873,7 @@ COMMIT_LIMIT=$COMMIT_LIMIT MODE_SQUASH=$MODE_SQUASH\n"
fi
# squash commits
COMMIT_MESSAGE="[squashed $COMMIT_COUNT commits] $COMMIT_MESSAGE"
git branch -D __tmp1 &>/dev/null || true
git branch -D __tmp1 2>/dev/null || true
git checkout --orphan __tmp1
git commit --quiet -am "$COMMIT_MESSAGE" || true
# reset branch to squashed-commit
Expand Down Expand Up @@ -1013,7 +1013,7 @@ shGithubCheckoutRemote() {(set -e
# branch - */*/*
git fetch origin alpha
# assert latest ci
if (git rev-parse "$GITHUB_REF_NAME" &>/dev/null) \
if (git rev-parse "$GITHUB_REF_NAME" 2>/dev/null) \
&& [ "$(git rev-parse "$GITHUB_REF_NAME")" \
!= "$(git rev-parse origin/alpha)" ]
then
Expand Down Expand Up @@ -1113,8 +1113,8 @@ import modulePath from "path";
}
console.error(
mode === "download"
? `shGithubFileDownload - ${process.argv[1]}`
: `shGithubFileUpload - ${process.argv[1]}`
? `shGithubFileDownload - ${process.argv[2]}`
: `shGithubFileUpload - ${process.argv[2]}`
);
path = path.split("/");
repo = path.slice(0, 2).join("/");
Expand Down Expand Up @@ -1284,7 +1284,7 @@ import moduleUrl from "url";
let consoleError = console.error;
globalThis.debugInline = globalThis.debugInline || function (...argList) {
// this function will both print <argList> to stderr and return <argList>[0]
// This function will print <argv> to stderr and then return <argv>[0].
consoleError("\n\ndebugInline");
consoleError(...argList);
Expand Down Expand Up @@ -1759,7 +1759,7 @@ import modulePath from "path";
let consoleError = console.error;
globalThis.debugInline = globalThis.debugInline || function (...argList) {
// this function will both print <argList> to stderr and return <argList>[0]
// This function will print <argv> to stderr and then return <argv>[0].
consoleError("\n\ndebugInline");
consoleError(...argList);
Expand Down Expand Up @@ -1844,6 +1844,7 @@ function replaceListReplace(replaceList, data) {
let fetchCount = 0;
let fetchList;
let matchObj;
let promiseList = [];
let repoDict;
function pipeToBuffer(res, dict, key) {
Expand Down Expand Up @@ -1876,13 +1877,16 @@ function replaceListReplace(replaceList, data) {
elem.prefix = elem.url.split("/").slice(0, 7).join("/");
// fetch dateCommitted
if (!repoDict.hasOwnProperty(elem.prefix)) {
repoDict[elem.prefix] = true;
moduleHttps.request(elem.prefix.replace(
"/blob/",
"/commits/"
), function (res) {
pipeToBuffer(res, elem, "dateCommitted");
}).end();
promiseList.push(new Promise(function (resolve) {
repoDict[elem.prefix] = true;
moduleHttps.request(elem.prefix.replace(
"/blob/",
"/commits/"
), function (res) {
pipeToBuffer(res, elem, "dateCommitted");
res.on("end", resolve);
}).end();
}));
}
// fetch file
if (elem.node) {
Expand Down Expand Up @@ -1921,6 +1925,7 @@ function replaceListReplace(replaceList, data) {
pipeToBuffer(res, elem, "data");
});
});
await Promise.all(promiseList);
// parse fetched data
process.on("exit", function () {
let header;
Expand Down Expand Up @@ -1972,9 +1977,11 @@ function replaceListReplace(replaceList, data) {
result += (
"\n\n\n/*\n"
+ "repo " + prefix.replace("/blob/", "/tree/") + "\n"
+ "committed " + (
/\b\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ\b|$/
).exec(dateCommitted.toString())[0] + "\n"
+ "committed " + new Date(
(
/"(\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d[^"]*?)"/
).exec(dateCommitted.toString())[1]
).toISOString().replace((/\.\d*?Z/), "Z") + "\n"
+ "*/"
);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
"shCiArtifactUpload": 1,
"shCiPublishNpm": 1,
"type": "module",
"version": "2023.11.1-beta"
"version": "2024.2.1-beta"
}

0 comments on commit 478890a

Please sign in to comment.