Skip to content

Commit

Permalink
fix: imports
Browse files Browse the repository at this point in the history
  • Loading branch information
krisk committed Oct 24, 2023
1 parent d1d63a0 commit ec4e3bc
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
11 changes: 5 additions & 6 deletions docs/.vuepress/components/Demo/Demo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
import { Stopwatch } from '@sapphire/stopwatch'
import { isNullish, isObject, tryParseJSON } from '@sapphire/utilities'
import { reactive } from 'vue'
import type FuseTypes from '../../../../dist/fuse'
import Fuse from '../../../../dist/fuse.esm.js'
import Fuse, { IFuseOptions } from '../../../../dist/fuse'
import Books from './books.js'
import MonacoEditor from './MonacoEditor.vue'
Expand All @@ -62,10 +61,10 @@ interface State {
resultsData: string
count: number | null
searchTime: string | null
fuseSearchOptions: FuseTypes.IFuseOptions<never>
fuseSearchOptions: IFuseOptions<never>
}
const defaultFuseSearchOptions: FuseTypes.IFuseOptions<never> = {
const defaultFuseSearchOptions: IFuseOptions<never> = {
isCaseSensitive: false,
includeScore: false,
shouldSort: true,
Expand All @@ -83,7 +82,7 @@ const defaultFuseSearchOptions: FuseTypes.IFuseOptions<never> = {
function codify(
searchPattern: string,
fuseSearchOptions: FuseTypes.IFuseOptions<never> = defaultFuseSearchOptions
fuseSearchOptions: IFuseOptions<never> = defaultFuseSearchOptions
): string {
return `
const Fuse = require('fuse.js');
Expand Down Expand Up @@ -149,7 +148,7 @@ function onSearchPatternKeyUp() {
function doFuseSearch(fuseSearchOptions = state.fuseSearchOptions) {
try {
const fuseOptions: FuseTypes.IFuseOptions<never> = {
const fuseOptions: IFuseOptions<never> = {
keys: ['title', 'author.firstName'],
...fuseSearchOptions
}
Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/components/Jobs/Jobs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<script setup lang="ts">
import { ref } from 'vue'
import Fuse from '../../../../dist/fuse.esm.js'
import Fuse from '../../../../dist/fuse'
import jobsData from './jobs'
const results = ref(jobsData)
Expand Down
14 changes: 7 additions & 7 deletions docs/getting-started/different-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

In the [`dist/` directory of the npm package](https://cdn.jsdelivr.net/npm/fuse.js/dist/) you will find many different builds of Fuse.js. Here's an overview of the difference between them.

| | UMD | CommonJS | ES Module (for bundlers) |
| ---------------------- | ----------------- | -------------------- | ------------------------ |
| **Full** | fuse.js | fuse.common.js | fuse.esm.js |
| **Basic** | fuse.basic.js | fuse.basic.common.js | fuse.basic.esm.js |
| **Full (Production)** | fuse.min.js | - | fuse.esm.min.js |
| **Basic (Production)** | fuse.basic.min.js | - | fuse.basic.esm.min.js |
| | UMD | CommonJS | ES Module (for bundlers) |
| ---------------------- | ----------------- | -------------- | ------------------------ |
| **Full** | fuse.js | fuse.cjs | fuse.mjs |
| **Basic** | fuse.basic.js | fuse.basic.cjs | fuse.basic.mjs |
| **Full (Production)** | fuse.min.js | - | fuse.esm.min.js |
| **Basic (Production)** | fuse.basic.min.js | - | fuse.basic.esm.min.js |

### Terms

Expand All @@ -19,6 +19,6 @@ In the [`dist/` directory of the npm package](https://cdn.jsdelivr.net/npm/fuse.

- **[CommonJS](http://wiki.commonjs.org/wiki/Modules/1.1)**: CommonJS builds are intended for use with older bundlers like [browserify](http://browserify.org/) or [webpack 1](https://webpack.github.io). The file for these bundlers (`pkg.main`) is the CommonJS build (`fuse.common.js`).

- **[ES Module](http://exploringjs.com/es6/ch_modules.html)**: Intended for use with modern bundlers like [Webpack 2](https://webpack.js.org) or [Rollup](http://rollupjs.org/). The file for these bundlers (`pkg.module`) is the ES Module build (`fuse.esm.js`).
- **[ES Module](http://exploringjs.com/es6/ch_modules.html)**: Intended for use with modern bundlers like [Webpack 2](https://webpack.js.org) or [Rollup](http://rollupjs.org/). The file for these bundlers (`pkg.module`) is the ES Module build (`fuse.mjs`).

<Donate />
4 changes: 2 additions & 2 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ If you are using native ES Modules, there is also an ES Modules compatible build

```html
<script type="module">
import Fuse from 'https://cdn.jsdelivr.net/npm/fuse.js@6.6.2/dist/fuse.esm.js'
import Fuse from 'https://cdn.jsdelivr.net/npm/fuse.js@6.6.2/dist/fuse.mjs'
</script>
```

Expand All @@ -67,7 +67,7 @@ You can directly import `Fuse` as an ES module from the deno.land/x service:

```typescript
// @deno-types="https://deno.land/x/fuse@v6.6.2/dist/fuse.d.ts"
import Fuse from 'https://deno.land/x/fuse@v6.6.2/dist/fuse.esm.min.js'
import Fuse from 'https://deno.land/x/fuse@v6.6.2/dist/fuse.min.mjs'
```

<Donate />
1 change: 1 addition & 0 deletions runner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import Fuse from 'fuse.js'

0 comments on commit ec4e3bc

Please sign in to comment.