@digigov/text-search 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/.eslintrc.js +3 -0
  2. package/.prettierrc.js +3 -0
  3. package/.rush/temp/operation/build/state.json +3 -0
  4. package/.rush/temp/package-deps_build.json +25 -0
  5. package/.rush/temp/package-deps_publint.json +25 -0
  6. package/.rush/temp/shrinkwrap-deps.json +158 -0
  7. package/CHANGELOG.json +79 -0
  8. package/CHANGELOG.md +8 -1
  9. package/dist/CHANGELOG.md +27 -0
  10. package/dist/README.md +70 -0
  11. package/{index.js → dist/index.js} +1 -1
  12. package/dist/package.json +21 -0
  13. package/dist/src/hook.spec.ts +289 -0
  14. package/dist/src/hook.ts +50 -0
  15. package/dist/src/index.ts +4 -0
  16. package/dist/src/search/__tests__/utils.spec.ts +73 -0
  17. package/dist/src/search/index.ts +3 -0
  18. package/dist/src/search/lang/gr/encoder.ts +27 -0
  19. package/dist/src/search/lang/gr/normalization-map.ts +100 -0
  20. package/dist/src/search/search-index.ts +103 -0
  21. package/dist/src/search/utils.ts +72 -0
  22. package/dist/src/types.ts +65 -0
  23. package/dist/test-utils/data.json +552 -0
  24. package/package.json +28 -6
  25. package/src/search/lang/gr/encoder.ts +1 -1
  26. package/text-search.build.log +13 -0
  27. package/text-search.publint.log +15 -0
  28. package/tsconfig.json +44 -0
  29. /package/{LICENSE → dist/LICENSE} +0 -0
  30. /package/{cjs → dist/cjs}/hook/index.js +0 -0
  31. /package/{cjs → dist/cjs}/hook.spec/index.js +0 -0
  32. /package/{cjs → dist/cjs}/index.js +0 -0
  33. /package/{cjs → dist/cjs}/search/__tests__/utils.spec/index.js +0 -0
  34. /package/{cjs → dist/cjs}/search/index.js +0 -0
  35. /package/{cjs → dist/cjs}/search/lang/gr/encoder/index.js +0 -0
  36. /package/{cjs → dist/cjs}/search/lang/gr/normalization-map/index.js +0 -0
  37. /package/{cjs → dist/cjs}/search/search-index/index.js +0 -0
  38. /package/{cjs → dist/cjs}/search/utils/index.js +0 -0
  39. /package/{cjs → dist/cjs}/test-utils/data.json +0 -0
  40. /package/{cjs → dist/cjs}/types/index.js +0 -0
  41. /package/{hook → dist/hook}/index.js +0 -0
  42. /package/{hook → dist/hook}/package.json +0 -0
  43. /package/{hook.d.ts → dist/hook.d.ts} +0 -0
  44. /package/{hook.spec → dist/hook.spec}/index.js +0 -0
  45. /package/{hook.spec → dist/hook.spec}/package.json +0 -0
  46. /package/{hook.spec.d.ts → dist/hook.spec.d.ts} +0 -0
  47. /package/{index.d.ts → dist/index.d.ts} +0 -0
  48. /package/{search → dist/search}/__tests__/utils.spec/index.js +0 -0
  49. /package/{search → dist/search}/__tests__/utils.spec/package.json +0 -0
  50. /package/{search → dist/search}/__tests__/utils.spec.d.ts +0 -0
  51. /package/{search → dist/search}/index.d.ts +0 -0
  52. /package/{search → dist/search}/index.js +0 -0
  53. /package/{search → dist/search}/lang/gr/encoder/index.js +0 -0
  54. /package/{search → dist/search}/lang/gr/encoder/package.json +0 -0
  55. /package/{search → dist/search}/lang/gr/encoder.d.ts +0 -0
  56. /package/{search → dist/search}/lang/gr/normalization-map/index.js +0 -0
  57. /package/{search → dist/search}/lang/gr/normalization-map/package.json +0 -0
  58. /package/{search → dist/search}/lang/gr/normalization-map.d.ts +0 -0
  59. /package/{search → dist/search}/package.json +0 -0
  60. /package/{search → dist/search}/search-index/index.js +0 -0
  61. /package/{search → dist/search}/search-index/package.json +0 -0
  62. /package/{search → dist/search}/search-index.d.ts +0 -0
  63. /package/{search → dist/search}/utils/index.js +0 -0
  64. /package/{search → dist/search}/utils/package.json +0 -0
  65. /package/{search → dist/search}/utils.d.ts +0 -0
  66. /package/{test-utils → dist/src/test-utils}/data.json +0 -0
  67. /package/{types → dist/types}/index.js +0 -0
  68. /package/{types → dist/types}/package.json +0 -0
  69. /package/{types.d.ts → dist/types.d.ts} +0 -0
package/package.json CHANGED
@@ -1,21 +1,43 @@
1
1
  {
2
2
  "name": "@digigov/text-search",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "description": "@digigov text-search",
5
5
  "author": "GRNET Developers <devs@lists.grnet.gr>",
6
6
  "license": "BSD-2-Clause",
7
- "main": "./cjs/index.js",
8
- "module": "./index.js",
7
+ "main": "dist/index.js",
8
+ "module": "src/index.ts",
9
9
  "private": false,
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
13
+ "scripts": {
14
+ "publint": "publint dist",
15
+ "lint": "digigov lint",
16
+ "test": "digigov test",
17
+ "build": "digigov build --subpackages"
18
+ },
19
+ "devDependencies": {
20
+ "@digigov/cli": "1.1.0",
21
+ "@digigov/cli-lint": "1.0.2",
22
+ "@digigov/cli-build": "1.1.0",
23
+ "@digigov/cli-test": "1.1.0",
24
+ "@testing-library/react-hooks": "3.4.2",
25
+ "@types/node": "18.19.0",
26
+ "@types/react": "16.9.56",
27
+ "@types/react-dom": "16.9.9",
28
+ "@types/jest": "26.0.15",
29
+ "publint": "0.1.8",
30
+ "eslint": "7.24.0",
31
+ "prettier": "2.2.1",
32
+ "typescript": "5.3.2",
33
+ "@types/flexsearch": "0.7.4",
34
+ "@types/testing-library__react-hooks": "3.4.1"
35
+ },
13
36
  "dependencies": {
14
37
  "flexsearch": "0.7.31"
15
38
  },
16
39
  "peerDependencies": {
17
40
  "react": "^16.8.0 || ^17.0.0",
18
41
  "react-dom": "^16.8.0 || ^17.0.0"
19
- },
20
- "typings": "./index.d.ts"
21
- }
42
+ }
43
+ }
@@ -22,6 +22,6 @@ export function encodeGreek(str: string) {
22
22
  .toLowerCase()
23
23
  .normalize('NFD')
24
24
  .replace(diacriticsRegex, '')
25
- .replace(greekCharsRegex, (match) => greekToGreeklishMap[match])
25
+ .replace(greekCharsRegex, (match) => (greekToGreeklishMap as any)[match])
26
26
  .split(whitespaceRegex);
27
27
  }
@@ -0,0 +1,13 @@
1
+ Invoking: digigov build --subpackages
2
+ Running /Users/dimitristsironis/grnet/digigov-sdk/tooling/cli-build/node_modules/.bin/rimraf dist
3
+ Running /Users/dimitristsironis/grnet/digigov-sdk/libs/text-search/node_modules/.bin/tsc --emitDeclarationOnly --outDir dist
4
+ Running /Users/dimitristsironis/grnet/digigov-sdk/tooling/cli-build/node_modules/.bin/babel --config-file /Users/dimitristsironis/grnet/digigov-sdk/tooling/cli-build/babel.config.js src --extensions .tsx,.ts,.js,.jsx --copy-files --out-dir dist
5
+ Successfully compiled 10 files with Babel (1735ms).
6
+ Running /Users/dimitristsironis/grnet/digigov-sdk/tooling/cli-build/node_modules/.bin/babel --config-file /Users/dimitristsironis/grnet/digigov-sdk/tooling/cli-build/babel.config.js src --extensions .tsx,.ts,.js,.jsx --copy-files --out-dir dist/cjs
7
+ Successfully compiled 10 files with Babel (1481ms).
8
+ Created package.json in /Users/dimitristsironis/grnet/digigov-sdk/libs/text-search/dist/package.json
9
+ Copied /Users/dimitristsironis/grnet/digigov-sdk/libs/text-search/CHANGELOG.md to /Users/dimitristsironis/grnet/digigov-sdk/libs/text-search/dist/CHANGELOG.md
10
+ Copied /Users/dimitristsironis/grnet/digigov-sdk/LICENSE to /Users/dimitristsironis/grnet/digigov-sdk/libs/text-search/dist/LICENSE
11
+ Copied /Users/dimitristsironis/grnet/digigov-sdk/libs/text-search/README.md to /Users/dimitristsironis/grnet/digigov-sdk/libs/text-search/dist/README.md
12
+ Copied /Users/dimitristsironis/grnet/digigov-sdk/libs/text-search/src to /Users/dimitristsironis/grnet/digigov-sdk/libs/text-search/dist/src
13
+ Skipped license for ./index.mjs
@@ -0,0 +1,15 @@
1
+ Invoking: publint dist
2
+ @digigov/text-search lint results:
3
+ Suggestions:
4
+ 1. pkg.module is used to output ESM, but pkg.exports is not defined. As NodeJS doesn't read pkg.module, the ESM output may be skipped. Consider adding pkg.exports to export the ESM output. pkg.module can usually be removed alongside too. (This will be a breaking change)
5
+ Warnings:
6
+ 1. /index.js is written in ESM, but is interpreted as CJS. Consider using the .mjs extension, e.g. /index.mjs
7
+ 2. /search/__tests__/utils.spec/index.js is written in ESM, but is interpreted as CJS. Consider using the .mjs extension, e.g. /search/__tests__/utils.spec/index.mjs
8
+ 3. /hook/index.js is written in ESM, but is interpreted as CJS. Consider using the .mjs extension, e.g. /hook/index.mjs
9
+ 4. /search/lang/gr/encoder/index.js is written in ESM, but is interpreted as CJS. Consider using the .mjs extension, e.g. /search/lang/gr/encoder/index.mjs
10
+ 5. /hook.spec/index.js is written in ESM, but is interpreted as CJS. Consider using the .mjs extension, e.g. /hook.spec/index.mjs
11
+ 6. /search/utils/index.js is written in ESM, but is interpreted as CJS. Consider using the .mjs extension, e.g. /search/utils/index.mjs
12
+ 7. /types/index.js is written in ESM, but is interpreted as CJS. Consider using the .mjs extension, e.g. /types/index.mjs
13
+ 8. /search/lang/gr/normalization-map/index.js is written in ESM, but is interpreted as CJS. Consider using the .mjs extension, e.g. /search/lang/gr/normalization-map/index.mjs
14
+ 9. /search/index.js is written in ESM, but is interpreted as CJS. Consider using the .mjs extension, e.g. /search/index.mjs
15
+ 10. /search/search-index/index.js is written in ESM, but is interpreted as CJS. Consider using the .mjs extension, e.g. /search/search-index/index.mjs
package/tsconfig.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "extends": "@digigov/cli-build/tsconfig.base",
3
+ "compilerOptions": {
4
+ "outDir": "dist",
5
+ "strict": true,
6
+ "noImplicitAny": true,
7
+ "strictFunctionTypes": true,
8
+ "strictBindCallApply": true,
9
+ "strictPropertyInitialization": true,
10
+ "alwaysStrict": true,
11
+ "noImplicitReturns": true,
12
+ "noFallthroughCasesInSwitch": true,
13
+ "noUncheckedIndexedAccess": true,
14
+ "noPropertyAccessFromIndexSignature": true,
15
+ "paths": {
16
+ "flexsearch": [
17
+ "node_modules/@types/flexsearch"
18
+ ],
19
+ "@digigov/text-search": [
20
+ "./src"
21
+ ],
22
+ "@digigov/text-search/": [
23
+ "./src/"
24
+ ],
25
+ "@digigov/text-search/*": [
26
+ "./src/*"
27
+ ]
28
+ },
29
+ "types": [
30
+ "node",
31
+ "jest",
32
+ "flexsearch"
33
+ ],
34
+ "esModuleInterop": true,
35
+ "baseUrl": "./"
36
+ },
37
+ "include": [
38
+ "./src"
39
+ ],
40
+ "exclude": [
41
+ "node_modules",
42
+ "dist"
43
+ ]
44
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes