Skip to content

Commit 763e533

Browse files
committed
fix: use latest stable version in docs CDN links
bump-docs script now pulls from npm registry instead of package.json to avoid beta versions in docs. Also fix regex to match pre-release suffixes and correct the double-beta version strings.
1 parent 6e600a6 commit 763e533

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

docs/getting-started.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ const Fuse = require('fuse.js')
3232
#### CDN
3333

3434
```html
35-
<script src="https://cdn.jsdelivr.net/npm/fuse.js@7.4.0-beta.1"></script>
35+
<script src="https://cdn.jsdelivr.net/npm/fuse.js@7.3.0"></script>
3636
```
3737

3838
ES Module via CDN:
3939

4040
```html
4141
<script type="module">
42-
import Fuse from 'https://cdn.jsdelivr.net/npm/fuse.js@7.4.0-beta.1/dist/fuse.mjs'
42+
import Fuse from 'https://cdn.jsdelivr.net/npm/fuse.js@7.3.0/dist/fuse.mjs'
4343
</script>
4444
```
4545

@@ -48,8 +48,8 @@ Also available on [unpkg](https://unpkg.com/fuse.js).
4848
#### Deno
4949

5050
```typescript
51-
// @deno-types="https://deno.land/x/fuse@v7.4.0-beta.1/dist/fuse.d.ts"
52-
import Fuse from 'https://deno.land/x/fuse@v7.4.0-beta.1/dist/fuse.min.mjs'
51+
// @deno-types="https://deno.land/x/fuse@v7.3.0/dist/fuse.d.ts"
52+
import Fuse from 'https://deno.land/x/fuse@v7.3.0/dist/fuse.min.mjs'
5353
```
5454

5555
## Quick Start

scripts/bump-docs.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//Load the library and specify options
2+
const { execSync } = require('child_process')
23
const replace = require('replace-in-file')
3-
const pckg = require('../package.json')
4-
const VERSION = process.env.VERSION || pckg.version
4+
const VERSION = process.env.VERSION || execSync('npm view fuse.js version').toString().trim()
55

66
const options = {
77
files: './docs/getting-started.md',
8-
from: /(\d+\.)(\d+\.)(\d+)/g,
8+
from: /(\d+\.)(\d+\.)(\d+)(-[a-zA-Z0-9.]+)?/g,
99
to: VERSION
1010
}
1111

0 commit comments

Comments
 (0)