Skip to content

Commit

Permalink
feat: 🎸 bring back ESM builds
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Nov 12, 2024
1 parent 67a25ca commit a0dc6a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@
},
"files": [
"LICENSE",
"lib/"
"bin/",
"lib/",
"esm/"
],
"scripts": {
"format": "biome format ./src",
Expand All @@ -82,7 +84,8 @@
"lint:fix": "biome lint --apply ./src",
"clean": "npx [email protected] lib es6 es2019 es2020 esm typedocs coverage gh-pages yarn-error.log src/**/__bench__/node_modules src/**/__bench__/yarn-error.log",
"build:es2020": "tsc --project tsconfig.build.json --module commonjs --target es2020 --outDir lib",
"build:all": "npx [email protected] \"yarn build:es2020\"",
"build:esm": "tsc --project tsconfig.build.json --module ESNext --target ESNEXT --outDir esm",
"build:all": "npx [email protected] \"yarn build:es2020\" \"yarn build:esm\"",
"build": "yarn build:es2020",
"jest": "jest",
"test": "jest --maxWorkers 7",
Expand Down
4 changes: 3 additions & 1 deletion src/json-crdt-peritext-ui/dom/CursorController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ export interface CursorControllerOpts {
export class CursorController implements UiLifeCycles, Printable {
public readonly caretId: string;

private readonly _cursor: [fn: PeritextEventTarget['cursor'], stop: () => void];

public constructor(public readonly opts: CursorControllerOpts) {
this.caretId = 'jsonjoy.com-peritext-caret-' + opts.et.id;
this._cursor = throttle(opts.et.cursor.bind(opts.et), 25)
}

/** The position where user started to scrub the text. */
protected selAnchor: number = -1;

private readonly _cursor = throttle(this.opts.et.cursor.bind(this.opts.et), 25);

/**
* String position at coordinate, or -1, if unknown.
Expand Down

0 comments on commit a0dc6a2

Please sign in to comment.