-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v2' into nickersoft/lazy
- Loading branch information
Showing
26 changed files
with
621 additions
and
584 deletions.
There are no files selected for viewing
This file contains 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,3 +1,5 @@ | ||
[target.aarch64-unknown-linux-musl] | ||
linker = "aarch64-linux-musl-gcc" | ||
rustflags = ["-C", "target-feature=-crt-static"] | ||
[target.x86_64-pc-windows-msvc] | ||
rustflags = ["-C", "target-feature=+crt-static"] | ||
|
||
[target.i686-pc-windows-msvc] | ||
rustflags = ["-C", "target-feature=+crt-static"] |
This file contains 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 |
---|---|---|
|
@@ -56,10 +56,7 @@ jobs: | |
build: pnpm --filter "@odict/node" build --target aarch64-unknown-linux-musl -x | ||
- host: windows-latest | ||
target: aarch64-pc-windows-msvc | ||
build: pnpm --filter "@odict/node" build --target aarch64-pc-windows-msvc | ||
- host: ubuntu-latest | ||
target: wasm32-wasip1-threads | ||
build: pnpm --filter "@odict/node" build --target wasm32-wasip1-threads | ||
build: pnpm --filter "@odict/node" build --target aarch64-pc-windows-msvc | ||
name: stable - ${{ matrix.settings.target }} - node@20 | ||
runs-on: ${{ matrix.settings.host }} | ||
steps: | ||
|
@@ -116,19 +113,11 @@ jobs: | |
shell: bash | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
if: matrix.settings.target != 'wasm32-wasip1-threads' | ||
with: | ||
name: bindings-${{ matrix.settings.target }} | ||
path: 'bindings/node/*.node' | ||
path: bindings/node/*.node | ||
if-no-files-found: error | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
if: matrix.settings.target == 'wasm32-wasip1-threads' | ||
with: | ||
name: bindings-${{ matrix.settings.target }} | ||
path: '*.wasm' | ||
if-no-files-found: error | ||
build-freebsd: | ||
runs-on: ubuntu-latest | ||
name: Build FreeBSD | ||
|
@@ -174,7 +163,7 @@ jobs: | |
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bindings-freebsd | ||
path: bindings/node/${{ env.APP_NAME }}.*.node | ||
path: bindings/node/*.node | ||
if-no-files-found: error | ||
test-macOS-windows-binding: | ||
name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }} | ||
|
@@ -213,7 +202,7 @@ jobs: | |
uses: actions/download-artifact@v4 | ||
with: | ||
name: bindings-${{ matrix.settings.target }} | ||
path: . | ||
path: bindings/node | ||
- name: List packages | ||
run: ls -R . | ||
shell: bash | ||
|
@@ -272,7 +261,7 @@ jobs: | |
uses: actions/download-artifact@v4 | ||
with: | ||
name: bindings-${{ matrix.target }} | ||
path: . | ||
path: bindings/node | ||
- name: List packages | ||
run: ls -R . | ||
shell: bash | ||
|
@@ -286,43 +275,14 @@ jobs: | |
with: | ||
image: ${{ steps.docker.outputs.IMAGE }} | ||
options: -v ${{ steps.docker.outputs.PNPM_STORE_PATH }}:${{ steps.docker.outputs.PNPM_STORE_PATH }} -v ${{ github.workspace }}:${{ github.workspace }} -w ${{ github.workspace }} --platform ${{ steps.docker.outputs.PLATFORM }} | ||
run: npm run test | ||
test-wasi: | ||
name: Test WASI target | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: setup pnpm | ||
uses: pnpm/action-setup@v4 | ||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: pnpm | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: bindings-wasm32-wasip1-threads | ||
path: . | ||
- name: List packages | ||
run: ls -R . | ||
shell: bash | ||
- name: Test bindings | ||
run: pnpm --filter "@odict/node" test | ||
env: | ||
NAPI_RS_FORCE_WASI: 1 | ||
run: cd bindings/node && npm run test | ||
publish: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build-freebsd | ||
- test-macOS-windows-binding | ||
- test-linux-binding | ||
- test-wasi | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: setup pnpm | ||
|
@@ -337,25 +297,32 @@ jobs: | |
- name: Download all artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifacts | ||
path: bindings/node/artifacts | ||
- name: create npm dirs | ||
run: pnpm napi create-npm-dirs | ||
run: pnpm --filter="@odict/node" create-dirs | ||
- name: Move artifacts | ||
run: pnpm artifacts | ||
run: pnpm --filter="@odict/node" artifacts | ||
- name: List packages | ||
run: ls -R ./npm | ||
run: ls -R ./bindings/node/npm | ||
shell: bash | ||
- uses: olegtarasov/[email protected] | ||
id: tagName | ||
with: | ||
tagRegex: "node-(.*)" | ||
- name: Print tag name | ||
run: echo $GIT_TAG_NAME | ||
- name: Publish | ||
shell: bash | ||
run: | | ||
npm config set provenance true | ||
if git log -1 --pretty=%B | grep "^v\?[0-9]\+\.[0-9]\+\.[0-9]\+$"; | ||
if [[ $GIT_TAG_NAME =~ "^v?[0-9]+.[0-9]+.[0-9]+$" ]]; | ||
then | ||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc | ||
npm publish --access public | ||
elif git log -1 --pretty=%B | grep "^v\?[0-9]\+\.[0-9]\+\.[0-9]\+"; | ||
pnpm --filter="@odict/node" publish --no-git-checks --access public | ||
elif [[ $GIT_TAG_NAME =~ "^v?[0-9]+.[0-9]+.[0-9]+" ]]; | ||
then | ||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc | ||
npm publish --tag next --access public | ||
pnpm --filter="@odict/node" publish --tag next --no-git-checks --access public | ||
else | ||
echo "Not a release, skipping publish" | ||
fi | ||
|
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,117 @@ | ||
/* auto-generated by NAPI-RS */ | ||
/* eslint-disable */ | ||
export declare class Dictionary { | ||
constructor( | ||
pathOrAlias: string, | ||
options?: DictionaryOptions | undefined | null, | ||
); | ||
static write( | ||
xmlStr: string, | ||
outPath: string, | ||
options?: DictionaryOptions | undefined | null, | ||
): Dictionary; | ||
static compile( | ||
xmlPath: string, | ||
outPath?: string | undefined | null, | ||
options?: DictionaryOptions | undefined | null, | ||
): Dictionary; | ||
get path(): string; | ||
lookup( | ||
query: LookupQuery | string | Array<LookupQuery | string>, | ||
options?: LookupOptions | undefined | null, | ||
): Array<Array<Entry>>; | ||
lexicon(): Array<string>; | ||
split(query: string, options?: SplitOptions | undefined | null): Array<Entry>; | ||
index(options?: IndexOptions | undefined | null): void; | ||
search( | ||
query: string, | ||
options?: SearchOptions | undefined | null, | ||
): Array<Entry>; | ||
} | ||
|
||
export declare class MdString { | ||
constructor(value: string); | ||
get value(): string; | ||
parse(strategy: MarkdownStrategy): string; | ||
} | ||
export type MDString = MdString; | ||
|
||
export interface Definition { | ||
id?: string; | ||
value: MDString; | ||
examples: Array<Example>; | ||
notes: Array<Note>; | ||
} | ||
|
||
export interface DictionaryOptions { | ||
split?: SplitOptions; | ||
index?: IndexOptions; | ||
search?: SearchOptions; | ||
} | ||
|
||
export interface Entry { | ||
term: string; | ||
seeAlso?: string; | ||
etymologies: Array<Etymology>; | ||
} | ||
|
||
export interface Etymology { | ||
id?: string; | ||
pronunciation?: string; | ||
description?: MDString; | ||
senses: Record<string, Sense>; | ||
} | ||
|
||
export interface Example { | ||
value: MDString; | ||
} | ||
|
||
export interface Group { | ||
id?: string; | ||
description: MDString; | ||
definitions: Array<Definition>; | ||
} | ||
|
||
export interface IndexOptions { | ||
directory?: string; | ||
memory?: number; | ||
overwrite?: boolean; | ||
} | ||
|
||
export interface LookupOptions { | ||
split?: number; | ||
follow?: boolean; | ||
} | ||
|
||
export interface LookupQuery { | ||
term: string; | ||
fallback: string; | ||
} | ||
|
||
export declare const enum MarkdownStrategy { | ||
Disabled = 0, | ||
HTML = 1, | ||
Text = 2, | ||
} | ||
|
||
export interface Note { | ||
id?: string; | ||
value: MdString; | ||
examples: Array<Example>; | ||
} | ||
|
||
export interface SearchOptions { | ||
directory?: string; | ||
threshold?: number; | ||
autoindex?: boolean; | ||
limit?: number; | ||
} | ||
|
||
export interface Sense { | ||
pos: string; | ||
definitions: Array<Definition | Group>; | ||
} | ||
|
||
export interface SplitOptions { | ||
threshold?: number; | ||
} |
Oops, something went wrong.