Skip to content

Commit

Permalink
@dr-js/core@0.5.13
Browse files Browse the repository at this point in the history
notable change:
- deprecate: `withDelayArgvQueue`
- add: common: `runAsyncByLane()`, `runAsPromise()`, `debounceL|T()` and `throttleL|T()`
- add: node: `findUpNpmrc()`, `parseDockerImage()`
- node: `npm@10` support for `fetchLikeRequestWithProxy()`
- node: allow `data` for `responderEndWithStatusCode()`
- ci: update & merge ci config
- ci: use newer `nodejs`
- ci: skip step for win32/darwin ci
- use `throttleT <- throttle`
- script sort
- package update
  • Loading branch information
dr-js committed Jan 3, 2024
2 parents 3ae953c + 1e11a94 commit 0045f2d
Show file tree
Hide file tree
Showing 21 changed files with 2,118 additions and 1,575 deletions.
28 changes: 0 additions & 28 deletions .github/cache/config.js

This file was deleted.

12 changes: 10 additions & 2 deletions .github/ci-patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ const { runInfoPatchCombo } = require('@dr-js/dev/library/ci.js')
runKit(async (kit) => {
runInfoPatchCombo(kit)

kit.padLog('Patch npm cache path') // set cache path to `~/.npm/` for all platform (only win32 for now)
kit.RUN_SUDO_NPM([ 'config', '--global', 'set', 'cache', kit.fromHome('.npm/') ])
// kit.padLog('Patch npm cache path') // set cache path to `~/.npm/` for all platform (only win32 for now)
// kit.RUN_SUDO_NPM([ 'config', '--global', 'set', 'cache', kit.fromHome('.npm/') ])

// kit.padLog('Patch install "@dr-js/core" & "@dr-js/dev" & "@min-pack/npm" globally')
// kit.RUN_SUDO_NPM('install --no-fund --no-audit --global @dr-js/core@0.5 @dr-js/dev@0.5 @min-pack/npm@0.1')

if (parseInt(process.versions.node) <= 14) { // TODO: wait for npm@7 adoption and try npm install + cache for faster puppeteer install
kit.RUN('npm i -g @min-pack/npm@0.1')
kit.RUN('npm8 ci --omit=optional')
return
}

kit.RUN('npm ci --omit=optional')
}, { title: 'ci-patch' })
40 changes: 40 additions & 0 deletions .github/workflows/ci-test-2312.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "ci-test-2312"
on: { push: { branches: [ "**" ], tags: [ "v*" ] } } # use `v0.0.0` tag pattern # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags
env: { "IS_CI": true }
jobs:
"test-base": # job id
strategy:
matrix: { OS: [ "ubuntu-latest", "windows-latest", "macos-latest" ], NODE: [ "20.x" ] } # LTS version
fail-fast: false # allow all test to run to the end
runs-on: "${{ matrix.OS }}"
timeout-minutes: 15
steps:
- { uses: "actions/checkout@v4" } # https://github.com/actions/checkout
- { uses: "actions/setup-node@v4", with: { node-version: "${{ matrix.NODE }}" } } # https://github.com/actions/setup-node
- run: npx @dr-js/dev@0.5 -eI .github/ci-patch.js
- run: npm test

"test-extra": # job id
if: "github.ref_type == 'tag'" # only run on git tag push
strategy:
matrix: { OS: [ "ubuntu-latest", "windows-latest", "macos-latest" ], NODE: [ "21.x" ], include: [ { OS: "ubuntu-latest", NODE: "14.x" } ] } # latest version + min-support version
fail-fast: false # allow all test to run to the end
runs-on: "${{ matrix.OS }}"
timeout-minutes: 15
steps:
- { uses: "actions/checkout@v4" } # https://github.com/actions/checkout
- { uses: "actions/setup-node@v4", with: { node-version: "${{ matrix.NODE }}" } } # https://github.com/actions/setup-node
- run: npm i -g @dr-js/core@0.5 @dr-js/dev@0.5 && dr-dev -eI .github/ci-patch.js # TODO: wait for npm fix # - run: npx @dr-js/dev@0.5 -eI .github/ci-patch.js
- run: npm test

"publish-tag": # job id
if: "github.ref_type == 'tag'" # only run on git tag push
needs: [ "test-base", "test-extra" ] # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idneeds
runs-on: "ubuntu-latest"
timeout-minutes: 15
steps:
- { uses: "actions/checkout@v4" } # https://github.com/actions/checkout
- { uses: "actions/setup-node@v4", with: { node-version: "20.x" } } # LTS version # https://github.com/actions/setup-node
- run: npx @dr-js/dev@0.5 -eI .github/ci-patch.js
- run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN_DR_JS }}" > .npmrc
- run: npm run script-publish
36 changes: 0 additions & 36 deletions .github/workflows/ci-test-push.yml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/ci-test-tag.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 dr-js
Copyright (c) 2024 dr-js

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 5 additions & 5 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
+ πŸ“„ [source/common/format.js](source/common/format.js)
- `binary`, `decimal`, `describe`, `mediaTime`, `padTable`, `percent`, `prettyStringifyConfigObject`, `prettyStringifyJSON`, `time`, `typeNameOf`
+ πŸ“„ [source/common/function.js](source/common/function.js)
- `createInsideOutPromise`, `debounce`, `loneAsync`, `lossyAsync`, `once`, `throttle`, `withCache`, `withCacheAsync`, `withDelayArgvQueue`, `withRepeat`, `withRepeatAsync`, `withRetry`, `withRetryAsync`, `withTimeoutAsync`, `withTimeoutPromise`
- `createInsideOutPromise`, `debounce`, `debounceL`, `debounceT`, `loneAsync`, `lossyAsync`, `once`, `runAsPromise`, `runAsyncByLane`, `throttle`, `throttleL`, `throttleT`, `withCache`, `withCacheAsync`, `withDelayArgvQueue`, `withRepeat`, `withRepeatAsync`, `withRetry`, `withRetryAsync`, `withTimeoutAsync`, `withTimeoutPromise`
+ πŸ“„ [source/common/string.js](source/common/string.js)
- `autoEllipsis`, `createMarkReplacer`, `escapeHTML`, `escapeRegExp`, `filterJoin`, `forEachLine`, `forEachRegExpExec`, `indentLine`, `indentLineList`, `indentList`, `joinCamelCase`, `joinKebabCase`, `joinSnakeCase`, `lazyEncodeURI`, `removeInvalidCharXML`, `replaceAll`, `splitCamelCase`, `splitKebabCase`, `splitSnakeCase`, `unescapeHTML`
+ πŸ“„ [source/common/test.js](source/common/test.js)
Expand Down Expand Up @@ -270,13 +270,13 @@
+ πŸ“„ [source/node/module/Software/bash.js](source/node/module/Software/bash.js)
- `catStringToFileCommand`, `catStringToVarCommand`, `check`, `commonBashArgList`, `commonCommandList`, `commonSourceProfileCommandList`, `getArgs`, `gitCleanUpCommandList`, `gitFetchBranchCommandList`, `joinCommand`, `runBash`, `runBashCommand`, `runBashCommandSync`, `runBashStdout`, `runBashStdoutSync`, `runBashSync`, `setArgs`, `subShellCommandList`, `toHeredocNoMagic`, `verify`
+ πŸ“„ [source/node/module/Software/docker.js](source/node/module/Software/docker.js)
- `check`, `checkCompose`, `checkLocalImage`, `checkPullImage`, `getArgs`, `getArgsCompose`, `getContainerLsList`, `matchContainerLsList`, `patchContainerLsListStartedAt`, `pullImage`, `runCompose`, `runComposeStdout`, `runComposeStdoutSync`, `runComposeSync`, `runDocker`, `runDockerStdout`, `runDockerStdoutSync`, `runDockerSync`, `setArgs`, `setArgsCompose`, `verify`, `verifyCompose`
- `check`, `checkCompose`, `checkLocalImage`, `checkPullImage`, `getArgs`, `getArgsCompose`, `getContainerLsList`, `matchContainerLsList`, `parseDockerImage`, `patchContainerLsListStartedAt`, `pullImage`, `runCompose`, `runComposeStdout`, `runComposeStdoutSync`, `runComposeSync`, `runDocker`, `runDockerStdout`, `runDockerStdoutSync`, `runDockerSync`, `setArgs`, `setArgsCompose`, `verify`, `verifyCompose`
+ πŸ“„ [source/node/module/Software/git.js](source/node/module/Software/git.js)
- `check`, `getArgs`, `getGitBranch`, `getGitCommitHash`, `getGitCommitMessage`, `runGit`, `runGitStdout`, `runGitStdoutSync`, `runGitSync`, `setArgs`, `verify`
+ πŸ“„ [source/node/module/Software/hostStatus.js](source/node/module/Software/hostStatus.js)
- `COMMON_HOST_STATUS_COMMAND_LIST`, `getCommonHostStatus`
+ πŸ“„ [source/node/module/Software/npm.js](source/node/module/Software/npm.js)
- `fetchLikeRequestWithProxy`, `fetchWithJumpProxy`, `findUpPackageRoot`, `fromGlobalNodeModules`, `fromNpmNodeModules`, `getPathNpm`, `getPathNpmExecutable`, `getPathNpmGlobalRoot`, `getSudoArgs`, `hasRepoVersion`, `runNpm`, `runNpmStdout`, `runNpmStdoutSync`, `runNpmSync`, `runSudoNpm`, `runSudoNpmStdout`, `runSudoNpmStdoutSync`, `runSudoNpmSync`
- `fetchLikeRequestWithProxy`, `fetchWithJumpProxy`, `findUpNpmrc`, `findUpPackageRoot`, `fromGlobalNodeModules`, `fromNpmNodeModules`, `getPathNpm`, `getPathNpmExecutable`, `getPathNpmGlobalRoot`, `getSudoArgs`, `hasRepoVersion`, `runNpm`, `runNpmStdout`, `runNpmStdoutSync`, `runNpmSync`, `runSudoNpm`, `runSudoNpmStdout`, `runSudoNpmStdoutSync`, `runSudoNpmSync`
+ πŸ“„ [source/node/server/Proxy.js](source/node/server/Proxy.js)
- `createTCPProxyListener`
+ πŸ“„ [source/node/server/Server.js](source/node/server/Server.js)
Expand Down Expand Up @@ -530,7 +530,7 @@
- **Format**
- `binary`, `decimal`, `describe`, `mediaTime`, `padTable`, `percent`, `prettyStringifyConfigObject`, `prettyStringifyJSON`, `time`, `typeNameOf`
- **Function**
- `createInsideOutPromise`, `debounce`, `loneAsync`, `lossyAsync`, `once`, `throttle`, `withCache`, `withCacheAsync`, `withDelayArgvQueue`, `withRepeat`, `withRepeatAsync`, `withRetry`, `withRetryAsync`, `withTimeoutAsync`, `withTimeoutPromise`
- `createInsideOutPromise`, `debounce`, `debounceL`, `debounceT`, `loneAsync`, `lossyAsync`, `once`, `runAsPromise`, `runAsyncByLane`, `throttle`, `throttleL`, `throttleT`, `withCache`, `withCacheAsync`, `withDelayArgvQueue`, `withRepeat`, `withRepeatAsync`, `withRetry`, `withRetryAsync`, `withTimeoutAsync`, `withTimeoutPromise`
- **String**
- `autoEllipsis`, `createMarkReplacer`, `escapeHTML`, `escapeRegExp`, `filterJoin`, `forEachLine`, `forEachRegExpExec`, `indentLine`, `indentLineList`, `indentList`, `joinCamelCase`, `joinKebabCase`, `joinSnakeCase`, `lazyEncodeURI`, `removeInvalidCharXML`, `replaceAll`, `splitCamelCase`, `splitKebabCase`, `splitSnakeCase`, `unescapeHTML`
- **Test**
Expand Down Expand Up @@ -572,7 +572,7 @@
- **Option**
- `createOptionParser`, `Preset`, `createOptionGetter`, `getOptionalFormatFlag`, `getOptionalFormatValue`, `parseOptionMap`, `prepareOption`
- **Software**
- `catStringToFileCommand`, `catStringToVarCommand`, `check`, `commonBashArgList`, `commonCommandList`, `commonSourceProfileCommandList`, `getArgs`, `gitCleanUpCommandList`, `gitFetchBranchCommandList`, `joinCommand`, `runBash`, `runBashCommand`, `runBashCommandSync`, `runBashStdout`, `runBashStdoutSync`, `runBashSync`, `setArgs`, `subShellCommandList`, `toHeredocNoMagic`, `verify`, `check`, `checkCompose`, `checkLocalImage`, `checkPullImage`, `getArgs`, `getArgsCompose`, `getContainerLsList`, `matchContainerLsList`, `patchContainerLsListStartedAt`, `pullImage`, `runCompose`, `runComposeStdout`, `runComposeStdoutSync`, `runComposeSync`, `runDocker`, `runDockerStdout`, `runDockerStdoutSync`, `runDockerSync`, `setArgs`, `setArgsCompose`, `verify`, `verifyCompose`, `check`, `getArgs`, `getGitBranch`, `getGitCommitHash`, `getGitCommitMessage`, `runGit`, `runGitStdout`, `runGitStdoutSync`, `runGitSync`, `setArgs`, `verify`, `COMMON_HOST_STATUS_COMMAND_LIST`, `getCommonHostStatus`, `fetchLikeRequestWithProxy`, `fetchWithJumpProxy`, `findUpPackageRoot`, `fromGlobalNodeModules`, `fromNpmNodeModules`, `getPathNpm`, `getPathNpmExecutable`, `getPathNpmGlobalRoot`, `getSudoArgs`, `hasRepoVersion`, `runNpm`, `runNpmStdout`, `runNpmStdoutSync`, `runNpmSync`, `runSudoNpm`, `runSudoNpmStdout`, `runSudoNpmStdoutSync`, `runSudoNpmSync`
- `catStringToFileCommand`, `catStringToVarCommand`, `check`, `commonBashArgList`, `commonCommandList`, `commonSourceProfileCommandList`, `getArgs`, `gitCleanUpCommandList`, `gitFetchBranchCommandList`, `joinCommand`, `runBash`, `runBashCommand`, `runBashCommandSync`, `runBashStdout`, `runBashStdoutSync`, `runBashSync`, `setArgs`, `subShellCommandList`, `toHeredocNoMagic`, `verify`, `check`, `checkCompose`, `checkLocalImage`, `checkPullImage`, `getArgs`, `getArgsCompose`, `getContainerLsList`, `matchContainerLsList`, `parseDockerImage`, `patchContainerLsListStartedAt`, `pullImage`, `runCompose`, `runComposeStdout`, `runComposeStdoutSync`, `runComposeSync`, `runDocker`, `runDockerStdout`, `runDockerStdoutSync`, `runDockerSync`, `setArgs`, `setArgsCompose`, `verify`, `verifyCompose`, `check`, `getArgs`, `getGitBranch`, `getGitCommitHash`, `getGitCommitMessage`, `runGit`, `runGitStdout`, `runGitStdoutSync`, `runGitSync`, `setArgs`, `verify`, `COMMON_HOST_STATUS_COMMAND_LIST`, `getCommonHostStatus`, `fetchLikeRequestWithProxy`, `fetchWithJumpProxy`, `findUpNpmrc`, `findUpPackageRoot`, `fromGlobalNodeModules`, `fromNpmNodeModules`, `getPathNpm`, `getPathNpmExecutable`, `getPathNpmGlobalRoot`, `getSudoArgs`, `hasRepoVersion`, `runNpm`, `runNpmStdout`, `runNpmStdoutSync`, `runNpmSync`, `runSudoNpm`, `runSudoNpmStdout`, `runSudoNpmStdoutSync`, `runSudoNpmSync`
- **Auth**
- `AUTH_FILE`, `AUTH_FILE_GROUP`, `AUTH_SKIP`, `DEFAULT_AUTH_KEY`, `configureAuth`, `configureAuthFile`, `configureAuthFileGroup`, `configureAuthSkip`, `describeAuthFile`, `generateAuthCheckCode`, `generateAuthFile`, `loadAuthFile`, `saveAuthFile`, `verifyAuthCheckCode`
- **EntityTag**
Expand Down

0 comments on commit 0045f2d

Please sign in to comment.