@yabgu_gm/tensionscript 0.0.0-stage → 0.11.0

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 (117) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +97 -0
  3. package/README.md +156 -2
  4. package/bin/tensionscript.js +35 -0
  5. package/dist/asc.d.ts +4 -0
  6. package/dist/asc.generated.d.ts +12007 -0
  7. package/dist/asc.js +23474 -0
  8. package/dist/asc.js.map +7 -0
  9. package/dist/assemblyscript.d.ts +4 -0
  10. package/dist/assemblyscript.generated.d.ts +13221 -0
  11. package/dist/assemblyscript.js +337 -0
  12. package/dist/assemblyscript.js.map +7 -0
  13. package/dist/importmap.json +9 -0
  14. package/dist/transform.cjs +1 -0
  15. package/dist/transform.d.ts +1 -0
  16. package/dist/transform.js +1 -0
  17. package/dist/web.js +22 -0
  18. package/lib/binaryen.d.ts +2 -0
  19. package/lib/binaryen.js +2 -0
  20. package/package.json +116 -4
  21. package/std/README.md +6 -0
  22. package/std/assembly/array.ts +526 -0
  23. package/std/assembly/arraybuffer.ts +77 -0
  24. package/std/assembly/atomics.ts +127 -0
  25. package/std/assembly/bindings/asyncify.ts +16 -0
  26. package/std/assembly/bindings/dom.ts +291 -0
  27. package/std/assembly/bindings/node.ts +6 -0
  28. package/std/assembly/builtins.ts +2642 -0
  29. package/std/assembly/closures.ts +22 -0
  30. package/std/assembly/compat.ts +2 -0
  31. package/std/assembly/console.ts +42 -0
  32. package/std/assembly/crypto.ts +9 -0
  33. package/std/assembly/dataview.ts +181 -0
  34. package/std/assembly/date.ts +373 -0
  35. package/std/assembly/diagnostics.ts +11 -0
  36. package/std/assembly/error.ts +44 -0
  37. package/std/assembly/function.ts +38 -0
  38. package/std/assembly/index.d.ts +2721 -0
  39. package/std/assembly/iterator.ts +35 -0
  40. package/std/assembly/map.ts +260 -0
  41. package/std/assembly/math.ts +3289 -0
  42. package/std/assembly/memory.ts +123 -0
  43. package/std/assembly/number.ts +388 -0
  44. package/std/assembly/object.ts +36 -0
  45. package/std/assembly/performance.ts +9 -0
  46. package/std/assembly/polyfills.ts +27 -0
  47. package/std/assembly/process.ts +50 -0
  48. package/std/assembly/reference.ts +48 -0
  49. package/std/assembly/regexp.ts +12 -0
  50. package/std/assembly/rt/README.md +81 -0
  51. package/std/assembly/rt/common.ts +81 -0
  52. package/std/assembly/rt/index-incremental.ts +2 -0
  53. package/std/assembly/rt/index-minimal.ts +2 -0
  54. package/std/assembly/rt/index-stub.ts +1 -0
  55. package/std/assembly/rt/index.d.ts +37 -0
  56. package/std/assembly/rt/itcms.ts +419 -0
  57. package/std/assembly/rt/rtrace.ts +15 -0
  58. package/std/assembly/rt/stub.ts +133 -0
  59. package/std/assembly/rt/tcms.ts +254 -0
  60. package/std/assembly/rt/tlsf.ts +592 -0
  61. package/std/assembly/rt.ts +87 -0
  62. package/std/assembly/set.ts +220 -0
  63. package/std/assembly/shared/feature.ts +65 -0
  64. package/std/assembly/shared/runtime.ts +11 -0
  65. package/std/assembly/shared/target.ts +11 -0
  66. package/std/assembly/shared/tsconfig.json +11 -0
  67. package/std/assembly/shared/typeinfo.ts +72 -0
  68. package/std/assembly/staticarray.ts +401 -0
  69. package/std/assembly/string.ts +847 -0
  70. package/std/assembly/symbol.ts +114 -0
  71. package/std/assembly/table.ts +16 -0
  72. package/std/assembly/task-rt.ts +609 -0
  73. package/std/assembly/task.ts +90 -0
  74. package/std/assembly/tsconfig.json +6 -0
  75. package/std/assembly/typedarray.ts +1945 -0
  76. package/std/assembly/uri.ts +17 -0
  77. package/std/assembly/util/bytes.ts +135 -0
  78. package/std/assembly/util/casemap.ts +497 -0
  79. package/std/assembly/util/error.ts +54 -0
  80. package/std/assembly/util/hash.ts +117 -0
  81. package/std/assembly/util/math.ts +1922 -0
  82. package/std/assembly/util/memory.ts +290 -0
  83. package/std/assembly/util/number.ts +873 -0
  84. package/std/assembly/util/sort.ts +313 -0
  85. package/std/assembly/util/string.ts +1202 -0
  86. package/std/assembly/util/uri.ts +275 -0
  87. package/std/assembly/vector.ts +4 -0
  88. package/std/assembly.json +16 -0
  89. package/std/portable/index.d.ts +462 -0
  90. package/std/portable/index.js +416 -0
  91. package/std/portable.json +11 -0
  92. package/std/types/assembly/index.d.ts +1 -0
  93. package/std/types/assembly/package.json +3 -0
  94. package/std/types/portable/index.d.ts +1 -0
  95. package/std/types/portable/package.json +3 -0
  96. package/tsconfig-base.json +13 -0
  97. package/util/README.md +23 -0
  98. package/util/browser/fs.js +1 -0
  99. package/util/browser/module.js +5 -0
  100. package/util/browser/path.js +520 -0
  101. package/util/browser/process.js +59 -0
  102. package/util/browser/url.js +23 -0
  103. package/util/cpu.d.ts +9 -0
  104. package/util/cpu.js +42 -0
  105. package/util/find.d.ts +6 -0
  106. package/util/find.js +20 -0
  107. package/util/node.d.ts +21 -0
  108. package/util/node.js +34 -0
  109. package/util/options.d.ts +70 -0
  110. package/util/options.js +262 -0
  111. package/util/terminal.d.ts +52 -0
  112. package/util/terminal.js +35 -0
  113. package/util/text.d.ts +26 -0
  114. package/util/text.js +114 -0
  115. package/util/tsconfig.json +9 -0
  116. package/util/web.d.ts +11 -0
  117. package/util/web.js +33 -0
@@ -0,0 +1,9 @@
1
+ {
2
+ "imports": {
3
+ "@yabgu_gm/tensionscript": "https://cdn.jsdelivr.net/npm/@yabgu_gm/tensionscript@0.11.0/dist/assemblyscript.js",
4
+ "@yabgu_gm/tensionscript/asc": "https://cdn.jsdelivr.net/npm/@yabgu_gm/tensionscript@0.11.0/dist/asc.js",
5
+ "binaryen": "https://cdn.jsdelivr.net/npm/binaryen@131.0.0-nightly.20260721/index.js",
6
+ "long": "https://cdn.jsdelivr.net/npm/long@5.3.2/index.js"
7
+ }
8
+ }
9
+
@@ -0,0 +1 @@
1
+ module.exports = class Transform { /* stub */ };
@@ -0,0 +1 @@
1
+ export { Transform } from "./asc";
@@ -0,0 +1 @@
1
+ export class Transform { /* stub */ };
package/dist/web.js ADDED
@@ -0,0 +1,22 @@
1
+ var TENSIONSCRIPT_VERSION = "0.11.0";
2
+ var TENSIONSCRIPT_IMPORTMAP = {
3
+ "imports": {
4
+ "@yabgu_gm/tensionscript": "https://cdn.jsdelivr.net/npm/@yabgu_gm/tensionscript@0.11.0/dist/assemblyscript.js",
5
+ "@yabgu_gm/tensionscript/asc": "https://cdn.jsdelivr.net/npm/@yabgu_gm/tensionscript@0.11.0/dist/asc.js",
6
+ "binaryen": "https://cdn.jsdelivr.net/npm/binaryen@131.0.0-nightly.20260721/index.js",
7
+ "long": "https://cdn.jsdelivr.net/npm/long@5.3.2/index.js"
8
+ }
9
+ };
10
+ if (!document.currentScript.src.includes("noinstall")) {
11
+ let elem = document.createElement("script");
12
+ elem.type = "importmap";
13
+ elem.text = JSON.stringify(TENSIONSCRIPT_IMPORTMAP);
14
+ document.head.appendChild(elem);
15
+ }
16
+ if (!document.currentScript.src.includes("noshim")) {
17
+ let elem = document.createElement("script");
18
+ elem.async = true;
19
+ elem.src = "https://cdn.jsdelivr.net/npm/es-module-shims@1/dist/es-module-shims.wasm.min.js";
20
+ document.head.appendChild(elem);
21
+ }
22
+
@@ -0,0 +1,2 @@
1
+ export * from "binaryen";
2
+ export { default } from "binaryen";
@@ -0,0 +1,2 @@
1
+ export * from "binaryen";
2
+ export { default } from "binaryen";
package/package.json CHANGED
@@ -1,6 +1,118 @@
1
1
  {
2
2
  "name": "@yabgu_gm/tensionscript",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "description": "TensionScript: a TypeScript-shaped language for WebAssembly, forked from AssemblyScript for the Tension engine.",
4
+ "keywords": [
5
+ "typescript",
6
+ "webassembly",
7
+ "compiler",
8
+ "tensionscript",
9
+ "wasm"
10
+ ],
11
+ "version": "0.11.0",
12
+ "author": "Daniel Wirtz <dcode+assemblyscript@dcode.io>",
13
+ "license": "Apache-2.0",
14
+ "homepage": "https://github.com/Yabgu/Tension",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/Yabgu/TensionScript.git"
18
+ },
19
+ "bugs": {
20
+ "url": "https://github.com/Yabgu/TensionScript/issues"
21
+ },
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "engines": {
26
+ "node": ">=20",
27
+ "npm": ">=10"
28
+ },
29
+ "engineStrict": true,
30
+ "dependencies": {
31
+ "binaryen": "131.0.0-nightly.20260721",
32
+ "long": "^5.2.4"
33
+ },
34
+ "devDependencies": {
35
+ "@eslint/js": "^10.0.1",
36
+ "@types/node": "^26.1.1",
37
+ "as-float": "^1.0.1",
38
+ "diff": "^9.0.0",
39
+ "esbuild": "^0.28.1",
40
+ "eslint": "^10.7.0",
41
+ "glob": "^13.0.6",
42
+ "globals": "^17.7.0",
43
+ "typescript": "^6.0.3",
44
+ "typescript-eslint": "^8.65.0"
45
+ },
46
+ "type": "module",
47
+ "exports": {
48
+ ".": {
49
+ "import": "./dist/assemblyscript.js",
50
+ "types": "./dist/assemblyscript.d.ts"
51
+ },
52
+ "./asc": {
53
+ "import": "./dist/asc.js",
54
+ "types": "./dist/asc.d.ts"
55
+ },
56
+ "./transform": {
57
+ "import": "./dist/transform.js",
58
+ "types": "./dist/transform.d.ts",
59
+ "require": "./dist/transform.cjs"
60
+ },
61
+ "./binaryen": {
62
+ "import": "./lib/binaryen.js",
63
+ "types": "./lib/binaryen.d.ts"
64
+ },
65
+ "./*": "./*"
66
+ },
67
+ "imports": {
68
+ "#rtrace": {
69
+ "import": "./lib/rtrace/index.js",
70
+ "types": "./lib/rtrace/index.d.ts"
71
+ }
72
+ },
73
+ "bin": {
74
+ "tensionscript": "./bin/tensionscript.js"
75
+ },
76
+ "scripts": {
77
+ "check": "npm run check:config && npm run check:import && npm run lint",
78
+ "check:config": "tsc --noEmit -p src --diagnostics --listFiles",
79
+ "check:import": "tsc --noEmit --skipLibCheck --target ESNEXT --module nodenext --moduleResolution nodenext --experimentalDecorators tests/import/index",
80
+ "lint": "eslint --max-warnings 0 --ext js . && eslint --max-warnings 0 --ext ts .",
81
+ "build": "node scripts/build",
82
+ "watch": "node scripts/build --watch",
83
+ "coverage": "npx c8 -- npm test",
84
+ "pretest": "npm run check",
85
+ "test": "npm run test:parser && npm run test:flags && npm run test:async && npm run test:closure && npm run test:compiler -- --parallel && npm run test:browser && npm run test:asconfig && npm run test:transform && npm run test:cli",
86
+ "test:parser": "node --enable-source-maps tests/parser",
87
+ "test:flags": "node --enable-source-maps tests/flags.js",
88
+ "test:async": "node --enable-source-maps tests/async/resolver.js && node --enable-source-maps tests/async/lower.js && node --enable-source-maps tests/async/runtime.js",
89
+ "test:compiler": "node --enable-source-maps --no-warnings tests/compiler",
90
+ "test:browser": "node --enable-source-maps tests/browser",
91
+ "test:asconfig": "cd tests/asconfig && npm run test",
92
+ "test:transform": "npm run test:transform:esm && npm run test:transform:cjs",
93
+ "test:transform:esm": "node bin/tensionscript.js tests/compiler/empty --transform ./tests/transform/index.js --noEmit && node bin/tensionscript.js tests/compiler/empty --transform ./tests/transform/simple.js --noEmit",
94
+ "test:transform:cjs": "node bin/tensionscript.js tests/compiler/empty --transform ./tests/transform/cjs/index.js --noEmit && node bin/tensionscript.js tests/compiler/empty --transform ./tests/transform/cjs/simple.js --noEmit",
95
+ "test:cli": "node tests/cli/options.js",
96
+ "asbuild": "npm run asbuild:debug && npm run asbuild:release",
97
+ "asbuild:debug": "node bin/tensionscript.js --config src/asconfig.json --target debug",
98
+ "asbuild:release": "node bin/tensionscript.js --config src/asconfig.json --target release",
99
+ "asbuild:rtraced": "node bin/tensionscript.js --config src/asconfig.json --target rtraced",
100
+ "bootstrap": "npm run bootstrap:debug && npm run bootstrap:release",
101
+ "bootstrap:debug": "node bin/tensionscript.js --config src/asconfig.json --target debug && node bin/tensionscript.js --config src/asconfig.json --target debug-bootstrap --wasm ./build/assemblyscript.debug.js && node bin/tensionscript.js --config src/asconfig.json --target debug-bootstrap --wasm ./build/assemblyscript.debug-bootstrap.js && git --no-pager diff --no-index build/assemblyscript.debug.wast build/assemblyscript.debug-bootstrap.wast",
102
+ "bootstrap:release": "node bin/tensionscript.js --config src/asconfig.json --target release && node bin/tensionscript.js --config src/asconfig.json --target release-bootstrap --wasm ./build/assemblyscript.release.js && node bin/tensionscript.js --config src/asconfig.json --target release-bootstrap --wasm ./build/assemblyscript.release-bootstrap.js && git --no-pager diff --no-index build/assemblyscript.release.wast build/assemblyscript.release-bootstrap.wast",
103
+ "bootstrap:rtraced": "node bin/tensionscript.js --config src/asconfig.json --target rtraced && node bin/tensionscript.js --config src/asconfig.json --target rtraced --wasm ./build/assemblyscript.rtraced.js",
104
+ "test:closure": "node --enable-source-maps tests/closure/lower.js",
105
+ "prepublishOnly": "npm run build && npm run publish:verify",
106
+ "publish:verify": "node scripts/verify-dist.js"
107
+ },
108
+ "files": [
109
+ "bin/",
110
+ "dist/",
111
+ "std/",
112
+ "util/",
113
+ "lib/binaryen.js",
114
+ "lib/binaryen.d.ts",
115
+ "tsconfig-base.json",
116
+ "NOTICE"
117
+ ]
118
+ }
package/std/README.md ADDED
@@ -0,0 +1,6 @@
1
+ Standard library
2
+ ================
3
+
4
+ Standard library components for use with `tsc` (portable) and `tensionscript` (assembly).
5
+
6
+ Base configurations (.json) and definition files (.d.ts) are relevant to `tsc` only and not used by `tensionscript`.