waibu-bootswatch 1.0.1

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Ardhi Lukianto
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # waibu-bootswatch
2
+
3
+ Plugin name: **waibuBootstrap**, alias: **wbw**
4
+
5
+ ![GitHub package.json version](https://img.shields.io/github/package-json/v/ardhi/waibu-bootswatch) ![NPM Version](https://img.shields.io/npm/v/waibu-bootswatch)
6
+
7
+ > <br />**Attention**: I do NOT accept any pull request at the moment, thanks!<br /><br />
8
+
9
+ Bootstrap support for [Waibu MPA](https://github.com/ardhi/waibu-mpa)
10
+
11
+ ## Installation
12
+
13
+ Goto your ```<bajo-base-dir>``` and type:
14
+
15
+ ```bash
16
+ $ npm install waibu-bootswatch
17
+ ```
18
+
19
+ Now open your ```<bajo-data-dir>/config/.plugins``` and put ```waibu-bootswatch``` in it.
20
+
21
+ ## License
22
+
23
+ [MIT](LICENSE)
package/bajo/.alias ADDED
@@ -0,0 +1 @@
1
+ wbw
@@ -0,0 +1,6 @@
1
+ {
2
+ "waibu": {
3
+ "prefix": "bootswatch"
4
+ },
5
+ "dependencies": ["waibu-mpa", "waibu-bootstrap"]
6
+ }
@@ -0,0 +1,5 @@
1
+ async function waibuMpaAfterBuildPage ({ $, theme, req }) {
2
+ if (req.darkMode && theme.framework === 'bootstrap') $('html').attr('data-bs-theme', 'dark')
3
+ }
4
+
5
+ export default waibuMpaAfterBuildPage
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "waibu-bootswatch",
3
+ "version": "1.0.1",
4
+ "description": "Bootswatch suport for Waibu Framework",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "type": "module",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/ardhi/waibu-bootswatch.git"
13
+ },
14
+ "keywords": [
15
+ "bootswatch",
16
+ "waibu",
17
+ "web",
18
+ "webserver",
19
+ "bajo",
20
+ "framework",
21
+ "fastify",
22
+ "modular"
23
+ ],
24
+ "author": "Ardhi Lukianto <ardhi@lukianto.com>",
25
+ "license": "MIT",
26
+ "bugs": {
27
+ "url": "https://github.com/ardhi/waibu-bootswatch/issues"
28
+ },
29
+ "homepage": "https://github.com/ardhi/waibu-bootswatch#readme",
30
+ "dependencies": {
31
+ "bootswatch": "^5.3.3"
32
+ }
33
+ }
@@ -0,0 +1,18 @@
1
+ const types = ['cerulean', 'cosmo', 'cyborg', 'darkly', 'flatly', 'journal', 'litera',
2
+ 'lumen', 'lux', 'materia', 'minty', 'morph', 'pulse', 'quartz', 'sandstone', 'simplex',
3
+ 'sketchy', 'slate', 'solar', 'spacelab', 'superhero', 'united', 'vapor', 'yeti', 'zephyr']
4
+
5
+ async function theme (ctx) {
6
+ return types.map(t => {
7
+ const framework = 'bootstrap'
8
+ const css = `waibuBootswatch.virtual:/bootswatch/${t}/bootstrap.min.css`
9
+ return {
10
+ name: t,
11
+ framework,
12
+ css,
13
+ cssExcludes: 'waibuBootstrap.virtual:/bootstrap/css/bootstrap.min.css'
14
+ }
15
+ })
16
+ }
17
+
18
+ export default theme
@@ -0,0 +1,4 @@
1
+ [{
2
+ "prefix": "bootswatch",
3
+ "root": "node_modules/bootswatch/dist"
4
+ }]