@webround/editor 0.3.6 → 0.3.8

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.
@@ -1,4 +1,5 @@
1
1
  export * from './types.js';
2
2
  export { RULES, SITE_RULES, runRules, runSiteRules } from './rules.js';
3
3
  export { checkPageFromDom, checkPageFromSerialized, serializeDom, type DomNode } from './producer-dom.js';
4
+ export { measuredIssues } from './measured.js';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -2,4 +2,5 @@
2
2
  export * from './types.js';
3
3
  export { RULES, SITE_RULES, runRules, runSiteRules } from './rules.js';
4
4
  export { checkPageFromDom, checkPageFromSerialized, serializeDom } from './producer-dom.js';
5
+ export { measuredIssues } from './measured.js';
5
6
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,11 @@
1
+ import { type Issue } from './types.js';
2
+ import type { MeasureFinding } from '../measure.js';
3
+ /**
4
+ * The issues of the measured findings of a page. `page` is how the caller names it (the editor's page name, the tools' path: they list what they got under it) and `muted` the keys of the problems
5
+ * the person chose to leave (`checks.json`): a measured problem is silenced like a found one.
6
+ */
7
+ export declare function measuredIssues(findings: readonly MeasureFinding[], { page, muted }: {
8
+ page: string;
9
+ muted?: readonly string[];
10
+ }): Issue[];
11
+ //# sourceMappingURL=measured.d.ts.map
@@ -0,0 +1,20 @@
1
+ import { issueKey } from './types.js';
2
+ // What the page's drawing says is wrong (`measurePage`: contrast, size of what is pressed, size of text, spacing, reflow, the names of the navs) as issues of the page, like any other:
3
+ // the same shape, the same key, silenced the same way. ONE function makes them, so what the editor shows (from its preview) and what the container's tools say (from their headless browser) are the
4
+ // same list, never two. Nothing here touches a DOM: the findings are data.
5
+ /**
6
+ * The issues of the measured findings of a page. `page` is how the caller names it (the editor's page name, the tools' path: they list what they got under it) and `muted` the keys of the problems
7
+ * the person chose to leave (`checks.json`): a measured problem is silenced like a found one.
8
+ */
9
+ export function measuredIssues(findings, { page, muted = [] }) {
10
+ const silenced = new Set(muted);
11
+ return findings.map((finding) => {
12
+ const key = issueKey({ rule: finding.rule, page, subject: finding.elementId || undefined });
13
+ return {
14
+ rule: finding.rule, severity: 'warning', page, message: finding.message, key,
15
+ ...(finding.elementId ? { nodeId: finding.elementId, subject: finding.elementId } : {}),
16
+ ...(silenced.has(key) ? { muted: true } : {}),
17
+ };
18
+ });
19
+ }
20
+ //# sourceMappingURL=measured.js.map
@@ -6,6 +6,9 @@ export interface WrPluginsOptions {
6
6
  */
7
7
  allowedHosts?: true | string[];
8
8
  }
9
+ /** How many files Rollup reads at once. Its own default (1000) is too many for a container that lets a process open 1024: a site that imports a library of thousands of small files
10
+ * (an icon set) runs out of them, and Vite reports it as "failed to resolve" on a package that is there. The time of the build does not depend on it (measured: the same from 100 to 900). */
11
+ export declare const BUILD_PARALLEL_FILE_OPS = 300;
9
12
  /**
10
13
  * Facade: tutti i plugin dell'editor, nell'ordine giusto. Il vite.config.ts di un progetto
11
14
  * deve solo spargere `...wrPlugins()` accanto a react() e tailwindcss(); aggiungere un plugin
@@ -19,6 +19,19 @@ function wrWatchConfigPlugin() {
19
19
  config: () => ({ server: { watch: { ignored: ['**/.wr/**'] } } }),
20
20
  };
21
21
  }
22
+ /** How many files Rollup reads at once. Its own default (1000) is too many for a container that lets a process open 1024: a site that imports a library of thousands of small files
23
+ * (an icon set) runs out of them, and Vite reports it as "failed to resolve" on a package that is there. The time of the build does not depend on it (measured: the same from 100 to 900). */
24
+ export const BUILD_PARALLEL_FILE_OPS = 300;
25
+ // A site that sets its own number keeps it.
26
+ function wrBuildConfigPlugin() {
27
+ return {
28
+ name: 'wr-build-config',
29
+ apply: 'build',
30
+ config: (config) => (config.build?.rollupOptions?.maxParallelFileOps === undefined
31
+ ? { build: { rollupOptions: { maxParallelFileOps: BUILD_PARALLEL_FILE_OPS } } }
32
+ : null),
33
+ };
34
+ }
22
35
  /**
23
36
  * Facade: tutti i plugin dell'editor, nell'ordine giusto. Il vite.config.ts di un progetto
24
37
  * deve solo spargere `...wrPlugins()` accanto a react() e tailwindcss(); aggiungere un plugin
@@ -28,6 +41,7 @@ export function wrPlugins(options = {}) {
28
41
  return [
29
42
  ...(options.allowedHosts ? [wrServerConfigPlugin(options.allowedHosts)] : []),
30
43
  wrWatchConfigPlugin(),
44
+ wrBuildConfigPlugin(),
31
45
  // The one door into the project for the editor's page (see operations/)
32
46
  wrOperationsPlugin(),
33
47
  wrPagesPlugin(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webround/editor",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -41,6 +41,16 @@
41
41
  "types": "./dist/check/producer-code.d.ts",
42
42
  "default": "./dist/check/producer-code.js"
43
43
  },
44
+ "./check/project": {
45
+ "import": "./dist/check/project.js",
46
+ "types": "./dist/check/project.d.ts",
47
+ "default": "./dist/check/project.js"
48
+ },
49
+ "./measure": {
50
+ "import": "./dist/measure.js",
51
+ "types": "./dist/measure.d.ts",
52
+ "default": "./dist/measure.js"
53
+ },
44
54
  "./operations": {
45
55
  "import": "./dist/operations/index.js",
46
56
  "types": "./dist/operations/index.d.ts",
@@ -65,7 +75,7 @@
65
75
  "@lexical/selection": "^0.51.0",
66
76
  "@lexical/utils": "^0.51.0",
67
77
  "@monaco-editor/react": "^4.7.0",
68
- "@webround/core": "^0.3.6",
78
+ "@webround/core": "^0.3.8",
69
79
  "highlight.js": "^11.12.0",
70
80
  "hls.js": "^1.5.0",
71
81
  "lexical": "^0.51.0",