mancha 0.17.3 → 0.17.5

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.
Files changed (70) hide show
  1. package/.github/workflows/ci.yml +8 -8
  2. package/.prettierrc +2 -2
  3. package/.vscode/extensions.json +1 -1
  4. package/.vscode/launch.json +33 -43
  5. package/README.md +94 -94
  6. package/dist/browser.js.map +1 -1
  7. package/dist/cli.js.map +1 -1
  8. package/dist/css_gen_basic.js.map +1 -1
  9. package/dist/css_gen_utils.d.ts +786 -0
  10. package/dist/css_gen_utils.js +63 -23
  11. package/dist/css_gen_utils.js.map +1 -1
  12. package/dist/dome.js.map +1 -1
  13. package/dist/expressions/ast.d.ts +16 -16
  14. package/dist/expressions/ast.test.js +89 -64
  15. package/dist/expressions/ast.test.js.map +1 -1
  16. package/dist/expressions/ast_factory.d.ts +1 -1
  17. package/dist/expressions/ast_factory.js +17 -17
  18. package/dist/expressions/ast_factory.js.map +1 -1
  19. package/dist/expressions/ast_factory.test.js +42 -36
  20. package/dist/expressions/ast_factory.test.js.map +1 -1
  21. package/dist/expressions/constants.js +56 -56
  22. package/dist/expressions/constants.js.map +1 -1
  23. package/dist/expressions/constants.test.js +57 -57
  24. package/dist/expressions/constants.test.js.map +1 -1
  25. package/dist/expressions/eval.d.ts +17 -17
  26. package/dist/expressions/eval.js +58 -60
  27. package/dist/expressions/eval.js.map +1 -1
  28. package/dist/expressions/eval.test.js +11 -8
  29. package/dist/expressions/eval.test.js.map +1 -1
  30. package/dist/expressions/expressions.test.d.ts +6 -6
  31. package/dist/expressions/expressions.test.js +6 -6
  32. package/dist/expressions/index.d.ts +6 -6
  33. package/dist/expressions/index.js +6 -6
  34. package/dist/expressions/parser.d.ts +3 -3
  35. package/dist/expressions/parser.js +37 -42
  36. package/dist/expressions/parser.js.map +1 -1
  37. package/dist/expressions/parser.test.js +3 -6
  38. package/dist/expressions/parser.test.js.map +1 -1
  39. package/dist/expressions/tokenizer.js +22 -25
  40. package/dist/expressions/tokenizer.js.map +1 -1
  41. package/dist/expressions/tokenizer.test.js +40 -15
  42. package/dist/expressions/tokenizer.test.js.map +1 -1
  43. package/dist/index.js.map +1 -1
  44. package/dist/iterator.js.map +1 -1
  45. package/dist/mancha.js.map +1 -1
  46. package/dist/plugins.js +2 -2
  47. package/dist/plugins.js.map +1 -1
  48. package/dist/query.js.map +1 -1
  49. package/dist/renderer.js.map +1 -1
  50. package/dist/safe_browser.js.map +1 -1
  51. package/dist/store.js +1 -1
  52. package/dist/store.js.map +1 -1
  53. package/dist/test_utils.js.map +1 -1
  54. package/dist/trusted_attributes.js.map +1 -1
  55. package/dist/type_checker.js +11 -7
  56. package/dist/type_checker.js.map +1 -1
  57. package/dist/worker.js.map +1 -1
  58. package/docs/css.md +419 -0
  59. package/docs/quickstart.md +305 -296
  60. package/global.d.ts +2 -2
  61. package/gulpfile.ts +44 -0
  62. package/package.json +86 -84
  63. package/scripts/generate-css-docs.ts +374 -0
  64. package/tsconfig.json +42 -19
  65. package/tsec_exemptions.json +8 -3
  66. package/webpack.config.esmodule.ts +26 -0
  67. package/webpack.config.ts +21 -0
  68. package/gulpfile.js +0 -44
  69. package/webpack.config.esmodule.js +0 -23
  70. package/webpack.config.js +0 -18
@@ -1,4 +1,9 @@
1
1
  {
2
- "ban-domparser-parsefromstring": ["src/browser.ts", "src/dome.test.ts", "src/worker.test.ts", "src/test_utils.ts"],
3
- "ban-range-createcontextualfragment": ["src/browser.ts"]
4
- }
2
+ "ban-domparser-parsefromstring": [
3
+ "src/browser.ts",
4
+ "src/dome.test.ts",
5
+ "src/worker.test.ts",
6
+ "src/test_utils.ts"
7
+ ],
8
+ "ban-range-createcontextualfragment": ["src/browser.ts"]
9
+ }
@@ -0,0 +1,26 @@
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;
@@ -0,0 +1,21 @@
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;
package/gulpfile.js DELETED
@@ -1,44 +0,0 @@
1
- import * as fs from "fs/promises";
2
- import GulpClient from "gulp";
3
- import csso from "gulp-csso";
4
- import { exec } from "child_process";
5
-
6
- const execTask = (command) => {
7
- return async function (done) {
8
- const { err, stderr, stdout } = await new Promise((resolve) =>
9
- exec(command, (err, stderr, stdout) => resolve({ err, stderr, stdout }))
10
- );
11
- if (stdout) console.log(stdout);
12
- if (stderr) console.error(stderr);
13
- done(err);
14
- };
15
- };
16
-
17
- // Clean tasks
18
-
19
- GulpClient.task("clean", function (done) {
20
- return fs.rm("dist", { recursive: true, force: true }).then(done);
21
- });
22
-
23
- // Build tasks
24
-
25
- GulpClient.task("ts", execTask("tsec -m ES2022 -p ."));
26
-
27
- GulpClient.task("chmod", function (done) {
28
- return fs.chmod("dist/cli.js", 0o755).then(done);
29
- });
30
-
31
- GulpClient.task("css", function () {
32
- return GulpClient.src("src/**/*.css").pipe(csso()).pipe(GulpClient.dest("dist"));
33
- });
34
-
35
- GulpClient.task("webpack:main", execTask("webpack --config webpack.config.js"));
36
- GulpClient.task("webpack:esmodule", execTask("webpack --config webpack.config.esmodule.js"));
37
-
38
- GulpClient.task("fixtures", function () {
39
- return GulpClient.src("src/fixtures/**/*").pipe(GulpClient.dest("dist/fixtures"));
40
- });
41
-
42
- GulpClient.task("webpack", GulpClient.series("webpack:main", "webpack:esmodule"));
43
- GulpClient.task("build", GulpClient.series("ts", "chmod", "css", "webpack", "fixtures"));
44
- GulpClient.task("default", GulpClient.series("build"));
@@ -1,23 +0,0 @@
1
- import TerserPlugin from "terser-webpack-plugin";
2
-
3
- export default {
4
- target: "web",
5
- mode: "production",
6
- entry: {
7
- "browser": "./dist/browser.js",
8
- "safe_browser": "./dist/safe_browser.js",
9
- },
10
- output: {
11
- filename: "[name].js",
12
- library: { type: "modern-module" },
13
- },
14
- experiments: {
15
- outputModule: true,
16
- },
17
- optimization: {
18
- minimize: true,
19
- minimizer: [
20
- new TerserPlugin({ extractComments: false, terserOptions: { output: { comments: false } } }),
21
- ],
22
- },
23
- };
package/webpack.config.js DELETED
@@ -1,18 +0,0 @@
1
- import TerserPlugin from "terser-webpack-plugin";
2
-
3
- export default {
4
- target: "web",
5
- mode: "production",
6
- entry: {
7
- mancha: "./dist/mancha.js",
8
- },
9
- output: {
10
- filename: "[name].js",
11
- },
12
- optimization: {
13
- minimize: true,
14
- minimizer: [
15
- new TerserPlugin({ extractComments: false, terserOptions: { output: { comments: false } } }),
16
- ],
17
- },
18
- };