@tailwindcss/oxide-wasm32-wasi 0.0.0-insiders.d801d8d

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 (113) hide show
  1. package/README.md +3 -0
  2. package/node_modules/@emnapi/core/LICENSE +21 -0
  3. package/node_modules/@emnapi/core/README.md +1 -0
  4. package/node_modules/@emnapi/core/dist/emnapi-core.cjs.js +6661 -0
  5. package/node_modules/@emnapi/core/dist/emnapi-core.cjs.min.d.ts +363 -0
  6. package/node_modules/@emnapi/core/dist/emnapi-core.cjs.min.js +1 -0
  7. package/node_modules/@emnapi/core/dist/emnapi-core.d.mts +363 -0
  8. package/node_modules/@emnapi/core/dist/emnapi-core.d.ts +365 -0
  9. package/node_modules/@emnapi/core/dist/emnapi-core.esm-bundler.js +7411 -0
  10. package/node_modules/@emnapi/core/dist/emnapi-core.js +8390 -0
  11. package/node_modules/@emnapi/core/dist/emnapi-core.min.d.mts +363 -0
  12. package/node_modules/@emnapi/core/dist/emnapi-core.min.js +1 -0
  13. package/node_modules/@emnapi/core/dist/emnapi-core.min.mjs +1 -0
  14. package/node_modules/@emnapi/core/dist/emnapi-core.mjs +6650 -0
  15. package/node_modules/@emnapi/core/index.js +5 -0
  16. package/node_modules/@emnapi/core/package.json +49 -0
  17. package/node_modules/@emnapi/runtime/LICENSE +21 -0
  18. package/node_modules/@emnapi/runtime/README.md +1 -0
  19. package/node_modules/@emnapi/runtime/dist/emnapi.cjs.js +1347 -0
  20. package/node_modules/@emnapi/runtime/dist/emnapi.cjs.min.d.ts +663 -0
  21. package/node_modules/@emnapi/runtime/dist/emnapi.cjs.min.js +1 -0
  22. package/node_modules/@emnapi/runtime/dist/emnapi.d.mts +663 -0
  23. package/node_modules/@emnapi/runtime/dist/emnapi.d.ts +665 -0
  24. package/node_modules/@emnapi/runtime/dist/emnapi.esm-bundler.js +1403 -0
  25. package/node_modules/@emnapi/runtime/dist/emnapi.iife.d.ts +420 -0
  26. package/node_modules/@emnapi/runtime/dist/emnapi.iife.js +1474 -0
  27. package/node_modules/@emnapi/runtime/dist/emnapi.js +1475 -0
  28. package/node_modules/@emnapi/runtime/dist/emnapi.min.d.mts +663 -0
  29. package/node_modules/@emnapi/runtime/dist/emnapi.min.js +1 -0
  30. package/node_modules/@emnapi/runtime/dist/emnapi.min.mjs +1 -0
  31. package/node_modules/@emnapi/runtime/dist/emnapi.mjs +1316 -0
  32. package/node_modules/@emnapi/runtime/index.js +5 -0
  33. package/node_modules/@emnapi/runtime/package.json +48 -0
  34. package/node_modules/@emnapi/wasi-threads/LICENSE +21 -0
  35. package/node_modules/@emnapi/wasi-threads/README.md +203 -0
  36. package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.cjs.js +881 -0
  37. package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.cjs.min.d.ts +214 -0
  38. package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.cjs.min.js +1 -0
  39. package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.d.mts +214 -0
  40. package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.d.ts +216 -0
  41. package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.esm-bundler.js +929 -0
  42. package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.js +941 -0
  43. package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.min.d.mts +214 -0
  44. package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.min.js +1 -0
  45. package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.min.mjs +1 -0
  46. package/node_modules/@emnapi/wasi-threads/dist/wasi-threads.mjs +876 -0
  47. package/node_modules/@emnapi/wasi-threads/index.js +5 -0
  48. package/node_modules/@emnapi/wasi-threads/package.json +50 -0
  49. package/node_modules/@napi-rs/wasm-runtime/LICENSE +43 -0
  50. package/node_modules/@napi-rs/wasm-runtime/dist/fs.js +23712 -0
  51. package/node_modules/@napi-rs/wasm-runtime/dist/runtime.js +12269 -0
  52. package/node_modules/@napi-rs/wasm-runtime/fs-proxy.cjs +193 -0
  53. package/node_modules/@napi-rs/wasm-runtime/package.json +60 -0
  54. package/node_modules/@napi-rs/wasm-runtime/runtime.cjs +15 -0
  55. package/node_modules/@tybys/wasm-util/README.md +193 -0
  56. package/node_modules/@tybys/wasm-util/dist/tsdoc-metadata.json +11 -0
  57. package/node_modules/@tybys/wasm-util/dist/wasm-util.d.ts +417 -0
  58. package/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.js +2738 -0
  59. package/node_modules/@tybys/wasm-util/dist/wasm-util.esm.js +2738 -0
  60. package/node_modules/@tybys/wasm-util/dist/wasm-util.esm.min.js +1 -0
  61. package/node_modules/@tybys/wasm-util/dist/wasm-util.js +2760 -0
  62. package/node_modules/@tybys/wasm-util/dist/wasm-util.min.js +1 -0
  63. package/node_modules/@tybys/wasm-util/lib/cjs/asyncify.js +158 -0
  64. package/node_modules/@tybys/wasm-util/lib/cjs/index.js +13 -0
  65. package/node_modules/@tybys/wasm-util/lib/cjs/jspi.js +46 -0
  66. package/node_modules/@tybys/wasm-util/lib/cjs/load.js +97 -0
  67. package/node_modules/@tybys/wasm-util/lib/cjs/memory.js +35 -0
  68. package/node_modules/@tybys/wasm-util/lib/cjs/wasi/error.js +103 -0
  69. package/node_modules/@tybys/wasm-util/lib/cjs/wasi/fd.js +268 -0
  70. package/node_modules/@tybys/wasm-util/lib/cjs/wasi/fs.js +3 -0
  71. package/node_modules/@tybys/wasm-util/lib/cjs/wasi/index.js +194 -0
  72. package/node_modules/@tybys/wasm-util/lib/cjs/wasi/path.js +174 -0
  73. package/node_modules/@tybys/wasm-util/lib/cjs/wasi/preview1.js +1544 -0
  74. package/node_modules/@tybys/wasm-util/lib/cjs/wasi/rights.js +141 -0
  75. package/node_modules/@tybys/wasm-util/lib/cjs/wasi/types.js +220 -0
  76. package/node_modules/@tybys/wasm-util/lib/cjs/wasi/util.js +128 -0
  77. package/node_modules/@tybys/wasm-util/lib/cjs/webassembly.js +13 -0
  78. package/node_modules/@tybys/wasm-util/lib/mjs/asyncify.mjs +153 -0
  79. package/node_modules/@tybys/wasm-util/lib/mjs/index.mjs +9 -0
  80. package/node_modules/@tybys/wasm-util/lib/mjs/jspi.mjs +39 -0
  81. package/node_modules/@tybys/wasm-util/lib/mjs/load.mjs +89 -0
  82. package/node_modules/@tybys/wasm-util/lib/mjs/memory.mjs +28 -0
  83. package/node_modules/@tybys/wasm-util/lib/mjs/wasi/error.mjs +97 -0
  84. package/node_modules/@tybys/wasm-util/lib/mjs/wasi/fd.mjs +256 -0
  85. package/node_modules/@tybys/wasm-util/lib/mjs/wasi/fs.mjs +1 -0
  86. package/node_modules/@tybys/wasm-util/lib/mjs/wasi/index.mjs +188 -0
  87. package/node_modules/@tybys/wasm-util/lib/mjs/wasi/path.mjs +168 -0
  88. package/node_modules/@tybys/wasm-util/lib/mjs/wasi/preview1.mjs +1539 -0
  89. package/node_modules/@tybys/wasm-util/lib/mjs/wasi/rights.mjs +135 -0
  90. package/node_modules/@tybys/wasm-util/lib/mjs/wasi/types.mjs +216 -0
  91. package/node_modules/@tybys/wasm-util/lib/mjs/wasi/util.mjs +113 -0
  92. package/node_modules/@tybys/wasm-util/lib/mjs/webassembly.mjs +9 -0
  93. package/node_modules/@tybys/wasm-util/package.json +58 -0
  94. package/node_modules/tslib/CopyrightNotice.txt +15 -0
  95. package/node_modules/tslib/LICENSE.txt +12 -0
  96. package/node_modules/tslib/README.md +164 -0
  97. package/node_modules/tslib/SECURITY.md +41 -0
  98. package/node_modules/tslib/modules/index.d.ts +38 -0
  99. package/node_modules/tslib/modules/index.js +70 -0
  100. package/node_modules/tslib/modules/package.json +3 -0
  101. package/node_modules/tslib/package.json +47 -0
  102. package/node_modules/tslib/tslib.d.ts +460 -0
  103. package/node_modules/tslib/tslib.es6.html +1 -0
  104. package/node_modules/tslib/tslib.es6.js +393 -0
  105. package/node_modules/tslib/tslib.es6.mjs +392 -0
  106. package/node_modules/tslib/tslib.html +1 -0
  107. package/node_modules/tslib/tslib.js +475 -0
  108. package/package.json +45 -0
  109. package/tailwindcss-oxide.wasi-browser.js +63 -0
  110. package/tailwindcss-oxide.wasi.cjs +88 -0
  111. package/tailwindcss-oxide.wasm32-wasi.wasm +0 -0
  112. package/wasi-worker-browser.mjs +39 -0
  113. package/wasi-worker.mjs +63 -0
@@ -0,0 +1,5 @@
1
+ if (typeof process !== 'undefined' && process.env.NODE_ENV === 'production') {
2
+ module.exports = require('./dist/emnapi.cjs.min.js')
3
+ } else {
4
+ module.exports = require('./dist/emnapi.cjs.js')
5
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@emnapi/runtime",
3
+ "version": "1.4.0",
4
+ "description": "emnapi runtime",
5
+ "main": "index.js",
6
+ "module": "./dist/emnapi.esm-bundler.js",
7
+ "types": "./dist/emnapi.d.ts",
8
+ "sideEffects": false,
9
+ "exports": {
10
+ ".": {
11
+ "types": {
12
+ "module": "./dist/emnapi.d.ts",
13
+ "import": "./dist/emnapi.d.mts",
14
+ "default": "./dist/emnapi.d.ts"
15
+ },
16
+ "module": "./dist/emnapi.esm-bundler.js",
17
+ "import": "./dist/emnapi.mjs",
18
+ "default": "./index.js"
19
+ },
20
+ "./dist/emnapi.cjs.min": {
21
+ "types": "./dist/emnapi.d.ts",
22
+ "default": "./dist/emnapi.cjs.min.js"
23
+ },
24
+ "./dist/emnapi.min.mjs": {
25
+ "types": "./dist/emnapi.d.mts",
26
+ "default": "./dist/emnapi.min.mjs"
27
+ }
28
+ },
29
+ "dependencies": {
30
+ "tslib": "^2.4.0"
31
+ },
32
+ "scripts": {
33
+ "build": "node ./script/build.js"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/toyobayashi/emnapi.git"
38
+ },
39
+ "author": "toyobayashi",
40
+ "license": "MIT",
41
+ "bugs": {
42
+ "url": "https://github.com/toyobayashi/emnapi/issues"
43
+ },
44
+ "homepage": "https://github.com/toyobayashi/emnapi#readme",
45
+ "publishConfig": {
46
+ "access": "public"
47
+ }
48
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021-present Toyobayashi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,203 @@
1
+ # @emnapi/wasi-threads
2
+
3
+ This package makes [wasi-threads proposal](https://github.com/WebAssembly/wasi-threads) based WASI modules work in Node.js and browser.
4
+
5
+ ## Quick Start
6
+
7
+ `index.html`
8
+
9
+ ```html
10
+ <script src="./node_modules/@tybys/wasm-util/dist/wasm-util.js"></script>
11
+ <script src="./node_modules/@emnapi/wasi-threads/dist/wasi-threads.js"></script>
12
+ <script src="./index.js"></script>
13
+ ```
14
+
15
+ If your application will block browser main thread (for example `pthread_join`), please run it in worker instead.
16
+
17
+ ```html
18
+ <script>
19
+ // pthread_join (Atomics.wait) cannot be called in browser main thread
20
+ new Worker('./index.js')
21
+ </script>
22
+ ```
23
+
24
+ `index.js`
25
+
26
+ ```js
27
+ const ENVIRONMENT_IS_NODE =
28
+ typeof process === 'object' && process !== null &&
29
+ typeof process.versions === 'object' && process.versions !== null &&
30
+ typeof process.versions.node === 'string';
31
+
32
+ (function (main) {
33
+ if (ENVIRONMENT_IS_NODE) {
34
+ main(require)
35
+ } else {
36
+ if (typeof importScripts === 'function') {
37
+ importScripts('./node_modules/@tybys/wasm-util/dist/wasm-util.js')
38
+ importScripts('./node_modules/@emnapi/wasi-threads/dist/wasi-threads.js')
39
+ }
40
+ const nodeWasi = { WASI: globalThis.wasmUtil.WASI }
41
+ const nodeWorkerThreads = {
42
+ Worker: globalThis.Worker
43
+ }
44
+ const _require = function (request) {
45
+ if (request === 'node:wasi' || request === 'wasi') return nodeWasi
46
+ if (request === 'node:worker_threads' || request === 'worker_threads') return nodeWorkerThreads
47
+ if (request === '@emnapi/wasi-threads') return globalThis.wasiThreads
48
+ throw new Error('Can not find module: ' + request)
49
+ }
50
+ main(_require)
51
+ }
52
+ })(async function (require) {
53
+ const { WASI } = require('wasi')
54
+ const { Worker } = require('worker_threads')
55
+ const { WASIThreads } = require('@emnapi/wasi-threads')
56
+
57
+ const wasi = new WASI({
58
+ version: 'preview1'
59
+ })
60
+ const wasiThreads = new WASIThreads({
61
+ wasi,
62
+
63
+ /**
64
+ * avoid Atomics.wait() deadlock during thread creation in browser
65
+ * see https://emscripten.org/docs/tools_reference/settings_reference.html#pthread-pool-size
66
+ */
67
+ reuseWorker: ENVIRONMENT_IS_NODE
68
+ ? false
69
+ : {
70
+ size: 4 /** greater than actual needs (2) */,
71
+ strict: true
72
+ },
73
+
74
+ /**
75
+ * Synchronous thread creation
76
+ * pthread_create will not return until thread worker actually starts
77
+ */
78
+ waitThreadStart: typeof window === 'undefined' ? 1000 : false,
79
+
80
+ onCreateWorker: () => {
81
+ return new Worker('./worker.js', {
82
+ execArgv: ['--experimental-wasi-unstable-preview1']
83
+ })
84
+ }
85
+ })
86
+ const memory = new WebAssembly.Memory({
87
+ initial: 16777216 / 65536,
88
+ maximum: 2147483648 / 65536,
89
+ shared: true
90
+ })
91
+ let input
92
+ const file = 'path/to/your/wasi-module.wasm'
93
+ try {
94
+ input = require('fs').readFileSync(require('path').join(__dirname, file))
95
+ } catch (err) {
96
+ const response = await fetch(file)
97
+ input = await response.arrayBuffer()
98
+ }
99
+ let { module, instance } = await WebAssembly.instantiate(input, {
100
+ env: { memory },
101
+ wasi_snapshot_preview1: wasi.wasiImport,
102
+ ...wasiThreads.getImportObject()
103
+ })
104
+
105
+ wasiThreads.setup(instance, module, memory)
106
+ await wasiThreads.preloadWorkers()
107
+
108
+ if (typeof instance.exports._start === 'function') {
109
+ return wasi.start(instance)
110
+ } else {
111
+ wasi.initialize(instance)
112
+ // instance.exports.exported_wasm_function()
113
+ }
114
+ })
115
+ ```
116
+
117
+ `worker.js`
118
+
119
+ ```js
120
+ (function (main) {
121
+ const ENVIRONMENT_IS_NODE =
122
+ typeof process === 'object' && process !== null &&
123
+ typeof process.versions === 'object' && process.versions !== null &&
124
+ typeof process.versions.node === 'string'
125
+
126
+ if (ENVIRONMENT_IS_NODE) {
127
+ const _require = function (request) {
128
+ return require(request)
129
+ }
130
+
131
+ const _init = function () {
132
+ const nodeWorkerThreads = require('worker_threads')
133
+ const parentPort = nodeWorkerThreads.parentPort
134
+
135
+ parentPort.on('message', (data) => {
136
+ globalThis.onmessage({ data })
137
+ })
138
+
139
+ Object.assign(globalThis, {
140
+ self: globalThis,
141
+ require,
142
+ Worker: nodeWorkerThreads.Worker,
143
+ importScripts: function (f) {
144
+ (0, eval)(require('fs').readFileSync(f, 'utf8') + '//# sourceURL=' + f)
145
+ },
146
+ postMessage: function (msg) {
147
+ parentPort.postMessage(msg)
148
+ }
149
+ })
150
+ }
151
+
152
+ main(_require, _init)
153
+ } else {
154
+ importScripts('./node_modules/@tybys/wasm-util/dist/wasm-util.js')
155
+ importScripts('./node_modules/@emnapi/wasi-threads/dist/wasi-threads.js')
156
+
157
+ const nodeWasi = { WASI: globalThis.wasmUtil.WASI }
158
+ const _require = function (request) {
159
+ if (request === '@emnapi/wasi-threads') return globalThis.wasiThreads
160
+ if (request === 'node:wasi' || request === 'wasi') return nodeWasi
161
+ throw new Error('Can not find module: ' + request)
162
+ }
163
+ const _init = function () {}
164
+ main(_require, _init)
165
+ }
166
+ })(function main (require, init) {
167
+ init()
168
+
169
+ const { WASI } = require('wasi')
170
+ const { ThreadMessageHandler, WASIThreads } = require('@emnapi/wasi-threads')
171
+
172
+ const handler = new ThreadMessageHandler({
173
+ async onLoad ({ wasmModule, wasmMemory }) {
174
+ const wasi = new WASI({
175
+ version: 'preview1'
176
+ })
177
+
178
+ const wasiThreads = new WASIThreads({
179
+ wasi,
180
+ childThread: true
181
+ })
182
+
183
+ const originalInstance = await WebAssembly.instantiate(wasmModule, {
184
+ env: {
185
+ memory: wasmMemory,
186
+ },
187
+ wasi_snapshot_preview1: wasi.wasiImport,
188
+ ...wasiThreads.getImportObject()
189
+ })
190
+
191
+ // must call `initialize` instead of `start` in child thread
192
+ const instance = wasiThreads.initialize(originalInstance, wasmModule, wasmMemory)
193
+
194
+ return { module: wasmModule, instance }
195
+ }
196
+ })
197
+
198
+ globalThis.onmessage = function (e) {
199
+ handler.handle(e)
200
+ // handle other messages
201
+ }
202
+ })
203
+ ```