Skip to content

Commit 712c73f

Browse files
committed
Added a new import style for the main object.
1 parent 56c4e04 commit 712c73f

30 files changed

Lines changed: 49 additions & 31 deletions

.clinerules

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ node-re2 provides Node.js bindings for RE2: a fast, safe alternative to backtrac
3636

3737
## Verification commands
3838

39-
- `npm test` — run the full test suite (parallel workers)
39+
- `npm test` — run the full test suite (worker threads)
4040
- `node tests/test-<name>.mjs` — run a single test file directly
4141
- `npm run test:seq` — run sequentially
42+
- `npm run test:proc` — run multi-process
4243
- `npm run ts-check` — TypeScript type checking
4344
- `npm run lint` — Prettier check
4445
- `npm run lint:fix` — Prettier write

.cursorrules

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ node-re2 provides Node.js bindings for RE2: a fast, safe alternative to backtrac
3636

3737
## Verification commands
3838

39-
- `npm test` — run the full test suite (parallel workers)
39+
- `npm test` — run the full test suite (worker threads)
4040
- `node tests/test-<name>.mjs` — run a single test file directly
4141
- `npm run test:seq` — run sequentially
42+
- `npm run test:proc` — run multi-process
4243
- `npm run ts-check` — TypeScript type checking
4344
- `npm run lint` — Prettier check
4445
- `npm run lint:fix` — Prettier write

.windsurf/skills/write-tests/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Write or update tests using the tape-six testing library.
1414
3. Check existing tests in `tests/` for node-re2 conventions and patterns.
1515
4. Create or update the test file in `tests/`:
1616
- For runtime tests use `.mjs`.
17-
- Import RE2 with: `import {default as RE2} from '../re2.js';`
17+
- Import RE2 with: `import {RE2} from '../re2.js';`
1818
- Import tape-six with: `import test from 'tape-six';`
1919
- Test with both **string** and **Buffer** inputs — Buffer support is a first-class feature.
2020
- Test edge cases: empty strings, no match, global flag behavior, lastIndex, Unicode input.

.windsurf/workflows/add-module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Follow these steps when adding a new method, feature, or C++ implementation.
2323
7. Update `re2.d.ts` with TypeScript declarations for the new method.
2424
- Keep `re2.js` and `re2.d.ts` in sync.
2525
8. Create `tests/test-foo.mjs` with automated tests (tape-six, ESM):
26-
- `import {default as RE2} from '../re2.js';`
26+
- `import {RE2} from '../re2.js';`
2727
- Test with strings and Buffers.
2828
- Test edge cases (empty input, no match, global flag, etc.).
2929
// turbo

.windsurfrules

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ node-re2 provides Node.js bindings for RE2: a fast, safe alternative to backtrac
3636

3737
## Verification commands
3838

39-
- `npm test` — run the full test suite (parallel workers)
39+
- `npm test` — run the full test suite (worker threads)
4040
- `node tests/test-<name>.mjs` — run a single test file directly
4141
- `npm run test:seq` — run sequentially
42+
- `npm run test:proc` — run multi-process
4243
- `npm run ts-check` — TypeScript type checking
4344
- `npm run lint` — Prettier check
4445
- `npm run lint:fix` — Prettier write

AGENTS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ If the native addon fails to download a prebuilt artifact, it builds locally via
2222
- **Install:** `npm install` (downloads prebuilt artifact or builds from source)
2323
- **Build (release):** `npm run rebuild` (or `node-gyp -j max rebuild`)
2424
- **Build (debug):** `npm run rebuild:dev` (or `node-gyp -j max rebuild --debug`)
25-
- **Test:** `npm test` (runs `tape6-proc --flags FO`)
25+
- **Test:** `npm test` (runs `tape6 --flags FO`, worker threads)
2626
- **Test (sequential):** `npm run test:seq`
27+
- **Test (multi-process):** `npm run test:proc`
2728
- **Test (single file):** `node tests/test-<name>.mjs`
2829
- **TypeScript check:** `npm run ts-check`
2930
- **Lint:** `npm run lint` (Prettier check)
@@ -103,7 +104,7 @@ node-re2/
103104

104105
```js
105106
import test from 'tape-six';
106-
import {default as RE2} from '../re2.js';
107+
import {RE2} from '../re2.js';
107108

108109
test('example', t => {
109110
const re = new RE2('a(b*)', 'i');

ARCHITECTURE.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,10 @@ re2.js ──→ build/Release/re2.node (compiled C++ addon)
129129

130130
## Testing
131131

132-
- **Framework**: tape-six (`tape6-proc`)
133-
- **Run all**: `npm test` (parallel workers via `tape6-proc --flags FO`)
132+
- **Framework**: tape-six (`tape6`)
133+
- **Run all**: `npm test` (worker threads via `tape6 --flags FO`)
134134
- **Run sequential**: `npm run test:seq`
135+
- **Run multi-process**: `npm run test:proc`
135136
- **Run single file**: `node tests/test-<name>.mjs`
136137
- **TypeScript check**: `npm run ts-check`
137138
- **Lint**: `npm run lint` (Prettier check)
@@ -145,5 +146,5 @@ re2.js ──→ build/Release/re2.node (compiled C++ addon)
145146
const RE2 = require('re2');
146147

147148
// ESM (tests)
148-
import {default as RE2} from '../re2.js';
149+
import {RE2} from '../re2.js';
149150
```

bench/bad-pattern.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {default as RE2} from '../re2.js';
1+
import {RE2} from '../re2.js';
22

33
const BAD_PATTERN = '([a-z]+)+$';
44
const BAD_INPUT = 'a'.repeat(10) + '!';

bench/set-match.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {default as RE2} from '../re2.js';
1+
import {RE2} from '../re2.js';
22

33
const PATTERN_COUNT = 200;
44

llms-full.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ console.log(result[1]); // "Bb"
4343
const RE2 = require('re2');
4444

4545
// ESM
46-
import RE2 from 're2';
47-
// or
48-
import {default as RE2} from 're2';
46+
import { RE2 } from 're2';
4947
```
5048

5149
## Construction

0 commit comments

Comments
 (0)