Skip to content
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
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
release_name: Release ${{ github.ref }}
body: |
New Release :tada:
- Code optimization
- Set all `Options` properties as optional
- Prevent duplication of `<meta>` and `<style>` tags
- Exported `Options` types
- Unify storage options in `useStorage`
- Add plugins support via `usePlugins` option
- Add ThemeWidget and KeyboardShortcut plugins
- Add new public method `destroy()`
draft: false
prerelease: false
prerelease: true
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Run tests

on:
push:
paths:
- "src/**"
tags:
- "v*"
pull_request:
paths:
- "src/**"
Expand Down
9 changes: 8 additions & 1 deletion demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ mkdir demo && cat > ./demo/index.html << EOF
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script type="text/javascript" src="../dist/darkify.umd.js"></script>
<script type="text/javascript" src="../dist/plugins/index.umd.js"></script>
<title>Darkify &#x2014; Demo</title>
</head>
<style>
Expand All @@ -25,7 +26,13 @@ mkdir demo && cat > ./demo/index.html << EOF
</main>
</div>
<script type="text/javascript">
var dMode = new Darkify('#element');
const { ThemeWidget, KeyboardShortcut } = DarkifyPlugins;
var dMode = new Darkify('#element', {
usePlugins: [
[ThemeWidget, { shortcut: 'd' }],
[KeyboardShortcut]
]
});
console.info(dMode);
</script>
</body>
Expand Down
3 changes: 3 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ export default {
useESM: true
}],
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
};
Loading
Loading