-
Notifications
You must be signed in to change notification settings - Fork 3
feat/migrate to esm only with shared tsconfig #21
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4b9bf57
chore: add vitest.config.ts with snapshotFormat
lpatiny e7b3c9d
chore: migrate typedoc workflow to shared reusable workflow
lpatiny 12c861c
chore: ignore .claude in .gitignore
lpatiny a841ed3
test: flatten tests to top-level test() calls
lpatiny 290e40c
feat!: migrate package to ESM TypeScript
lpatiny f748ae3
chore: address feedback
lpatiny 2765234
chore: fix typescript
lpatiny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,15 @@ | ||
| name: Deploy TypeDoc on GitHub pages | ||
| name: TypeDoc | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| release: | ||
| types: [published] | ||
|
|
||
| env: | ||
| NODE_VERSION: 20.x | ||
| ENTRY_FILE: 'src/index.ts' | ||
|
|
||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: actions/setup-node@v3 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| - name: Install dependencies | ||
| run: npm install | ||
| - name: Build documentation | ||
| uses: zakodium/typedoc-action@v2 | ||
| with: | ||
| entry: ${{ env.ENTRY_FILE }} | ||
| - name: Deploy to GitHub pages | ||
| uses: JamesIves/github-pages-deploy-action@releases/v4 | ||
| with: | ||
| token: ${{ secrets.BOT_TOKEN }} | ||
| branch: gh-pages | ||
| folder: docs | ||
| clean: true | ||
| typedoc: | ||
| # Documentation: https://github.com/zakodium/workflows#typedoc | ||
| uses: zakodium/workflows/.github/workflows/typedoc.yml@typedoc-v1 | ||
| with: | ||
| entry: 'src/index.ts' | ||
| secrets: | ||
| github-token: ${{ secrets.BOT_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,5 @@ jspm_packages | |
| .node_repl_history | ||
|
|
||
| lib | ||
|
|
||
| lib-esm | ||
| docs | ||
| .claude | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import { defineConfig, globalIgnores } from 'eslint/config'; | ||
| import ts from 'eslint-config-cheminfo-typescript/base'; | ||
|
|
||
| export default defineConfig(globalIgnores(['coverage', 'lib', 'lib-esm']), ts); | ||
| export default defineConfig(globalIgnores(['coverage', 'lib']), ts); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,34 +1,34 @@ | ||
| import { describe, expect, it } from 'vitest'; | ||
| import { expect, test } from 'vitest'; | ||
|
|
||
| import { checkArrayLength } from '..'; | ||
| import { checkArrayLength } from '../index.ts'; | ||
|
|
||
| describe('checkArrayLength', () => { | ||
| it('throws on different Length', () => { | ||
| const expected = /x and y arrays must have the same length/; | ||
| expect(() => checkArrayLength([], [1])).toThrow(expected); | ||
| expect(() => checkArrayLength([1], [])).toThrow(expected); | ||
| expect(() => checkArrayLength([1], [1, 2])).toThrow(expected); | ||
| }); | ||
| test('throws on different Length', () => { | ||
| const expected = /x and y arrays must have the same length/; | ||
|
|
||
| it('throws if not arrays', () => { | ||
| const expected = /x and y must be arrays/; | ||
| // @ts-expect-error testing invalid input | ||
| expect(() => checkArrayLength(null, [1])).toThrow(expected); | ||
| // @ts-expect-error testing invalid input | ||
| expect(() => checkArrayLength([], null)).toThrow(expected); | ||
| // @ts-expect-error testing invalid input | ||
| expect(() => checkArrayLength()).toThrow(expected); | ||
| // @ts-expect-error testing invalid input | ||
| expect(() => checkArrayLength(42, [])).toThrow(expected); | ||
| // @ts-expect-error testing invalid input | ||
| expect(() => checkArrayLength([1, 2, 3, 4, 5], 'hello')).toThrow(expected); | ||
| }); | ||
| expect(() => checkArrayLength([], [1])).toThrow(expected); | ||
| expect(() => checkArrayLength([1], [])).toThrow(expected); | ||
| expect(() => checkArrayLength([1], [1, 2])).toThrow(expected); | ||
| }); | ||
|
|
||
| test('throws if not arrays', () => { | ||
| const expected = /x and y must be arrays/; | ||
|
|
||
| // @ts-expect-error testing invalid input | ||
| expect(() => checkArrayLength(null, [1])).toThrow(expected); | ||
| // @ts-expect-error testing invalid input | ||
| expect(() => checkArrayLength([], null)).toThrow(expected); | ||
| // @ts-expect-error testing invalid input | ||
| expect(() => checkArrayLength()).toThrow(expected); | ||
| // @ts-expect-error testing invalid input | ||
| expect(() => checkArrayLength(42, [])).toThrow(expected); | ||
| // @ts-expect-error testing invalid input | ||
| expect(() => checkArrayLength([1, 2, 3, 4, 5], 'hello')).toThrow(expected); | ||
| }); | ||
|
|
||
| it('correct result', () => { | ||
| expect(checkArrayLength([1, 2], [2, 3])).toBeUndefined(); | ||
| expect( | ||
| checkArrayLength(new Float64Array([1, 2]), new Float64Array([2, 3])), | ||
| ).toBeUndefined(); | ||
| expect(checkArrayLength([1, 2], new Float64Array([2, 3]))).toBeUndefined(); | ||
| }); | ||
| test('correct result', () => { | ||
| expect(checkArrayLength([1, 2], [2, 3])).toBeUndefined(); | ||
| expect( | ||
| checkArrayLength(new Float64Array([1, 2]), new Float64Array([2, 3])), | ||
| ).toBeUndefined(); | ||
| expect(checkArrayLength([1, 2], new Float64Array([2, 3]))).toBeUndefined(); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.