codemirror-lang-liquidsoap 0.2.4 → 0.2.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codemirror-lang-liquidsoap",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "Liquidsoap language support for prosemirror",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {
@@ -17,14 +17,18 @@
17
17
  "license": "MIT",
18
18
  "devDependencies": {
19
19
  "@lezer/generator": "^1.0.0",
20
+ "@rollup/plugin-typescript": "^11.1.5",
21
+ "@types/bluebird": "^3.5.41",
22
+ "@types/minimist": "^1.2.4",
20
23
  "codemirror": "^6.0.1",
21
24
  "prettier": "^3.0.3",
22
- "rollup": "^2.60.2",
23
- "rollup-plugin-dts": "^4.0.1",
25
+ "rollup": "^2.70.1",
26
+ "rollup-plugin-delete": "^2.0.0",
27
+ "rollup-plugin-dts": "^6.1.0",
24
28
  "rollup-plugin-preserve-shebang": "^1.0.1",
25
- "rollup-plugin-ts": "^3.0.2",
29
+ "rollup-plugin-sourcemaps": "^0.6.3",
26
30
  "tslib": "^2.6.2",
27
- "typescript": "^4.3.4"
31
+ "typescript": "^5.2.2"
28
32
  },
29
33
  "dependencies": {
30
34
  "@codemirror/language": "^6.0.0",
package/rollup.config.js CHANGED
@@ -1,13 +1,59 @@
1
1
  import shebang from "rollup-plugin-preserve-shebang";
2
- import typescript from "rollup-plugin-ts";
2
+ import typescript from "@rollup/plugin-typescript";
3
+ import sourcemaps from "rollup-plugin-sourcemaps";
4
+ import dts from "rollup-plugin-dts";
5
+ import del from "rollup-plugin-delete";
3
6
  import { lezer } from "@lezer/generator/rollup";
4
7
 
5
- export default {
6
- input: {
7
- index: "src/index.ts",
8
- cli: "src/cli.ts",
8
+ export default [
9
+ {
10
+ input: "src/index.ts",
11
+ output: [
12
+ {
13
+ sourcemap: "inline",
14
+ file: "dist/index.js",
15
+ format: "es",
16
+ },
17
+ ],
18
+ plugins: [
19
+ lezer(),
20
+ typescript({
21
+ sourceMap: true,
22
+ inlineSources: true,
23
+ tsconfig: "./tsconfig.json",
24
+ }),
25
+ sourcemaps(),
26
+ ],
9
27
  },
10
- external: (id) => id != "tslib" && !/^(\.?\/|\w:)/.test(id),
11
- output: [{ dir: "./dist", format: "es" }],
12
- plugins: [shebang(), lezer(), typescript()],
13
- };
28
+ {
29
+ input: "src/cli.ts",
30
+ output: [
31
+ {
32
+ sourcemap: "inline",
33
+ file: "dist/cli.js",
34
+ format: "es",
35
+ },
36
+ ],
37
+ plugins: [
38
+ shebang(),
39
+ lezer(),
40
+ typescript({
41
+ sourceMap: true,
42
+ inlineSources: true,
43
+ tsconfig: "./tsconfig.json",
44
+ }),
45
+ sourcemaps(),
46
+ ],
47
+ },
48
+ {
49
+ input: "dist/types/index.d.ts",
50
+ output: [
51
+ {
52
+ file: "dist/index.d.ts",
53
+ format: "es",
54
+ plugins: [],
55
+ },
56
+ ],
57
+ plugins: [dts(), del({ targets: "dist/types", hook: "buildEnd" })],
58
+ },
59
+ ];
package/src/cli.ts CHANGED
@@ -14,15 +14,17 @@ enum Color {
14
14
  Yellow = 33,
15
15
  }
16
16
 
17
+ type Node = {
18
+ readonly type: NodeType;
19
+ readonly from: number;
20
+ readonly to: number;
21
+ };
22
+
17
23
  function colorize(value: any, color: number): string {
18
24
  return "\u001b[" + color + "m" + String(value) + "\u001b[39m";
19
25
  }
20
26
 
21
- function focusedNode(cursor: TreeCursor): {
22
- readonly type: NodeType;
23
- readonly from: number;
24
- readonly to: number;
25
- } {
27
+ function focusedNode(cursor: TreeCursor): Node {
26
28
  const { type, from, to } = cursor;
27
29
  return { type, from, to };
28
30
  }
@@ -37,7 +39,7 @@ export function printTree(
37
39
  includeParents?: boolean;
38
40
  } = {},
39
41
  ) {
40
- let errors = [];
42
+ let errors: Node[] = [];
41
43
  const cursor = tree.cursor();
42
44
  const {
43
45
  from = 0,
@@ -751,7 +751,7 @@ BlockComment {
751
751
  "("[closedBy=")"]
752
752
  ")"[openedBy="("]
753
753
  "["[closedBy="]"]
754
- "["[openedBy="["]
754
+ "]"[openedBy="["]
755
755
 
756
756
  spaces { $[\u0009 \u000b\u00a0\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]+ }
757
757
  newline { $[\r\n\u2028\u2029] }