@delance/runtime 2026.2.1 → 2026.2.102

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/main.mjs ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env deno
2
+
3
+ // main.mts
4
+ var opaque = () => "./dist/langserver.cjs";
5
+ await import("./install.mjs");
6
+ await import(opaque());
7
+ //# sourceMappingURL=main.mjs.map
package/main.mjs.map ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../main.mts"],
4
+ "sourcesContent": ["#!/usr/bin/env deno\n\nconst opaque = () => \"./dist/langserver.cjs\";\n\nawait import(\"./install.mts\");\nawait import(opaque());\n"],
5
+ "mappings": ";;;AAEA,IAAM,SAAS,MAAM;AAErB,MAAM,OAAO,eAAA;AACb,MAAM,OAAO,OAAA;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,36 +1,33 @@
1
1
  {
2
2
  "name": "@delance/runtime",
3
- "version": "2026.2.1",
3
+ "version": "2026.2.102",
4
4
  "description": "Runtime and entrypoint for the lance",
5
5
  "license": "0BSD",
6
+ "type": "commonjs",
6
7
  "bin": {
7
8
  "delance-langserver": "dist/langserver.cjs"
8
9
  },
9
- "delance": {
10
- "sha256": "bb59f83aa8c108069165ef0cbb6bf361f644eada4941243781222726c3524a74"
10
+ "dependencies": {
11
+ "@zip.js/zip.js": "^2.8.26",
12
+ "obug": "^2.1.1",
13
+ "quickjs-emscripten": "^0.32.0",
14
+ "@babel/generator": "^8.0.0-rc.5",
15
+ "@babel/traverse": "^8.0.0-rc.5",
16
+ "@babel/parser": "^8.0.0-rc.5",
17
+ "@babel/types": "^8.0.0-rc.5",
18
+ "@babel/template": "^8.0.0-rc.5",
19
+ "@babel/helper-validator-identifier": "^8.0.0-rc.5"
11
20
  },
12
21
  "files": [
13
- "langserver.cjs",
22
+ "main.mjs",
23
+ "main.mjs.map",
14
24
  "install.mjs",
15
- "utils.mjs"
25
+ "install.mjs.map"
16
26
  ],
17
- "scripts": {
18
- "postinstall": "node install.mjs",
19
- "prepublishOnly": "node install.mjs",
20
- "lint": "biome lint ."
21
- },
22
- "dependencies": {
23
- "@delance/builder": "^0.3.10",
24
- "@zip.js/zip.js": "^2.8.23",
25
- "p-map": "^7.0.4",
26
- "p-retry": "^7.1.1"
27
- },
28
- "devDependencies": {
29
- "@biomejs/biome": "^2.4.10",
30
- "@types/node": "^25.5.0",
31
- "typescript": "^5.9.3"
27
+ "delance": {
28
+ "sha256": "b86241f2f77ffbf39db19e825257f333e792fc2cc139ab078bafc16d6eb28ddc"
32
29
  },
33
- "trustedDependencies": [
34
- "@biomejs/biome"
35
- ]
36
- }
30
+ "scripts": {
31
+ "postinstall": "node install.mjs"
32
+ }
33
+ }
package/langserver.cjs DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- require('./dist/langserver.cjs');
package/utils.mjs DELETED
@@ -1,122 +0,0 @@
1
- // @ts-check
2
- import assert, {AssertionError} from 'node:assert';
3
- import {subtle} from 'node:crypto';
4
- import fs from 'node:fs/promises';
5
- import process from 'node:process';
6
- import retry, {AbortError} from 'p-retry';
7
-
8
- import pkg from './package.json' with {type: 'json'};
9
-
10
- /**
11
- * @param {string} string
12
- */
13
- const reverse = (string) => [...string].reverse().join('');
14
-
15
- const BASE_URL = new URL(reverse('/moc.oidutslausiv.ecalptekram//:sptth'));
16
- const PUBLISHER = reverse('nohtyp-sm');
17
- const EXTENSION = reverse('ecnalyp-edocsv');
18
-
19
- const ITEMS = new URL(`/items?itemName=${PUBLISHER}.${EXTENSION}`, BASE_URL);
20
-
21
- /** @type {RequestInit} */
22
- const INIT = {
23
- headers: {
24
- 'user-agent': 'Mozilla/5.0 (Delance) Gecko/20100101 Firefox/120.0',
25
- },
26
- credentials: 'include',
27
- };
28
-
29
- /**
30
- * @param {Blob} blob
31
- */
32
- export const sha256 = async (blob) =>
33
- Array.from(
34
- new Uint8Array(
35
- await subtle.digest('SHA-256', await blob.arrayBuffer()),
36
- ),
37
- )
38
- .map((b) => b.toString(16).padStart(2, '0'))
39
- .join('');
40
-
41
- const pkgVersion = pkg.version.split('-')[0];
42
-
43
- export async function getPkg({check = true, version = pkgVersion} = {}) {
44
- const PACKAGE = new URL(
45
- `/_apis/public/gallery/publishers/${PUBLISHER}/vsextensions/${EXTENSION}/${version}/vspackage`,
46
- BASE_URL,
47
- );
48
-
49
- /** @type {Blob?} */
50
- let vsix = null;
51
-
52
- if (process.env.DELANCE_VSIX) {
53
- try {
54
- vsix = new Blob([await fs.readFile(process.env.DELANCE_VSIX)]);
55
- if (check)
56
- assert.equal(
57
- await sha256(vsix),
58
- pkg.delance.sha256,
59
- 'sha256 mismatch',
60
- );
61
- } catch (e) {
62
- if (
63
- /** @type {Error & {syscall: string}} */ (e)?.syscall === 'open'
64
- ) {
65
- console.error(e);
66
- } else {
67
- throw e;
68
- }
69
- }
70
- }
71
-
72
- if (!vsix) {
73
- const {headers} = await fetch(ITEMS, INIT);
74
- const cookie = headers
75
- .getSetCookie()
76
- .map((c) => c.split(';', 2)[0])
77
- .join('; ');
78
-
79
- vsix = await retry(async () => {
80
- const response = await fetch(PACKAGE, {
81
- headers: {
82
- cookie,
83
- },
84
- redirect: 'follow',
85
- referrer: ITEMS.href,
86
- });
87
-
88
- if (response.status === 429) {
89
- const delay = response.headers.get('retry-after');
90
- if (delay) {
91
- throw new Error('Rate limited');
92
- }
93
- }
94
-
95
- if (!response.ok) {
96
- throw new AbortError(response.statusText);
97
- }
98
-
99
- const blob = await response.blob();
100
-
101
- if (check)
102
- try {
103
- assert.equal(
104
- await sha256(blob),
105
- pkg.delance.sha256,
106
- 'sha256 mismatch',
107
- );
108
- } catch (error) {
109
- if (error instanceof AssertionError) {
110
- throw new AbortError(error);
111
- }
112
- throw error;
113
- }
114
-
115
- return blob;
116
- });
117
- }
118
-
119
- return vsix;
120
- }
121
-
122
- export {pkg};