@memobit/themes 1.0.0 → 1.0.2
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/dist/vite.js +5 -3
- package/package.json +77 -77
package/dist/vite.js
CHANGED
|
@@ -31,20 +31,22 @@ var readThemeFiles = (root) => {
|
|
|
31
31
|
var memobitThemes = (options = {}) => {
|
|
32
32
|
const { root = process.cwd() } = options;
|
|
33
33
|
const themes = readThemeFiles(root);
|
|
34
|
-
const urls = Object.fromEntries([...themes.keys()].map((name) => [name, `/${THEME_ASSET_DIR}/${name}.css`]));
|
|
35
34
|
return {
|
|
36
35
|
name: "memobit-themes",
|
|
37
36
|
config() {
|
|
37
|
+
const urls = Object.fromEntries([...themes.keys()].map((name) => [name, `../${THEME_ASSET_DIR}/${name}.css`]));
|
|
38
38
|
return { define: { __MEMOBIT_THEME_URLS__: JSON.stringify(urls) } };
|
|
39
39
|
},
|
|
40
40
|
configureServer(server) {
|
|
41
41
|
server.middlewares.use((req, res, next) => {
|
|
42
42
|
const path = (req.url ?? "").split("?")[0];
|
|
43
|
-
|
|
43
|
+
const marker = `/${THEME_ASSET_DIR}/`;
|
|
44
|
+
const at = path.indexOf(marker);
|
|
45
|
+
if (at === -1 || !path.endsWith(".css")) {
|
|
44
46
|
next();
|
|
45
47
|
return;
|
|
46
48
|
}
|
|
47
|
-
const css = themes.get(path.slice(
|
|
49
|
+
const css = themes.get(path.slice(at + marker.length, -4));
|
|
48
50
|
if (css === void 0) {
|
|
49
51
|
next();
|
|
50
52
|
return;
|
package/package.json
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@memobit/themes",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "64 themes for the Memobit apps — each published as its own stylesheet so an app loads only the one it is showing, with preview palettes for the theme picker.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"css",
|
|
7
|
-
"themes",
|
|
8
|
-
"theming",
|
|
9
|
-
"design-tokens",
|
|
10
|
-
"dark-mode",
|
|
11
|
-
"scss",
|
|
12
|
-
"memobit"
|
|
13
|
-
],
|
|
14
|
-
"author": "Iulian Cristea <iulianx@gmail.com>",
|
|
15
|
-
"license": "Apache-2.0",
|
|
16
|
-
"homepage": "https://react.memobit.ro/",
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/CristeaIulian/memobit-react-library-themes.git"
|
|
20
|
-
},
|
|
21
|
-
"bugs": {
|
|
22
|
-
"url": "https://github.com/CristeaIulian/memobit-react-library-themes/issues"
|
|
23
|
-
},
|
|
24
|
-
"publishConfig": {
|
|
25
|
-
"access": "public"
|
|
26
|
-
},
|
|
27
|
-
"sideEffects": [
|
|
28
|
-
"**/*.css",
|
|
29
|
-
"**/*.scss"
|
|
30
|
-
],
|
|
31
|
-
"type": "module",
|
|
32
|
-
"main": "dist/index.js",
|
|
33
|
-
"module": "dist/index.js",
|
|
34
|
-
"types": "dist/index.d.ts",
|
|
35
|
-
"exports": {
|
|
36
|
-
".": {
|
|
37
|
-
"types": "./dist/index.d.ts",
|
|
38
|
-
"import": "./dist/index.js"
|
|
39
|
-
},
|
|
40
|
-
"./vite": {
|
|
41
|
-
"types": "./dist/vite.d.ts",
|
|
42
|
-
"import": "./dist/vite.js"
|
|
43
|
-
},
|
|
44
|
-
"./themes.css": "./dist/themes.css",
|
|
45
|
-
"./themes/*.css": "./dist/themes/*.css",
|
|
46
|
-
"./src/theming/*.scss": "./src/theming/*.scss",
|
|
47
|
-
"./package.json": "./package.json"
|
|
48
|
-
},
|
|
49
|
-
"files": [
|
|
50
|
-
"dist",
|
|
51
|
-
"src/theming"
|
|
52
|
-
],
|
|
53
|
-
"scripts": {
|
|
54
|
-
"build:themes": "node scripts/build-themes.mjs",
|
|
55
|
-
"build": "npm run build:themes && vite build && npm pack",
|
|
56
|
-
"release": "npm run build && npm publish",
|
|
57
|
-
"prepublishOnly": "npm run build:themes && vite build",
|
|
58
|
-
"lint": "eslint src --ext .ts",
|
|
59
|
-
"lint:fix": "eslint src --ext .ts --fix"
|
|
60
|
-
},
|
|
61
|
-
"devDependencies": {
|
|
62
|
-
"@eslint/js": "9.39.4",
|
|
63
|
-
"@types/node": "25.8.0",
|
|
64
|
-
"eslint": "9.39.4",
|
|
65
|
-
"eslint-config-prettier": "10.1.8",
|
|
66
|
-
"eslint-plugin-import-x": "4.17.1",
|
|
67
|
-
"eslint-plugin-prettier": "5.5.5",
|
|
68
|
-
"eslint-plugin-simple-import-sort": "13.0.0",
|
|
69
|
-
"globals": "17.6.0",
|
|
70
|
-
"prettier": "3.8.3",
|
|
71
|
-
"sass": "1.99.0",
|
|
72
|
-
"typescript": "6.0.3",
|
|
73
|
-
"typescript-eslint": "8.59.3",
|
|
74
|
-
"vite": "8.1.5",
|
|
75
|
-
"vite-plugin-dts": "5.0.0"
|
|
76
|
-
}
|
|
77
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@memobit/themes",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "64 themes for the Memobit apps — each published as its own stylesheet so an app loads only the one it is showing, with preview palettes for the theme picker.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"css",
|
|
7
|
+
"themes",
|
|
8
|
+
"theming",
|
|
9
|
+
"design-tokens",
|
|
10
|
+
"dark-mode",
|
|
11
|
+
"scss",
|
|
12
|
+
"memobit"
|
|
13
|
+
],
|
|
14
|
+
"author": "Iulian Cristea <iulianx@gmail.com>",
|
|
15
|
+
"license": "Apache-2.0",
|
|
16
|
+
"homepage": "https://react.memobit.ro/",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/CristeaIulian/memobit-react-library-themes.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/CristeaIulian/memobit-react-library-themes/issues"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"sideEffects": [
|
|
28
|
+
"**/*.css",
|
|
29
|
+
"**/*.scss"
|
|
30
|
+
],
|
|
31
|
+
"type": "module",
|
|
32
|
+
"main": "dist/index.js",
|
|
33
|
+
"module": "dist/index.js",
|
|
34
|
+
"types": "dist/index.d.ts",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
38
|
+
"import": "./dist/index.js"
|
|
39
|
+
},
|
|
40
|
+
"./vite": {
|
|
41
|
+
"types": "./dist/vite.d.ts",
|
|
42
|
+
"import": "./dist/vite.js"
|
|
43
|
+
},
|
|
44
|
+
"./themes.css": "./dist/themes.css",
|
|
45
|
+
"./themes/*.css": "./dist/themes/*.css",
|
|
46
|
+
"./src/theming/*.scss": "./src/theming/*.scss",
|
|
47
|
+
"./package.json": "./package.json"
|
|
48
|
+
},
|
|
49
|
+
"files": [
|
|
50
|
+
"dist",
|
|
51
|
+
"src/theming"
|
|
52
|
+
],
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build:themes": "node scripts/build-themes.mjs",
|
|
55
|
+
"build": "npm run build:themes && vite build && npm pack",
|
|
56
|
+
"release": "npm run build && npm publish",
|
|
57
|
+
"prepublishOnly": "npm run build:themes && vite build",
|
|
58
|
+
"lint": "eslint src --ext .ts",
|
|
59
|
+
"lint:fix": "eslint src --ext .ts --fix"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@eslint/js": "9.39.4",
|
|
63
|
+
"@types/node": "25.8.0",
|
|
64
|
+
"eslint": "9.39.4",
|
|
65
|
+
"eslint-config-prettier": "10.1.8",
|
|
66
|
+
"eslint-plugin-import-x": "4.17.1",
|
|
67
|
+
"eslint-plugin-prettier": "5.5.5",
|
|
68
|
+
"eslint-plugin-simple-import-sort": "13.0.0",
|
|
69
|
+
"globals": "17.6.0",
|
|
70
|
+
"prettier": "3.8.3",
|
|
71
|
+
"sass": "1.99.0",
|
|
72
|
+
"typescript": "6.0.3",
|
|
73
|
+
"typescript-eslint": "8.59.3",
|
|
74
|
+
"vite": "8.1.5",
|
|
75
|
+
"vite-plugin-dts": "5.0.0"
|
|
76
|
+
}
|
|
77
|
+
}
|