File tree Expand file tree Collapse file tree 3 files changed +4
-37
lines changed Expand file tree Collapse file tree 3 files changed +4
-37
lines changed Original file line number Diff line number Diff line change @@ -43,21 +43,8 @@ nvm use --lts
4343
4444set -o xtrace
4545
46-
47-
48- # setup npm cache in a local directory
49- cat << EOT > .npmrc
50- devdir=${NPM_CACHE_DIR} /.node-gyp
51- init-module=${NPM_CACHE_DIR} /.npm-init.js
52- cache=${NPM_CACHE_DIR}
53- tmp=${NPM_TMP_DIR}
54- registry=https://registry.npmjs.org
55- EOT
56-
5746# install node dependencies
58- # npm prepare runs after install and will compile the library
59- # TODO(NODE-3555): rollup dependencies for node polyfills have broken peerDeps. We can remove this flag once we've removed them.
60- npm install --legacy-peer-deps
47+ npm install
6148
6249set +o xtrace
6350echo " Running: nvm use ${NODE_VERSION} "
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22set -o errexit # Exit the script with error if any of the commands fail
33
4- # source "${PROJECT_DIRECTORY}/.evergreen/init-nvm.sh"
4+ source " ${PROJECT_DIRECTORY} /.evergreen/init-nvm.sh"
55
66set -o xtrace
77
@@ -19,7 +19,7 @@ npm install --no-save --force typescript@"$TS_VERSION"
1919echo " Typescript $( $TSC -v) "
2020
2121# check resolution uses the default latest types
22- echo " import * as BSON from '.'" > file.ts && node $TSC --noEmit --traceResolution file.ts | grep ' bson.d.ts' && rm file.ts
22+ echo " import * as BSON from '.'" > file.ts && node $TSC --emitDeclarationOnly --traceResolution file.ts | grep ' bson.d.ts' && rm file.ts
2323
2424# check compilation
2525rm -rf node_modules/@types/eslint # not a dependency we use, but breaks the build :(
Original file line number Diff line number Diff line change @@ -30,26 +30,6 @@ const tsConfig = {
3030} ;
3131const input = 'src/index.ts' ;
3232
33- const defaultName = 'BSON' ;
34-
35- const cjsImport = `const nodejsRandomBytes = (() => {
36- try {
37- return require('crypto').randomBytes;
38- }
39- catch {
40- return nodejsMathRandomBytes;
41- }
42- })();` ;
43-
44- const esmImport = `const nodejsRandomBytes = await (async () => {
45- try {
46- return (await import('node:crypto')).randomBytes;
47- }
48- catch {
49- return nodejsMathRandomBytes;
50- }
51- })();` ;
52-
5333/** @type {import('rollup').RollupOptions } */
5434const config = [
5535 {
@@ -65,7 +45,7 @@ const config = [
6545 {
6646 file : 'lib/bson.bundle.js' ,
6747 format : 'iife' ,
68- name : defaultName ,
48+ name : 'BSON' ,
6949 exports : 'named' ,
7050 indent : false ,
7151 sourcemap : true
You can’t perform that action at this time.
0 commit comments