Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(saslprep): skip codepoint generation in CI #188

Merged
merged 4 commits into from
Dec 27, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix windows
baileympearson committed Dec 27, 2023
commit e66780162b40b7f717ef62454503883511df0cd0
2 changes: 1 addition & 1 deletion packages/saslprep/package.json
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@
"bootstrap": "npm run compile",
"prepublishOnly": "npm run compile",
"//": "TODO(COMPASS-7555): fix codepoint generation",
"compile": "SKIP_GENERATE_CODEPOINTS=true npm run gen-code-points && tsc -p tsconfig.json && gen-esm-wrapper . ./dist/.esm-wrapper.mjs",
"compile": "npm run gen-code-points && tsc -p tsconfig.json && gen-esm-wrapper . ./dist/.esm-wrapper.mjs",
"typecheck": "tsc --noEmit",
"eslint": "eslint",
"prettier": "prettier",
12 changes: 6 additions & 6 deletions packages/saslprep/src/generate-code-points.ts
Original file line number Diff line number Diff line change
@@ -3,6 +3,11 @@ import bitfield from 'sparse-bitfield';
import * as codePoints from './code-points-src';
import { createWriteStream } from 'fs';

if (!process.env.GENERATE_CODE_POINTS) {
process.exitCode = 0;
process.exit();
}

const unassigned_code_points = bitfield();
const commonly_mapped_to_nothing = bitfield();
const non_ascii_space_characters = bitfield();
@@ -41,12 +46,7 @@ memory.push(
traverse(bidirectional_l, codePoints.bidirectional_l)
);

if (process.env.SKIP_GENERATE_CODEPOINTS) {
process.exitCode = 0;
process.exit();
}

const fsStream = createWriteStream(process.argv[1]);
const fsStream = createWriteStream(process.argv[2]);
fsStream.write(
`import { gunzipSync } from 'zlib';