Skip to content

Commit

Permalink
Add umd distribution (#84)
Browse files Browse the repository at this point in the history
* Add umd distribution

* add UMD exports

* 3.5.5

---------

Co-authored-by: ishiko <ishiko732@gmail.com>
  • Loading branch information
barrelltech and ishiko732 authored Apr 16, 2024
1 parent f282b5b commit cf84e67
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
branches:
- master

permissions:
contents: write
checks: write
pull-requests: write

jobs:
test:
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "ts-fsrs",
"version": "3.5.4",
"version": "3.5.5",
"description": "ts-fsrs is a ES modules package based on TypeScript, used to implement the Free Spaced Repetition Scheduler (FSRS) algorithm. It helps developers apply FSRS to their flashcard applications, there by improving the user learning experience.",
"main": "dist/index.cjs",
"umd": "dist/index.umd.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"keywords": [
Expand Down
24 changes: 23 additions & 1 deletion rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,28 @@ export default defineConfig([
commonjs(),
],
external: ["seedrandom"],
},
{
input: 'src/fsrs/index.ts',
output: {
file: 'dist/index.umd.js',
format: 'umd',
name: 'FSRS',
sourcemap: true,
globals: {
seedrandom: 'seedrandom',
},
},
plugins: [
resolve(),
esbuild({
target: 'es2017',
minify: true,
sourceMap: true,
}),
commonjs(),
],
external: ["seedrandom"],
},
{
input: 'src/fsrs/index.ts',
Expand All @@ -57,4 +79,4 @@ export default defineConfig([
],
external: ["seedrandom"],
},
]);
]);
2 changes: 1 addition & 1 deletion src/fsrs/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const default_w = [
];
export const default_enable_fuzz = false;

export const FSRSVersion: string = "3.5.4";
export const FSRSVersion: string = "3.5.5";

export const generatorParameters = (
props?: Partial<FSRSParameters>,
Expand Down

0 comments on commit cf84e67

Please sign in to comment.