Skip to content

V3#19

Merged
SerhiyGreench merged 12 commits into
masterfrom
v3
Jul 10, 2026
Merged

V3#19
SerhiyGreench merged 12 commits into
masterfrom
v3

Conversation

@SerhiyGreench

Copy link
Copy Markdown
Contributor

No description provided.

- native ES modules: type=module, exports map, explicit .js import
  extensions, engines node >=22.12.0; createRequire shims where JSON /
  CJS-callable modules are loaded (package.json, command-exists,
  word-wrap, licenses.json)
- yargs commandDir() is unsupported under ESM: all commands and
  subcommands are now registered explicitly via .command(module)
- deps: @imqueue/core ^3.2.1, @imqueue/rpc ^3.2.1 (ESM majors),
  @octokit/rest 16 -> 22 (teams.list instead of removed orgs.getTeams,
  status-based 404 detection, plain token auth), deprecated 'request'
  replaced with global fetch, node-rsa via default import
- autoupdate: prompts only when the registry version is actually newer
  (semver.gt instead of !==) and never in non-interactive runs, which
  previously crashed piped invocations (ERR_USE_AFTER_CLOSE)
- tests migrated from mocha/chai/mock-require/nyc to node:test with
  mock.module for ioredis/command-exists; cli file locations sandboxed
  in tests via new IMQ_CLI_HOME env override (lib/constants is part of
  a module cycle with lib/path, which made ESM module-mocking of it
  unreliable)
- lint/format switched from eslint to oxlint + oxfmt; devDeps reduced
- version bumped to 3.0.0
- service detection now resolves the package entry (exports map, main,
  index.js fallback) and loads it with dynamic import(), so both CJS and
  ESM services are supported
- inheritance check walks the whole prototype chain instead of comparing
  only the direct parent class name
- detection no longer stops at the first '*Service' export (e.g. a
  ServiceOptions export no longer hides the real service class)
- working directory and console.log are now restored in finally: before,
  a detected service or a thrown import left the process chdir'ed into
  the service folder and/or console.log suppressed
- spawn failures without stderr (e.g. ENOENT) no longer crash the
  reporter
- containsServiceClass/resolveServiceEntry exported and covered with
  unit tests (11 new tests)
Nothing in the cli imports @imqueue/core directly; it remains available
transitively through @imqueue/rpc.
Node 22 loads .env files natively; the only dotenv usage was the
(live-API, skipped) github spec. loadEnvFile() throws when no .env
exists, so it is wrapped to keep dotenv's silent no-op semantics.
…ive code

- chalk -> util.styleText (respects NO_COLOR/FORCE_COLOR natively)
- node-rsa -> crypto.publicEncrypt with RSA_PKCS1_PADDING (same
  RSAES-PKCS1-v1_5 scheme travis expects)
- word-wrap -> small native paragraph-aware wrap() implementation
- command-exists -> native probe in lib/node.ts (command -v / where);
  the IMQ_CLI_MISSING_COMMANDS env var replaces the module mock as the
  test seam, and the command-exists module mock is gone from test setup

Runtime deps are now rpc, travis, octokit, inquirer(+autocomplete),
semver and yargs.
The cli uses four GitHub endpoints (org info, org teams, repo lookup,
repo creation in org), now served by a ~60-line fetch client with
bearer auth, api-version pinning and GithubApiError carrying the HTTP
status. Exported function signatures (getInstance/getTeam/getOrg/
createRepository) are unchanged. Adds 12 offline specs exercising the
client against a stubbed fetch (auth header, error mapping, the
already-exists and non-404 rethrow flows); live specs stay skipped.
The cli uses four Travis API v2 endpoints (github token exchange, repo
public key, user sync, hooks get/update), now served by a small fetch
client with TravisApiError carrying the HTTP status. travisEncrypt,
trySyncBuilds and enableBuilds keep their signatures; the client
exposes explicit methods (getRepositoryKey/syncUsers/getHooks/
updateHook) instead of the old chained proxy API.

Adds 6 offline specs against a stubbed fetch, including a full RSA
roundtrip: travisEncrypt output is decrypted back with the generated
repository private key, proving the RSAES-PKCS1-v1_5 scheme matches.

The cli now has zero HTTP-client dependencies; runtime deps are rpc,
inquirer(+autocomplete), semver and yargs.
The migration commit had pre-set 3.0.0, which would make the usual
'npm version major' release flow skip to 4.0.0. Align back to the
published 2.0.2 so the release flow itself produces 3.0.0 with its tag
and commit.
- console.log added to the allowed console methods in .oxlintrc.json:
  stdout printing is this package's user interface, not debug leftovers
- unused catch bindings dropped (bare catch)
- dead PROGRAM variable removed from service update-version (assigned
  from yargs argv but never read); its builder no longer needs async
- isGuthubToken import in validate spec was unused because the function
  had no tests - covered now instead of dropping the import
@SerhiyGreench SerhiyGreench merged commit db0a2a2 into master Jul 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant