Files
twenty/packages/twenty-apps/public/people-data-labs/src/utils/normalize-enum-value.ts
T
martmull c71663946e chore(apps): move public apps to packages/twenty-apps/public and generalize CI workflow (#22096)
## What

Introduces a `packages/twenty-apps/public/` folder and moves the
publicly publishable apps into it, then generalizes the apps CI workflow
to cover both folders.

### Moves
The following apps were moved from `packages/twenty-apps/internal/` to
`packages/twenty-apps/public/` (via `git mv`, history preserved):
- `people-data-labs`
- `twenty-discord`
- `twenty-exa`
- `twenty-fireflies`
- `twenty-last-contact`
- `twenty-linear`
- `twenty-meeting-bot`
- `twenty-slack`

These remain in `internal/`: `self-hosting`, `twenty-for-twenty`,
`twenty-partners`.

### Workflow
- Renamed `.github/workflows/ci-internal-apps.yaml` →
`.github/workflows/ci-twenty-apps.yaml`.
- The discover job now scans **both** `packages/twenty-apps/internal`
and `packages/twenty-apps/public`:
  - the "no nested `.github`" guard checks both folders,
  - `changed-files` watches both globs,
- the matrix builder iterates over both roots (guarded with `existsSync`
so a missing folder is a no-op).
- Each matrix entry still carries its own `path`, so the `ci` job works
unchanged regardless of which folder an app lives in.

## Notes
- The apps are standalone packages (own `yarn.lock`, not part of the
root Nx workspaces), so no root `package.json` / `nx.json` / `tsconfig`
changes were needed.
- The companion publish workflow lives in `twentyhq/twenty-infra`
(`publish-internal-apps.yaml` → `publish-public-apps.yaml`) and is
updated in a paired PR.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---
_Generated by [Claude
Code](https://claude.ai/code/session_01Fmu3DWf1yTTkVW49eSkXwh)_

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/22096?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
2026-06-24 17:24:16 +02:00

16 lines
646 B
TypeScript

const DIACRITICS_REGEX = new RegExp('[\\u0300-\\u036f]', 'g');
const NON_ALPHANUMERIC_RUN_REGEX = /[^A-Z0-9]+/g;
const LEADING_OR_TRAILING_UNDERSCORE_REGEX = /^_+|_+$/g;
const LEADING_DIGIT_REGEX = /^(\d)/;
export const normalizeEnumValue = (rawEnumValue: string): string => {
const withoutDiacritics = rawEnumValue
.normalize('NFKD')
.replace(DIACRITICS_REGEX, '');
const upperCased = withoutDiacritics.toUpperCase();
const underscored = upperCased.replace(NON_ALPHANUMERIC_RUN_REGEX, '_');
const trimmed = underscored.replace(LEADING_OR_TRAILING_UNDERSCORE_REGEX, '');
return trimmed.replace(LEADING_DIGIT_REGEX, '_$1');
};