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
35 changes: 24 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:12.21
- image: cimg/node:22.14.0

jobs:
test:
Expand All @@ -13,34 +13,47 @@ jobs:

- restore_cache:
keys:
- v1-dependencies-{{arch}}-{{ checksum "package.json" }}
- v1-dependencies-{{arch}}-
- v2-pnpm-{{arch}}-{{ checksum "pnpm-lock.yaml" }}
- v2-pnpm-{{arch}}-

- run:
name: Install pnpm via corepack
command: |
command -v corepack >/dev/null 2>&1 || sudo npm install -g corepack
sudo corepack enable
sudo corepack prepare --activate

- run:
name: Verify Socket Firewall registry is active
command: |
REGISTRY=$(npm config get registry)
echo "npm registry: $REGISTRY"
echo "$REGISTRY" | grep -q socket-firewall-registry || { echo "FAIL: npm not routed through Socket Firewall"; exit 1; }
REGISTRY=$(pnpm config get registry)
echo "pnpm registry: $REGISTRY"
echo "$REGISTRY" | grep -q socket-firewall-registry || { echo "FAIL: pnpm not routed through Socket Firewall"; exit 1; }

- run: yarn install
- run: pnpm install --frozen-lockfile

- save_cache:
key: v1-dependencies-{{arch}}-{{ checksum "package.json" }}
key: v2-pnpm-{{arch}}-{{ checksum "pnpm-lock.yaml" }}
paths:
- node_modules
- ~/.local/share/pnpm/store

- run:
name: Check format
command: yarn format:check
command: pnpm run format:check

- run:
name: Run linter
command: yarn lint
command: pnpm run lint

- run:
name: Run tests
command: yarn test:ci
command: pnpm run test:ci
environment:
# Node 22 exposes a jest+ts-jest+coverage OOM on the render.test.ts
# entry point (all renderers instantiated with instrumentation).
# Raise old-space from the default so the worker fits.
NODE_OPTIONS: --max-old-space-size=4096

workflows:
version: 2
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CAVEAT: This repo currently publishes via semantic-release (see `npm run semantic-release`
# CAVEAT: This repo currently publishes via semantic-release (see `pnpm run semantic-release`
# in package.json and the `release` job in .circleci/config.yml). semantic-release cannot emit
# `npm stage publish`, so this staged-publishing workflow is NOT yet wired into the live release
# path. Before adopting it, the semantic-release flow must be reconciled with OIDC staged
Expand Down Expand Up @@ -48,13 +48,14 @@ jobs:
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: { persist-credentials: false }
- uses: pnpm/action-setup@7088e561eb65bb68695d245aa206f005ef30921d # v4.1.0
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
package-manager-cache: false
- run: yarn install --frozen-lockfile
- run: yarn build
- run: pnpm install --frozen-lockfile
- run: pnpm run build
- run: npm install -g npm@11.15.0 # npm CLI: staged publishing needs npm >= 11.15.0
- name: Resolve dist-tag (a prerelease must never go to `latest`)
id: disttag
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ This project is a Rollup-based TypeScript NodeJS library. To get the source and
```bash
git clone git@github.com:intercom/contentful-typescript-codegen.git
cd contentful-typescript-codegen
yarn install
pnpm install
```

To ensure everything is set up correctly:

```bash
yarn test
pnpm test
```

### Project structure
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ ensure that breaking changes to our Content Types don't cause an outage, and bec
## Usage

```sh
# npm
npm install --save-dev contentful-typescript-codegen

# yarn
yarn add --dev contentful-typescript-codegen

# pnpm
pnpm add --save-dev contentful-typescript-codegen
```

Then, add the following to your `package.json`:
Expand Down
23 changes: 15 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@
"type": "git",
"url": "https://github.com/intercom/contentful-typescript-codegen"
},
"resolutions": {
"braces": "3.0.3",
"ansi-regex": "3.0.1",
"minimist": "1.2.6",
"micromatch": "4.0.8",
"cross-spawn": "7.0.6"
"packageManager": "pnpm@10.23.0+sha512.21c4e5698002ade97e4efe8b8b4a89a8de3c85a37919f957e7a0f30f38fbc5bbdd05980ffe29179b2fb6e6e691242e098d945d1601772cad0fef5fb6411e2a4b",
"pnpm": {
"overrides": {
"braces": "3.0.3",
"ansi-regex": "3.0.1",
"minimist": "1.2.6",
"micromatch": "4.0.8",
"cross-spawn": "7.0.6"
},
"ignoredBuiltDependencies": [
"husky"
]
},
"version": "0.0.1-development",
"main": "dist/contentful-typescript-codegen.js",
Expand All @@ -25,12 +31,12 @@
"build": "tsc --module commonjs && rollup -c rollup.config.ts && chmod +x dist/contentful-typescript-codegen.js",
"commit": "git-cz",
"format": "prettier --write \"**/*.ts\"",
"format:check": "npm run format -- --check",
"format:check": "pnpm run format -- --check",
"lint": "tslint --project tsconfig.json -t codeFrame 'src/**/*.ts' 'test/**/*.ts'",
"start": "rollup -c rollup.config.ts -w",
"test": "jest --coverage",
"test:ci": "jest --coverage --max-workers=2 --ci",
"test:prod": "npm run lint && npm run test -- --no-cache",
"test:prod": "pnpm run lint && pnpm run test -- --no-cache",
"test:watch": "jest --coverage --watch",
"semantic-release": "semantic-release"
},
Expand Down Expand Up @@ -73,6 +79,7 @@
"semantic-release": "^17.4.7",
"ts-jest": "^26.0.0",
"ts-node": "^10.6.0",
"tslib": "^2.8.1",
"tslint": "^5.18.0",
"tslint-config-prettier": "^1.18.0",
"tslint-config-standard": "^8.0.1",
Expand Down
Loading