Skip to content

Commit

Permalink
test: add wasm example case
Browse files Browse the repository at this point in the history
  • Loading branch information
fz6m committed Nov 10, 2023
1 parent 7f82d26 commit 103ba2c
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 1 deletion.
2 changes: 2 additions & 0 deletions example-wasm/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
side-effects-cache=false
reporter=append-only
18 changes: 18 additions & 0 deletions example-wasm/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const assert = require('assert')
const { existsSync } = require('fs')
const { parseAsync } = require('rs-module-lexer')

const r = async () => {
assert(existsSync(require.resolve('@xn-sakina/rml-wasm')))
const result = await parseAsync({
input: [
{
filename: 'index.ts',
code: `import a from 'ss'`,
},
],
})
console.log('result: ', result)
}

r()
17 changes: 17 additions & 0 deletions example-wasm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "wasm-demo",
"version": "1.0.0",
"private": true,
"scripts": {
"test": "node ./index.js"
},
"pnpm": {
"supportedArchitectures": {
"os": ["unknown"],
"cpu": ["x64"]
}
},
"devDependencies": {
"rs-module-lexer": "^2.1.1"
}
}
132 changes: 132 additions & 0 deletions example-wasm/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions example-wasm/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- ./
2 changes: 1 addition & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
packages:
- ./
- ./example
- ./example

0 comments on commit 103ba2c

Please sign in to comment.