Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/nself-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,40 @@ jobs:
curl -sSfL https://github.com/gitleaks/gitleaks/releases/download/v8.21.2/gitleaks_8.21.2_linux_x64.tar.gz \
| tar xz -C /usr/local/bin gitleaks

# This repo has no pnpm-workspace.yaml (see gate_workspace.go), so the
# node gate runs lint/typecheck/test/build against each nested
# package.json directly, one directory at a time. Nothing installs
# those directories' own dependencies for it — install them here so
# the check reflects the packages' real declared dependencies instead
# of failing on modules that were simply never fetched.
- name: Install Node dependencies for independent packages
run: |
pnpm install --frozen-lockfile --dir .workers/plugins-registry
pnpm install --frozen-lockfile --dir free/feature-flags/sdk-ts
pnpm install --frozen-lockfile --dir shared

# ORDER IS LOAD-BEARING: shared must be BUILT before the packages that
# depend on it are INSTALLED.
#
# free/file-processing/ts and free/media-processing/ts depend on
# @nself/plugin-utils via "file:../../../shared". pnpm does NOT symlink a
# file: dependency back to the source tree — it takes a real directory
# COPY into its store (.pnpm/@nself+plugin-utils@file+..+..+..+shared_*/)
# at install time. Anything produced in shared/ AFTER that install, such
# as shared/dist, is therefore absent from the copy the dependents
# actually resolve against, and since @nself/plugin-utils' main/types
# point at ./dist/*, tsc reports "Cannot find module '@nself/plugin-utils'"
# for every importing file.
#
# Building shared first means the copy already contains dist/.
- name: Build shared plugin-utils package (before its dependents install)
run: pnpm --dir shared run build

- name: Install Node dependencies for packages depending on shared
run: |
pnpm install --frozen-lockfile --dir free/file-processing/ts
pnpm install --frozen-lockfile --dir free/media-processing/ts

- name: Run nself ci gate
env:
GH_TOKEN: ${{ github.token }}
Expand Down
24 changes: 24 additions & 0 deletions free/feature-flags/sdk-ts/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Jest config for @nself/feature-flags-client.
*
* The package has no jest.config previously — jest ran with zero
* TypeScript transform and every test failed at the `import` statement.
* ts-jest was already an installed devDependency but never wired up.
*
* Source uses NodeNext module resolution and imports its own sibling
* modules with an explicit `.js` extension (e.g. `./index.js`) even though
* the file on disk is `index.ts` — the standard NodeNext-ESM-style
* convention. Jest's CommonJS resolver does not do that rewrite on its
* own, so moduleNameMapper strips the `.js` suffix back off before
* resolution, letting ts-jest's transform pick up the matching `.ts`
* file.
*/

/** @type {import('jest').Config} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
};
1 change: 1 addition & 0 deletions free/feature-flags/sdk-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
},
"devDependencies": {
"@types/jest": "^29.0.0",
"@types/node": "^20.10.0",
"@types/react": "^19.0.0",
"jest": "^29.0.0",
"ts-jest": "^29.0.0",
Expand Down
Loading
Loading