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
10 changes: 10 additions & 0 deletions .evergreen/config.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,16 @@ functions:
args:
- .evergreen/docker/alpine.sh

"build documentation":
- command: subprocess.exec
type: test
params:
working_dir: "src"
binary: bash
args:
- "-c"
- "npm run build:docs -- --yes"

tasks:
- name: "test-atlas-data-lake"
tags: ["datalake", "mongohouse"]
Expand Down
20 changes: 20 additions & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,15 @@ functions:
add_expansions_to_env: true
args:
- .evergreen/docker/alpine.sh
build documentation:
- command: subprocess.exec
type: test
params:
working_dir: src
binary: bash
args:
- '-c'
- npm run build:docs -- --yes
tasks:
- name: test-atlas-data-lake
tags:
Expand Down Expand Up @@ -2038,6 +2047,17 @@ tasks:
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: check resource management feature integration
- name: test-build-docs
tags:
- lint-checks
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: NODE_LTS_VERSION, value: '22'}
- func: install dependencies
- func: build documentation
- name: check-types-typescript-next-node-types-22.15.3
tags:
- check-types-typescript-next
Expand Down
11 changes: 11 additions & 0 deletions .evergreen/generate_evergreen_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,17 @@ SINGLETON_TASKS.push(
{ func: 'check resource management feature integration' }
]
},
{
name: 'test-build-docs',
tags: ['lint-checks'],
commands: [
updateExpansions({
NODE_LTS_VERSION: LATEST_LTS
}),
{ func: 'install dependencies' },
{ func: 'build documentation' }
]
},
...Array.from(makeTypescriptTasks())
]
);
Expand Down
9 changes: 6 additions & 3 deletions etc/docs/build.ts → etc/docs/build.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { parse, stringify } from '@iarna/toml';
import { exec as execCb } from 'child_process';
import { readFile, writeFile } from 'fs/promises';
import { basename, dirname, join } from 'path';
import { chdir } from 'process';
import { promisify } from 'util';

Expand All @@ -15,7 +16,7 @@ import {
log,
type TomlVersionSchema,
type VersionSchema
} from './utils';
} from './utils.mts';

const exec = promisify(execCb);

Expand Down Expand Up @@ -73,16 +74,18 @@ async function updateSiteTemplateForNewVersion(
}

async function main() {
const __dirname = import.meta.dirname;

try {
await exec('bash ./etc/check-remote.sh');
await exec(`bash ${join(__dirname, '../check-remote.sh')}`);
} catch (error) {
console.error(error.stdout);
process.exit(1);
}

chdir(__dirname);

const { tag, status, skipPrompts } = getCommandLineArguments();
const { tag, status, skipPrompts } = await getCommandLineArguments();

const newVersion: VersionSchema = {
version: `${tag} Driver`,
Expand Down
4 changes: 2 additions & 2 deletions etc/docs/preview.ts → etc/docs/preview.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as express from 'express';
import express from 'express';

import { log } from './utils';
import { log } from './utils.mts';

const app = express();

Expand Down
4 changes: 2 additions & 2 deletions etc/docs/utils.ts → etc/docs/utils.mts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ export async function confirm(message: string) {
}
}

export function getCommandLineArguments(): {
export async function getCommandLineArguments(): Promise<{
tag: string;
status: VersionSchema['status'];
skipPrompts;
} {
}> {
const {
status,
tag,
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"build:evergreen": "node .evergreen/generate_evergreen_tasks.js",
"build:ts": "node ./node_modules/typescript/bin/tsc",
"build:dts": "npm run build:ts && api-extractor run && node etc/clean_definition_files.cjs && ESLINT_USE_FLAT_CONFIG=false eslint --no-ignore --fix mongodb.d.ts lib/beta.d.ts",
"build:docs": "./etc/docs/build.ts",
"build:docs": "cd etc/docs && node --loader ts-node/esm build.mts",
"build:typedoc": "typedoc",
"build:nightly": "node ./.github/scripts/nightly.mjs",
"check:bench": "npm --prefix test/benchmarks/driver_bench start",
Expand Down Expand Up @@ -161,7 +161,7 @@
"check:x509": "nyc mocha test/manual/x509_auth.test.ts",
"fix:eslint": "npm run check:eslint -- --fix",
"prepare": "node etc/prepare.js",
"preview:docs": "ts-node etc/docs/preview.ts",
"preview:docs": "cd etc/docs && node --loader ts-node/esm preview.mts",
"test": "npm run check:lint && npm run test:all",
"test:all": "npm run check:unit && npm run check:test",
"update:docs": "npm run build:docs -- --yes"
Expand All @@ -175,4 +175,4 @@
"moduleResolution": "node"
}
}
}
}