This project is managed by projen, a project configuration management tool.
- Always use projen for task execution: Run tasks using
pnpm exec projen <task-name>instead of directly using npm, yarn, or other package managers. - Check available tasks: Look in
.projen/tasks.jsonto see all available tasks, their descriptions, and steps. - Common tasks:
pnpm exec projen- Synthesize project configuration filespnpm exec projen build- Builds the project, including running testspnpm exec projen test- Runs tests onlypnpm exec projen compile- Compiles the source code only
- DO NOT manually edit generated files: Files marked with a comment like "~~ Generated by projen. To modify..." should never be edited directly.
- Modify configuration in .projenrc: To change project configuration, always edit the
.projenrc.ts,.projenrc.pyor.projenrc.jsonetc. file and then runpnpm exec projento regenerate the project files. - Check .projenrc first: Before suggesting changes to package.json, tsconfig.json, or other configuration files, always check if these are managed by projen and suggest changes to .projenrc instead.
- Add dependencies through projen: Use the projen configuration to add dependencies instead of manually editing package.json or using npm/yarn install directly.
- Example: In .projenrc, use methods like
addDeps(),addDevDeps(), oraddPeerDeps()to add dependencies.
- Make changes to .projenrc configuration file
- Run
pnpm exec projento synthesize and update generated files - Review the changes
- Commit both .projenrc and the generated files
This project's configuration is defined in the .projenrc file at the root of the repository. All project metadata, dependencies, scripts, and tooling configuration should be managed through this file.
- Always run build after changes: After modifying any source or test file, run
pnpm exec projen buildto ensure your changes compile and pass all tests. - Task completion criteria: A task is not considered complete until:
- All tests pass (
pnpm exec projen test) - There are no compilation errors (
pnpm exec projen compile) - There are no linting errors (usually part of the build, if not, run the linter defined in tasks.json)
- The full build succeeds (
pnpm exec projen build)
- All tests pass (
This repository provides Projen project types for ClickUp. It's a JSII library that exports custom Projen project classes for creating standardized TypeScript and CDK projects with opinionated configurations for ClickUp's development practices.
pnpm projen- Regenerate all project files from.projenrc.tspnpm build- Compile TypeScript and run tests with coveragepnpm test- Run Jest testspnpm test:watch- Run tests in watch modepnpm eslint- Run ESLint linterpnpm compile- Compile TypeScript only
pnpm test path/to/test-file.test.tsTo test changes locally before publishing, build a local tarball and use it in another project:
pnpm build
# Creates: dist/js/clickup-projen@0.0.0.jsii.tgz
# Then in another project:
projen new --from /path/to/clickup-projen/dist/js/clickup-projen@0.0.0.jsii.tgz <project-type>The release process is fully automated via GitHub Actions. Releases are triggered by conventional commits on the main branch.
src/- Source TypeScript files that define Projen project typestest/- Jest test files with snapshot testing.projenrc.ts- Projen configuration for this repository itselfdist/- Built JSII artifacts (generated)lib/- Compiled TypeScript (generated)
Base TypeScript project class that all other project types extend. Key features:
- Enforces
@time-loop/scoped package naming vianormalizeName() - Configures pnpm as package manager with version pinning
- Sets up Renovate bot for dependency management
- Integrates Prettier, ESLint, Jest with opinionated configs
- Supports TypeDoc documentation generation via
TypedocDocgencomponent - Manages node version constraints (min: 18.17.1, workflow: 22.14.0)
Key exports:
ClickUpTypeScriptProject- Base class for TypeScript librariesTypedocDocgen- Component for TypeScript documentationnormalizeName()- Ensures proper@time-loop/package namingfixTsNodeDeps()- Resolves ts-node dependency issues
CDK-specific project types extending clickup-ts. Provides:
ClickUpCdkConstructLibrary- For reusable CDK construct libraries (usecdk-*prefix naming)ClickUpCdkTypeScriptApp- For CDK applications (use*-cdksuffix naming)- Pre-configured with
@time-loop/cdk-library,cdk-constants,multi-convention-namer - Minimum CDK version: 2.189.0
- Optional cdk-diff workflow integration
- Optional cdk.context.json self-mutation support
Key architectural patterns:
- All projects use deep merge for options via
ts-deepmerge - CDK apps include sample code with Widget example demonstrating ClickUp patterns
- Test files use CDK assertions for infrastructure testing
renovate-workflow.ts- Configures Renovate bot with auto-merge for non-breaking updatescdk-diff-workflow.ts- Adds CDK diff visualization in PRs via GitHub Actionscdk-context-json.ts- Enables automatic cdk.context.json lookups and mutationscodecov-bypass-workflow.ts- Allows codecov requirement bypass for specific scenariosupdate-projen.ts- Automated projen version upgrade workflowsadd-to-project.ts- Auto-adds issues/PRs to GitHub project boards
datadog.ts- Sends release events to Datadogdatadog-service-catalog.ts- Updates Datadog service catalogslack-alert.ts- Posts release notifications to Slackcodecov.ts- Configures codecov.yml with 90%+ coverage thresholds
This library is highly opinionated. Key principles:
- Deep Merge Strategy: Options use
ts-deepmergeto overlay defaults → project options → forced overrides - JSII Constraints: As a JSII library, TypeScript features are limited to what's compatible with JSII
- Bundled Dependencies:
cson-parser,semver, andts-deepmergeare bundled to avoid consumer dependency conflicts
Tests use snapshot testing extensively. When making changes:
- Update the code
- Run
pnpm test- snapshots may fail - Review snapshot diffs carefully
- Run
pnpm test -- -uto update snapshots if changes are intentional - Commit updated snapshots with your changes
Version management is centralized in src/utils/parameters.ts:
PROJEN_MIN_ENGINE_NODE_VERSION: Minimum engine requirement (18.17.1)PROJEN_NODE_VERSION: Workflow and development version (22.14.0)PROJEN_PNPM_VERSION: PNPM version (10.22.0)
These cascade to all generated projects. Update in one place to affect all consumers.
Generated projects include:
build.yml- Runs on PRs, includes self-mutation supportrelease.yml- Auto-releases on main branch mergesrenovate.yml- Scheduled dependency updates (weekly)update-projen-main.yml- Updates projen versionpull-request-lint.yml- Enforces conventional commit formatauto-approve.yml- Auto-approves Renovate PRs
All workflows require GitHub Packages authentication configured in repository secrets.
- Create or modify a module in
src/ - Add corresponding test in
test/ - Export from
src/index.tsif it's a public API - Run
pnpm projento regenerate API.md - Run
pnpm test -- -uto update snapshots - Verify in a test project using local tarball
Follow the pattern in existing workflow modules:
- Create a module that exports a function to add the workflow
- Accept a project and optional configuration options
- Use
project.github.addWorkflow()or similar APIs - Add helper functions for common configurations
- Call from project constructors in
clickup-cdk.tsorclickup-ts.ts
- If package.json or lockfile changes after running
pnpm projen, runpnpm installbefore committing - This repository uses PNPM with version management via npmrc
- The
packageManagerfield in package.json pins the exact pnpm version - JSII version is pinned to
~5.8.0(not semantically versioned, use minor updates only) - TypeScript is pinned to
^5.9.3 - Renovate ignores many dependencies that should only be updated deliberately
- Third-party Renovate PRs are deferred for 7 days to allow for community testing
Consumers of this library need GitHub Packages access configured:
cat >> ~/.npmrc <<EOF
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_PAT
@time-loop:registry=https://npm.pkg.github.com/
EOFThe PAT needs read:packages scope at minimum.
- CDK Construct Libraries: Use
cdk-*prefix (e.g.,cdk-my-library)- High quality, deep test coverage, intended for open source
- CDK Applications: Use
*-cdksuffix (e.g.,my-app-cdk)- Thin applications that assemble construct libraries
- TypeScript Libraries: No specific convention yet
All packages are automatically prefixed with @time-loop/ scope by normalizeName().