Skip to content
Draft
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
11 changes: 8 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,24 @@ jobs:
with:
persist-credentials: false

- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6

- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
env:
FORCE_COLOR: 0
with:
node-version: 24
registry-url: 'https://registry.npmjs.org'
cache: yarn
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Install dependencies
run: yarn install --frozen-lockfile --prefer-offline
# Supersedes #200: dependency lifecycle scripts stay disabled in this
# OIDC-enabled job even when ordinary CI has reviewed build approvals.
run: pnpm install --frozen-lockfile --prefer-offline --ignore-scripts

- name: Build releasable packages
run: yarn build
run: pnpm build

- name: Configure npm registry
run: |
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,22 @@ jobs:
name: Node ${{ matrix.node }}, ${{ matrix.env.DB }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
env:
FORCE_COLOR: 0
with:
node-version: ${{ matrix.node }}
cache: yarn
cache: pnpm

- name: Set env vars (MySQL)
if: contains(matrix.env.DB, 'mysql')
run: |
echo "database__connection__host=127.0.0.1" >> $GITHUB_ENV
echo "database__connection__port=${{ job.services.mysql.ports['3306'] }}" >> $GITHUB_ENV
echo "database__connection__host=127.0.0.1" >> "$GITHUB_ENV"
echo "database__connection__port=${{ job.services.mysql.ports['3306'] }}" >> "$GITHUB_ENV"

- run: yarn
- run: yarn test
- run: pnpm install --frozen-lockfile --prefer-offline
- run: pnpm test

- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7

Expand Down
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Runtime data
pids
Expand Down Expand Up @@ -53,9 +52,6 @@ typings/
# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ Utilities for using NQL

## Develop

This is a mono repository, managed with [lerna](https://lernajs.io/).
This is a monorepo managed with [Lerna](https://lerna.js.org/) and pnpm workspaces.

1. `git clone` this repo & `cd` into it as usual
2. `yarn setup` is mapped to `lerna bootstrap`
2. Enable Corepack with `corepack enable`
3. Run `pnpm setup`
- installs all external dependencies
- links all internal dependencies

Expand All @@ -24,18 +25,18 @@ To add a new package to the repo:

## Run

- `yarn dev`
- `pnpm dev`


## Test

- `yarn lint` run just eslint
- `yarn test` run lint and tests
- `pnpm lint` runs just ESLint
- `pnpm test` runs lint and tests


## Publish

- `yarn ship` is an alias for `lerna version`
- `pnpm ship` is an alias for `lerna version`
- Bumps the version of all packages which have changed, also updating any packages which depend on them
- Commits the new versions ("Published new versions"), tags the releases, and pushes to the remote (set `GHOST_UPSTREAM` to push to a remote other than `origin`)
- Publishing to npm happens in CI: the [Publish workflow](.github/workflows/publish.yml) picks up the version commit on `main` and publishes any package versions missing from the registry via [OIDC trusted publishing](https://docs.npmjs.com/trusted-publishers)
Expand All @@ -44,4 +45,4 @@ To add a new package to the repo:

# Copyright & License

Copyright (c) 2013-2026 Ghost Foundation - Released under the [MIT license](LICENSE).
Copyright (c) 2013-2026 Ghost Foundation - Released under the [MIT license](LICENSE).
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "independent",
"npmClient": "yarn",
"npmClient": "pnpm",
"packages": ["packages/*"],
"command": {
"version": {
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"private": true,
"packageManager": "pnpm@11.15.1+sha512.81350b07e53c9538a02f1f2303b4290fa2d7be04e56e2a970c4cc4b417dc761de196edabd49d55c7dc9580db81007c44143e4e3d7e462b3000d23c255122d065",
"repository": "https://github.com/TryGhost/NQL",
"author": "Ghost Foundation",
"license": "MIT",
Expand All @@ -12,12 +13,11 @@
"scripts": {
"dev": "echo \"Implement me!\"",
"build": "lerna run --scope @tryghost/nql-lang build",
"presetup": "yarn",
"setup": "lerna bootstrap",
"setup": "pnpm install",
"test": "lerna run test",
"pretest": "yarn build",
"pretest": "pnpm build",
"lint": "lerna run lint",
"preship": "yarn test",
"preship": "pnpm test",
"ship": "lerna version --git-remote ${GHOST_UPSTREAM:-origin}"
},
"devDependencies": {
Expand Down
6 changes: 1 addition & 5 deletions packages/mongo-knex/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Runtime data
pids
Expand Down Expand Up @@ -53,9 +52,6 @@ typings/
# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

Expand Down
10 changes: 5 additions & 5 deletions packages/mongo-knex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
## Installation
1. Make sure that `gstenv` is green. See [Dev Environment](https://github.com/TryGhost/Team/blob/master/Engineering/Dev%20Environment.md) for docs.
2. `git clone` this repo & `cd` into it as usual
3. Run `yarn` to install top-level dependencies.
3. Run `pnpm install` to install top-level dependencies.

## Run
- Use: `yarn dev`
- Use: `pnpm dev`
- View: [http://localhost:9999](http://localhost:9999)

## Test
- `yarn lint` run just eslint
- `yarn test` run lint && tests
- `NODE_ENV=testing-mysql yarn test`
- `pnpm lint` run just ESLint
- `pnpm test` run lint && tests
- `NODE_ENV=testing-mysql pnpm test`
- Manual database creation is currently required.

## Debug
Expand Down
4 changes: 2 additions & 2 deletions packages/mongo-knex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"main": "index.js",
"scripts": {
"lint": "eslint . --ext .js --cache",
"posttest": "yarn lint",
"test": "yarn test-unit && yarn test-integration --timeout 10000",
"posttest": "pnpm lint",
"test": "pnpm test-unit && pnpm test-integration --timeout 10000",
"test-unit": "c8 --all --reporter text --reporter html --reporter cobertura mocha ./test/unit/*.test.js --exit",
"test-integration": "mocha ./test/integration/*.test.js --exit"
},
Expand Down
6 changes: 1 addition & 5 deletions packages/mongo-utils/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Runtime data
pids
Expand Down Expand Up @@ -53,9 +52,6 @@ typings/
# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

Expand Down
8 changes: 4 additions & 4 deletions packages/mongo-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ or
## Develop

1. `git clone` this repo & `cd` into it as usual
2. Run `yarn` to install top-level dependencies.
2. Run `pnpm install` to install top-level dependencies.


## Run

- `yarn dev`
- `pnpm dev`


## Test

- `yarn lint` run just eslint
- `yarn test` run lint and tests
- `pnpm lint` run just ESLint
- `pnpm test` run lint and tests


# Copyright & License
Expand Down
2 changes: 1 addition & 1 deletion packages/mongo-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dev": "echo \"Implement me!\"",
"test": "NODE_ENV=testing c8 --all --check-coverage mocha './test/**/*.test.js'",
"lint": "eslint . --ext .js --cache",
"posttest": "yarn lint"
"posttest": "pnpm lint"
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 1 addition & 5 deletions packages/nql-lang/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Runtime data
pids
Expand Down Expand Up @@ -53,9 +52,6 @@ typings/
# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

Expand Down
8 changes: 4 additions & 4 deletions packages/nql-lang/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
## Installation
1. Make sure that `gstenv` is green. See [Dev Environment](https://github.com/TryGhost/Team/blob/master/Engineering/Dev%20Environment.md) for docs.
2. `git clone` this repo & `cd` into it as usual
3. Run `yarn` to install top-level dependencies.
3. Run `pnpm install` to install top-level dependencies.

## Run
- Use: `yarn dev`
- Use: `pnpm dev`
- View: [http://localhost:9999](http://localhost:9999)

## Test
- `yarn lint` run just eslint
- `yarn test` run lint && tests
- `pnpm lint` run just ESLint
- `pnpm test` run lint && tests

# Copyright & License

Expand Down
4 changes: 2 additions & 2 deletions packages/nql-lang/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"scripts": {
"build": "jison src/nql.y src/nql.l -o dist/parser.js",
"lint": "eslint . --ext .js --cache",
"pretest": "yarn build",
"posttest": "yarn lint",
"pretest": "pnpm build",
"posttest": "pnpm lint",
"test": "NODE_ENV=testing c8 --all --reporter text --reporter html --reporter cobertura mocha ./test/**/*.test.js",
"test:lex": "NODE_ENV=testing mocha ./test/**/lex*.test.js",
"test:parse": "NODE_ENV=testing mocha ./test/**/pars*.test.js"
Expand Down
6 changes: 1 addition & 5 deletions packages/nql/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Runtime data
pids
Expand Down Expand Up @@ -53,9 +52,6 @@ typings/
# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

Expand Down
4 changes: 2 additions & 2 deletions packages/nql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ query
```

## Test
- `yarn lint` run just eslint
- `yarn test` run lint && tests
- `pnpm lint` run just ESLint
- `pnpm test` run lint && tests

# Copyright & License

Expand Down
2 changes: 1 addition & 1 deletion packages/nql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"main": "index.js",
"scripts": {
"lint": "eslint . --ext .js --cache",
"posttest": "yarn lint",
"posttest": "pnpm lint",
"test": "c8 --all --100 --reporter text --reporter html --reporter cobertura mocha ./test/**/*.test.js --exit"
},
"publishConfig": {
Expand Down
Loading