From c29f69bfd842e6009861ddf8d2e5542797e83423 Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Wed, 27 Dec 2023 12:40:19 -0700 Subject: [PATCH] chore(saslprep): skip codepoint generation in CI (#188) --- packages/saslprep/package.json | 2 +- packages/saslprep/src/generate-code-points.ts | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/saslprep/package.json b/packages/saslprep/package.json index 6952bb1f..c5c5af56 100644 --- a/packages/saslprep/package.json +++ b/packages/saslprep/package.json @@ -39,7 +39,7 @@ }, "types": "./dist/index.d.ts", "scripts": { - "gen-code-points": "ts-node src/generate-code-points.ts > src/code-points-data.ts", + "gen-code-points": "ts-node src/generate-code-points.ts src/code-points-data.ts", "bootstrap": "npm run compile", "prepublishOnly": "npm run compile", "compile": "npm run gen-code-points && tsc -p tsconfig.json && gen-esm-wrapper . ./dist/.esm-wrapper.mjs", diff --git a/packages/saslprep/src/generate-code-points.ts b/packages/saslprep/src/generate-code-points.ts index acfc1b62..550dd012 100644 --- a/packages/saslprep/src/generate-code-points.ts +++ b/packages/saslprep/src/generate-code-points.ts @@ -1,6 +1,13 @@ import { gzipSync } from 'zlib'; import bitfield from 'sparse-bitfield'; import * as codePoints from './code-points-src'; +import { createWriteStream } from 'fs'; + +if (!process.env.GENERATE_CODE_POINTS) { + // TODO(COMPASS-7555): fix codepoint generation= + process.exitCode = 0; + process.exit(); +} const unassigned_code_points = bitfield(); const commonly_mapped_to_nothing = bitfield(); @@ -40,7 +47,8 @@ memory.push( traverse(bidirectional_l, codePoints.bidirectional_l) ); -process.stdout.write( +const fsStream = createWriteStream(process.argv[2]); +fsStream.write( `import { gunzipSync } from 'zlib'; export default gunzipSync(