mancha 0.18.2 → 0.18.4
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/.github/workflows/ci.yml +3 -0
- package/README.md +19 -477
- package/biome.json +46 -0
- package/dist/browser.d.ts +39 -33
- package/dist/browser.js +13 -1
- package/dist/browser.js.map +1 -1
- package/dist/cli.js +37 -6
- package/dist/cli.js.map +1 -1
- package/dist/css_gen_basic.d.ts +1 -1
- package/dist/css_gen_basic.js.map +1 -1
- package/dist/dome.d.ts +3 -3
- package/dist/dome.js +26 -16
- package/dist/dome.js.map +1 -1
- package/dist/expressions/ast.test.js +5 -5
- package/dist/expressions/ast.test.js.map +1 -1
- package/dist/expressions/ast_factory.d.ts +1 -1
- package/dist/expressions/ast_factory.test.js.map +1 -1
- package/dist/expressions/constants.test.js +1 -1
- package/dist/expressions/constants.test.js.map +1 -1
- package/dist/expressions/eval.d.ts +2 -2
- package/dist/expressions/eval.js +19 -9
- package/dist/expressions/eval.js.map +1 -1
- package/dist/expressions/eval.test.js +23 -0
- package/dist/expressions/eval.test.js.map +1 -1
- package/dist/expressions/parser.d.ts +2 -2
- package/dist/expressions/parser.js +13 -9
- package/dist/expressions/parser.js.map +1 -1
- package/dist/expressions/parser.test.js +2 -1
- package/dist/expressions/parser.test.js.map +1 -1
- package/dist/expressions/tokenizer.js +17 -17
- package/dist/expressions/tokenizer.js.map +1 -1
- package/dist/expressions/tokenizer.test.js +1 -1
- package/dist/expressions/tokenizer.test.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces-Dizh9utI.d.ts +220 -0
- package/dist/interfaces.d.ts +1 -1
- package/dist/mancha.d.ts +5 -2
- package/dist/mancha.js +57 -1
- package/dist/mancha.js.map +1 -1
- package/dist/plugins.js +39 -24
- package/dist/plugins.js.map +1 -1
- package/dist/query.d.ts +1 -1
- package/dist/query.js +1 -1
- package/dist/query.js.map +1 -1
- package/dist/renderer-B3R6_o-2.js +30 -0
- package/dist/renderer.d.ts +3 -3
- package/dist/renderer.js +4 -3
- package/dist/renderer.js.map +1 -1
- package/dist/safe_browser.d.ts +15 -13
- package/dist/safe_browser.js +1 -1
- package/dist/store.d.ts +2 -2
- package/dist/store.js +6 -2
- package/dist/store.js.map +1 -1
- package/dist/test_utils.d.ts +8 -7
- package/dist/test_utils.js +8 -3
- package/dist/test_utils.js.map +1 -1
- package/dist/type_checker.js +37 -30
- package/dist/type_checker.js.map +1 -1
- package/dist/worker.d.ts +5 -5
- package/dist/worker.js +5 -5
- package/dist/worker.js.map +1 -1
- package/docs/components.md +199 -0
- package/docs/quickstart.md +18 -701
- package/docs/reactivity.md +135 -0
- package/docs/ssr.md +78 -0
- package/docs/syntax.md +123 -0
- package/docs/testing.md +66 -0
- package/docs/typescript.md +167 -0
- package/gulpfile.ts +25 -22
- package/package.json +9 -7
- package/scripts/generate-css-docs.ts +6 -9
- package/tsconfig.json +3 -10
- package/tsdown.config.ts +32 -0
- package/.prettierrc +0 -3
- package/webpack.config.esmodule.ts +0 -26
- package/webpack.config.ts +0 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mancha",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.4",
|
|
4
4
|
"description": "Javscript HTML rendering engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -27,9 +27,11 @@
|
|
|
27
27
|
"test:node": "mocha 'dist/**/*.test.js' --ignore 'dist/browser.test.js'",
|
|
28
28
|
"test:browser": "web-test-runner 'dist/**/*.test.js' '!dist/cli.test.js' '!dist/ssr.test.js' '!dist/index.test.js' '!dist/worker.test.js' '!dist/type_checker.test.js' --node-resolve --compatibility all --playwright --browsers chromium --no-sandbox",
|
|
29
29
|
"test": "npm run test:node && npm run test:browser",
|
|
30
|
-
"
|
|
30
|
+
"check:size": "brotli -c dist/mancha.js | wc -c",
|
|
31
31
|
"cli": "node dist/cli.js",
|
|
32
|
-
"gen:docs": "tsx scripts/generate-css-docs.ts"
|
|
32
|
+
"gen:docs": "tsx scripts/generate-css-docs.ts",
|
|
33
|
+
"lint": "biome check .",
|
|
34
|
+
"lint:fix": "biome check --write ."
|
|
33
35
|
},
|
|
34
36
|
"bin": {
|
|
35
37
|
"mancha": "dist/cli.js"
|
|
@@ -56,9 +58,12 @@
|
|
|
56
58
|
"yargs": "^17.7.2"
|
|
57
59
|
},
|
|
58
60
|
"devDependencies": {
|
|
61
|
+
"@biomejs/biome": "^2.3.10",
|
|
59
62
|
"@types/chai": "^5.2.3",
|
|
60
63
|
"@types/chai-as-promised": "^8.0.1",
|
|
61
64
|
"@types/glob": "^8.1.0",
|
|
65
|
+
"@types/gulp": "^4.0.18",
|
|
66
|
+
"@types/gulp-csso": "^4.0.5",
|
|
62
67
|
"@types/jsdom": "^21.1.6",
|
|
63
68
|
"@types/mocha": "^10.0.10",
|
|
64
69
|
"@types/node": "^20.12.11",
|
|
@@ -69,20 +74,17 @@
|
|
|
69
74
|
"@web/test-runner-playwright": "^0.11.1",
|
|
70
75
|
"chai": "^5.3.3",
|
|
71
76
|
"chai-as-promised": "^8.0.1",
|
|
72
|
-
"css-loader": "^7.1.2",
|
|
73
77
|
"csso": "^5.0.5",
|
|
74
78
|
"gulp": "^5.0.0",
|
|
75
79
|
"gulp-csso": "^4.0.1",
|
|
76
80
|
"gulp-typescript": "^6.0.0-alpha.1",
|
|
77
81
|
"mocha": "^11.0.1",
|
|
78
82
|
"static-server": "^3.0.0",
|
|
79
|
-
"terser-webpack-plugin": "^5.3.10",
|
|
80
83
|
"ts-node": "^10.9.2",
|
|
84
|
+
"tsdown": "^0.18.3",
|
|
81
85
|
"tsec": "^0.2.8",
|
|
82
86
|
"tsx": "^4.21.0",
|
|
83
87
|
"typescript": "^5.9.3",
|
|
84
|
-
"webpack": "^5.97.1",
|
|
85
|
-
"webpack-cli": "^5.1.4",
|
|
86
88
|
"yargs": "^17.7.2"
|
|
87
89
|
}
|
|
88
90
|
}
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import * as fs from "node:fs";
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import {
|
|
4
|
+
DURATIONS,
|
|
4
5
|
MEDIA_BREAKPOINTS,
|
|
5
|
-
|
|
6
|
+
PERCENTS,
|
|
6
7
|
PROPS_COLORS,
|
|
7
|
-
|
|
8
|
+
PROPS_CUSTOM,
|
|
8
9
|
PROPS_SIZING,
|
|
9
|
-
PROPS_POSITION,
|
|
10
10
|
PROPS_SIZING_MINMAX,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
PERCENTS,
|
|
14
|
-
DURATIONS,
|
|
15
|
-
} from "../src/css_gen_utils.ts";
|
|
11
|
+
PROPS_SPACING,
|
|
12
|
+
} from "../src/css_gen_utils.js";
|
|
16
13
|
|
|
17
14
|
const DOCS_PATH = path.join(process.cwd(), "docs", "css.md");
|
|
18
15
|
|
|
@@ -92,7 +89,7 @@ function generateMarkdown() {
|
|
|
92
89
|
md += "| Color | Shades |\n";
|
|
93
90
|
md += "| --- | --- |\n";
|
|
94
91
|
md += "| `white`, `black`, `transparent` | N/A |\n";
|
|
95
|
-
for (const [color,
|
|
92
|
+
for (const [color, _shades] of Object.entries(PROPS_COLORS)) {
|
|
96
93
|
md += `| \`${color}\` | \`50\`, \`100\`, \`200\`, \`300\`, \`400\`, \`500\`, \`600\`, \`700\`, \`800\`, \`900\` |\n`;
|
|
97
94
|
}
|
|
98
95
|
md += "\n";
|
package/tsconfig.json
CHANGED
|
@@ -15,12 +15,8 @@
|
|
|
15
15
|
"forceConsistentCasingInFileNames": true,
|
|
16
16
|
"baseUrl": ".",
|
|
17
17
|
"paths": {
|
|
18
|
-
"mancha": [
|
|
19
|
-
|
|
20
|
-
],
|
|
21
|
-
"mancha/*": [
|
|
22
|
-
"./src/*.ts"
|
|
23
|
-
]
|
|
18
|
+
"mancha": ["./src/index.ts"],
|
|
19
|
+
"mancha/*": ["./src/*.ts"]
|
|
24
20
|
},
|
|
25
21
|
"plugins": [
|
|
26
22
|
{
|
|
@@ -29,10 +25,7 @@
|
|
|
29
25
|
}
|
|
30
26
|
]
|
|
31
27
|
},
|
|
32
|
-
"include": [
|
|
33
|
-
"src/**/*",
|
|
34
|
-
"global.d.ts"
|
|
35
|
-
],
|
|
28
|
+
"include": ["src/**/*", "global.d.ts"],
|
|
36
29
|
"exclude": [
|
|
37
30
|
"scripts",
|
|
38
31
|
"examples",
|
package/tsdown.config.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineConfig } from "tsdown";
|
|
2
|
+
|
|
3
|
+
export default defineConfig([
|
|
4
|
+
{
|
|
5
|
+
entry: {
|
|
6
|
+
mancha: "src/mancha.ts",
|
|
7
|
+
},
|
|
8
|
+
format: "iife",
|
|
9
|
+
clean: false,
|
|
10
|
+
target: "es2022",
|
|
11
|
+
platform: "browser",
|
|
12
|
+
minify: true,
|
|
13
|
+
unbundle: false,
|
|
14
|
+
skipNodeModulesBundle: false,
|
|
15
|
+
noExternal: [/.*/],
|
|
16
|
+
globalName: "Mancha",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
entry: {
|
|
20
|
+
browser: "src/browser.ts",
|
|
21
|
+
safe_browser: "src/safe_browser.ts",
|
|
22
|
+
},
|
|
23
|
+
format: "esm",
|
|
24
|
+
clean: false,
|
|
25
|
+
dts: true,
|
|
26
|
+
target: "es2022",
|
|
27
|
+
platform: "browser",
|
|
28
|
+
minify: true,
|
|
29
|
+
unbundle: false,
|
|
30
|
+
skipNodeModulesBundle: false,
|
|
31
|
+
},
|
|
32
|
+
]);
|
package/.prettierrc
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import TerserPlugin from "terser-webpack-plugin";
|
|
2
|
-
import type { Configuration } from "webpack";
|
|
3
|
-
|
|
4
|
-
const config: Configuration = {
|
|
5
|
-
target: "web",
|
|
6
|
-
mode: "production",
|
|
7
|
-
entry: {
|
|
8
|
-
browser: "./dist/browser.js",
|
|
9
|
-
safe_browser: "./dist/safe_browser.js",
|
|
10
|
-
},
|
|
11
|
-
output: {
|
|
12
|
-
filename: "[name].js",
|
|
13
|
-
library: { type: "modern-module" },
|
|
14
|
-
},
|
|
15
|
-
experiments: {
|
|
16
|
-
outputModule: true,
|
|
17
|
-
},
|
|
18
|
-
optimization: {
|
|
19
|
-
minimize: true,
|
|
20
|
-
minimizer: [
|
|
21
|
-
new TerserPlugin({ extractComments: false, terserOptions: { output: { comments: false } } }),
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default config;
|
package/webpack.config.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import TerserPlugin from "terser-webpack-plugin";
|
|
2
|
-
import type { Configuration } from "webpack";
|
|
3
|
-
|
|
4
|
-
const config: Configuration = {
|
|
5
|
-
target: "web",
|
|
6
|
-
mode: "production",
|
|
7
|
-
entry: {
|
|
8
|
-
mancha: "./dist/mancha.js",
|
|
9
|
-
},
|
|
10
|
-
output: {
|
|
11
|
-
filename: "[name].js",
|
|
12
|
-
},
|
|
13
|
-
optimization: {
|
|
14
|
-
minimize: true,
|
|
15
|
-
minimizer: [
|
|
16
|
-
new TerserPlugin({ extractComments: false, terserOptions: { output: { comments: false } } }),
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default config;
|