Skip to content

chore: mark internal packages private and clean up codegen scripts - #1819

Merged
drstrangelooker merged 2 commits into
mainfrom
chore/retire-deprecated-internal-packages
Dec 4, 2026
Merged

drstrangelooker merged 2 commits into
mainfrom
chore/retire-deprecated-internal-packages

Conversation

@minhaz

@minhaz minhaz commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Marks three internal/deprecated workspace packages as private so they are no longer published to npm, removes unused dependencies on them from published packages, and cleans up process invocation and login request formatting in @looker/sdk-codegen-scripts:

  • Mark internal workspace packages private:
    • Set "private": true and removed publishConfig in packages/sdk-codegen-scripts/package.json, packages/sdk-codegen-utils/package.json, and packages/wholly-artifact/package.json.
    • Updated each package's README.md to state that it is private to this workspace and no longer published to npm.
    • Kept all three packages in Release Please configuration (release-please-config.json, .release-please-manifest.json, release-please-config.json.template) so exact @looker/* workspace pins remain synchronized across releases (matching the other private workspace packages in this repo).
  • Remove unused dependencies from published packages:
    • Removed unused @looker/sdk-codegen-scripts from packages/api-explorer/package.json (devDependencies).
    • Removed unused @looker/sdk-codegen-utils from packages/run-it/package.json (dependencies).
  • Direct process invocation in @looker/sdk-codegen-scripts (nodeUtils.ts & callers):
    • Replaced execSync string concatenation in packages/sdk-codegen-scripts/src/nodeUtils.ts (run()) with spawnSync(command, args, { shell: false, ... }), preserving stderr forwarding on success and existing warning vs. quit() error handling.
    • Added pure-Node hasCommand() PATH lookup in nodeUtils.ts.
    • Updated all callers:
      • packages/sdk-codegen-scripts/src/convert.ts: resolve swagger2openapi/swagger2openapi.js directly via process.execPath and pass '' for -i.
      • packages/sdk-codegen-scripts/src/legacyGenerator.ts: split spec.options on whitespace into separate argv elements, omitting empty tokens.
      • packages/sdk-codegen-scripts/src/reformatter.ts (PythonFormatter, GoFormatter): use hasCommand('pipenv') / hasCommand('gofmt'), guard empty file lists, and pass ...files as separate arguments.
  • Form-encoded login body in @looker/sdk-codegen-scripts (fetchSpec.ts):
    • Updated login() to encode client_id / client_secret with encodeParams(creds) from @looker/sdk-rtl and send them in the POST body with content-type: application/x-www-form-urlencoded (with queryParams = undefined and non-mutating mergeOptions(props, ...)), matching NodeSession._login().

Testing

  • Added unit tests in:
    • packages/sdk-codegen-scripts/src/nodeUtils.spec.ts
    • packages/sdk-codegen-scripts/src/fetchSpec.spec.ts
  • Ran ESLint on all modified and new TypeScript files (0 errors, 0 warnings).
  • Ran yarn lint:ts, yarn build, and yarn dedupe:ci (all passed, yarn.lock untouched).
  • Ran Jest across packages/sdk-codegen(|-utils|-scripts)/src (19 passed, 2 skipped / 431 passed tests), packages/run-it/src and packages/api-explorer/src (74 passed, 3 skipped / 357 passed tests), and packages/wholly-artifact/src/RowModel.spec.ts (30 passed tests).
  • Verified yarn convert spec/Looker.4.0.json ... produces byte-for-byte identical OpenAPI 3 output compared to origin/main (cmp exit 0).

- Mark `@looker/sdk-codegen-scripts`, `@looker/sdk-codegen-utils`, and
  `@looker/wholly-artifact` as `"private": true`, remove `publishConfig`,
  and update their READMEs to note they are workspace-only packages no
  longer published to npm.
- Keep all three packages in Release Please configuration so exact
  `@looker/*` workspace dependency pins stay synchronized.
- Remove unused workspace dependencies on retired packages from
  `@looker/api-explorer` (`devDependencies`) and `@looker/run-it`
  (`dependencies`).
- Update `packages/sdk-codegen-scripts/src/nodeUtils.ts` (`run()`) to use
  direct `spawnSync` process invocation (`shell: false`), add pure-Node
  `hasCommand()` PATH lookup, and update callers in `convert.ts`,
  `legacyGenerator.ts`, and `reformatter.ts`.
- Update `packages/sdk-codegen-scripts/src/fetchSpec.ts` (`login()`) to
  send credentials in a form-encoded POST body
  (`application/x-www-form-urlencoded`) rather than URL query parameters.
- Add unit tests in `packages/sdk-codegen-scripts/src/nodeUtils.spec.ts`
  and `packages/sdk-codegen-scripts/src/fetchSpec.spec.ts`.
@minhaz
minhaz requested a review from a team as a code owner December 3, 2026 20:09

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request marks several packages as private workspace-only packages and refactors command execution in nodeUtils.ts to use spawnSync instead of execSync for safer argument handling. It also updates formatters and generators to pass arguments as arrays, fixes parameter encoding in fetchSpec.ts, and adds unit tests. The review feedback identifies critical issues regarding Windows compatibility: hasCommand failing when commands already have extensions, spawnSync failing on Windows without a shell for batch files, and simple whitespace splitting breaking quoted arguments with spaces in legacyGenerator.ts.

@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

APIX Tests

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit 15e37d2. ± Comparison against base commit 6aac62e.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Codegen Tests

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 15e37d2.

♻️ This comment has been updated with latest results.

@drstrangelooker
drstrangelooker merged commit c1d4b11 into main Dec 4, 2026
23 checks passed
@drstrangelooker
drstrangelooker deleted the chore/retire-deprecated-internal-packages branch December 4, 2026 17:25
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.

3 participants