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

dev: move async to cspell-pipe #2364

Merged
merged 1 commit into from
Jan 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions cspell.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
{
"path": "packages/cspell-lib"
},
{
"path": "packages/cspell-pipe"
},
{
"path": "packages/cspell-tools"
},
Expand Down
44 changes: 41 additions & 3 deletions packages/cspell-pipe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,49 @@
"dist": "dist"
},
"exports": {
".": "./cspell-ext.json",
"./cspell": "./cspell-ext.json",
"./cspell-ext.json": "./cspell-ext.json"
".": {
"require": "./dist/index.js"
},
"./*": {
"require": "./dist/*.js"
},
"./index": "./dist/index.js",
"./index.js": "./dist/index.js",
"./index.d.ts": "./dist/index.d.ts",
"./operators": {
"require": "./dist/operators/index.js"
},
"./operators/index.js": {
"require": "./dist/operators/index.js"
},
"./operators/index.d.ts": {
"require": "./dist/operators/index.js"
}
},
"typings": "dist/index.d.ts",
"typesVersions": {
"*": {
"index.d.ts": [
"dist/index.d.ts"
],
"dist/index.d.ts": [
"dist/index.d.ts"
],
"operators": [
"dist/operators/index.d.ts"
],
"operators/*.js": [
"dist/operators/*.d.ts"
],
"operators/index.d.ts": [
"dist/operators/index.d.ts"
],
"*": [
"dist/*",
"dist/*/index.d.ts"
]
}
},
"files": [
"dist",
"!**/__mocks__",
Expand Down
9 changes: 9 additions & 0 deletions packages/cspell-pipe/src/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
exports[`Pipe API pipe api 1`] = `
Array [
"helpers",
"isAsyncIterable",
"opAwaitAsync",
"opFilter",
"opFlatten",
"opJoinStrings",
"opMap",
"opUnique",
"operators",
"pipeAsync",
"pipeSync",
"toArray",
"toAsyncIterable",
]
`;
2 changes: 2 additions & 0 deletions packages/cspell-pipe/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as _helpers from './helpers';
import * as _operators from './operators';

export { isAsyncIterable, toArray, toAsyncIterable } from './helpers';
export { opAwaitAsync, opFilter, opFlatten, opJoinStrings, opMap, opUnique } from './operators';
export { pipeAsync, pipeSync } from './pipe';

export const operators = _operators;
Expand Down
2 changes: 1 addition & 1 deletion packages/cspell-pipe/src/operators/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { opAwaitAsync } from './await';
export { opFilter, opFilterAsync, opFilterSync } from './filter';
export { opFilter as opFilter, opFilterAsync, opFilterSync } from './filter';
export { opFlatten, opFlattenAsync, opFlattenSync } from './flatten';
export { opJoinStrings, opJoinStringsAsync, opJoinStringsSync } from './joinStrings';
export { opMap, opMapAsync, opMapSync } from './map';
Expand Down
14 changes: 14 additions & 0 deletions packages/cspell-trie-lib/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/cspell-trie-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
},
"homepage": "https://github.com/streetsidesoftware/cspell#readme",
"dependencies": {
"@cspell/cspell-pipe": "^5.17.0",
"fs-extra": "^10.0.0",
"gensequence": "^3.1.1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Array [
"Trie",
"TrieBuilder",
"WORD_SEPARATOR",
"_pipe",
"buildTrie",
"buildTrieFast",
"consolidate",
Expand Down
3 changes: 0 additions & 3 deletions packages/cspell-trie-lib/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
import * as pipe from './pipe';
export * from './lib';

export const _pipe = pipe;
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { pipeSync } from '../../pipe';
import { opFlatten, opMap } from '../../pipe/operators';
import { opFlatten, opMap, pipeSync } from '@cspell/cspell-pipe';
import type { CharacterSetCosts, DictionaryInformation } from '../models/DictionaryInformation';
import { parseLocale } from '../models/locale';
import type { SuggestionCostMapDef } from '../models/suggestionCostsDef';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { pipeSync as pipe } from '../../pipe';
import { opFilter, opFlatten, opMap } from '../../pipe/operators';
import { opFilter, opFlatten, opMap, pipeSync as pipe } from '@cspell/cspell-pipe';
import type { HunspellCosts, HunspellInformation } from '../models/DictionaryInformation';
import { Locale } from '../models/locale';
import type { SuggestionCostMapDef } from '../models/suggestionCostsDef';
import { caseForms } from '../utils/text';
import { isDefined, unique as uniqueU } from '../utils/util';
import { mapHunspellCosts } from './mapCosts';
import {
calcFirstCharacterReplace,
calcCostsForAccentedLetters,
calcFirstCharacterReplace,
parseAlphabet,
splitMap,
} from './mapToSuggestionCostDef';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { opFilter, opFlatten, opMap, opUnique, pipeSync as pipe } from '@cspell/cspell-pipe';
import { map } from 'gensequence/dist/operators';
import { pipeSync as pipe } from '../../pipe';
import { opFilter, opFlatten, opMap, opUnique } from '../../pipe/operators';
import type { CharacterSetCosts } from '../models/DictionaryInformation';
import type { SuggestionCostMapDef } from '../models/suggestionCostsDef';
import { accentForms, caseForms, expandCharacterSet, stripAccents, stripNonAccents } from '../utils/text';
Expand Down
10 changes: 0 additions & 10 deletions packages/cspell-trie-lib/src/pipe/__snapshots__/index.test.ts.snap

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions packages/cspell-trie-lib/src/pipe/helpers/index.test.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/cspell-trie-lib/src/pipe/helpers/index.ts

This file was deleted.

20 changes: 0 additions & 20 deletions packages/cspell-trie-lib/src/pipe/helpers/toArray.ts

This file was deleted.

26 changes: 0 additions & 26 deletions packages/cspell-trie-lib/src/pipe/helpers/toAsyncIterable.ts

This file was deleted.

14 changes: 0 additions & 14 deletions packages/cspell-trie-lib/src/pipe/helpers/util.ts

This file was deleted.

7 changes: 0 additions & 7 deletions packages/cspell-trie-lib/src/pipe/index.test.ts

This file was deleted.

7 changes: 0 additions & 7 deletions packages/cspell-trie-lib/src/pipe/index.ts

This file was deleted.

35 changes: 0 additions & 35 deletions packages/cspell-trie-lib/src/pipe/internalTypes.ts

This file was deleted.

This file was deleted.

23 changes: 0 additions & 23 deletions packages/cspell-trie-lib/src/pipe/operators/await.test.ts

This file was deleted.

9 changes: 0 additions & 9 deletions packages/cspell-trie-lib/src/pipe/operators/await.ts

This file was deleted.

Loading