-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to latest aspect and compiler #138
Open
jtenner
wants to merge
3
commits into
lume:main
Choose a base branch
from
jtenner:upgrade-as
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ node_modules/ | |
*.lock | ||
dist/ | ||
*.wat | ||
*.wasm | ||
.vscode | ||
.DS_Store | ||
*.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"targets": { | ||
"coverage": { | ||
"lib": ["./node_modules/@as-covers/assembly/index.ts"], | ||
"transform": ["@as-covers/transform", "@as-pect/transform"] | ||
}, | ||
"noCoverage": { | ||
"transform": ["@as-pect/transform"] | ||
} | ||
}, | ||
"options": { | ||
"exportMemory": true, | ||
"outFile": "output.wasm", | ||
"textFile": "output.wat", | ||
"bindings": "raw", | ||
"exportStart": "_start", | ||
"exportRuntime": true, | ||
"use": ["RTRACE=1"], | ||
"debug": true, | ||
"exportTable": true | ||
}, | ||
"extends": "./asconfig.json", | ||
"entries": ["./node_modules/@as-pect/assembly/assembly/index.ts"] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { initASWebGLue } from 'aswebglue/src/ASWebGLue.js' | ||
|
||
///////////// Setup a fake document that allows creating canvases from which webgl contexts can be created. {{ | ||
|
||
import webgl from 'webgl-raub' | ||
import gflw from 'glfw-raub' | ||
const { Document } = gflw | ||
Document.setWebgl(webgl) | ||
|
||
const doc = new Document() | ||
global.document = global.window = doc | ||
|
||
// Trick ASWebGLue by returning a new canvas for any ID, since there is no real DOM. | ||
global.document.getElementById = () => { | ||
return document.createElement('canvas') | ||
} | ||
|
||
// }} | ||
|
||
export default { | ||
/** | ||
* A set of globs passed to the glob package that qualify typescript files for testing. | ||
*/ | ||
entries: ['src/as/index.spec.ts'], | ||
/** | ||
* A set of globs passed to the glob package that quality files to be added to each test. | ||
*/ | ||
include: ['src/as/**/*.include.ts'], | ||
/** | ||
* A set of regexp that will disclude source files from testing. | ||
*/ | ||
disclude: [/node_modules/], | ||
/** | ||
* Add your required AssemblyScript imports here. | ||
*/ | ||
async instantiate(memory, createImports, instantiate, binary) { | ||
const myImports = initASWebGLue({ | ||
env: { | ||
seed: Date.now, | ||
memory, | ||
'Date.now': Date.now.bind(Date), | ||
}, | ||
}) | ||
const { shouldLogAborts, setExports } = myImports | ||
|
||
const imports = createImports(myImports) | ||
const result = await instantiate(binary, imports) | ||
|
||
setExports(result.exports) | ||
shouldLogAborts(false) | ||
|
||
return result | ||
}, | ||
/** Enable code coverage. */ | ||
coverage: ['src/as/**/*.ts'], | ||
/** | ||
* Specify if the binary wasm file should be written to the file system. | ||
*/ | ||
outputBinary: false, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
{ | ||
"options": { | ||
"exportTable": true, | ||
"sourceMap": true | ||
"sourceMap": true, | ||
"bindings": "esm" | ||
}, | ||
|
||
"targets": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ | |
"test:verbose": "npm run asp -- --verbose", | ||
"test:trace": "npm run asp -- --verbose 2>&1 | grep \"\\[Fail\\]\" -A 5", | ||
"^// test:trace comment": "This shows only failed tests, along with a few stack traces lines if any", | ||
"asp": "xvfb-maybe asp --config=as-pect.config.cjs", | ||
"asp": "xvfb-maybe asp", | ||
"// ^ asp": "Running asp under xvfb-maybe allows a headless X11 server to be spawned in case there's no DISPLAY. This is needed for webgl-raub which will open a window with GLFW.", | ||
"/////////////////// BUILDS //////////////////////////": "", | ||
"build:as": "asc src/as/index.ts --config --target debug", | ||
|
@@ -44,30 +44,30 @@ | |
"prepare": "npm run build && npm rebuild --build-from-source gl" | ||
}, | ||
"dependencies": { | ||
"@assemblyscript/loader": "^0.19.3", | ||
"@as-pect/cli": "^7.0.7", | ||
"@assemblyscript/loader": "^0.21.3", | ||
"@lume/as-loader": "^0.18.10", | ||
"aswebglue": "lume/aswebglue#653897e69c6d7f74a7dcf71cdb5e4cea1d3f322d" | ||
}, | ||
"devDependencies": { | ||
"@as-pect/cli": "^6.2.4", | ||
"@types/node": "^15.12.4", | ||
"assemblyscript": "^0.19.3", | ||
"deasync": "^0.1.21", | ||
"glfw-raub": "^4.6.0", | ||
"live-server": "^1.2.1", | ||
"@types/node": "^18.7.14", | ||
"assemblyscript": "^0.21.3", | ||
"deasync": "^0.1.28", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, looks like we can remove some dependencies that were needed for |
||
"glfw-raub": "^4.6.2", | ||
"live-server": "^1.2.2", | ||
"make-dir-cli": "^3.0.0", | ||
"prettier": "^2.3.1", | ||
"prettier": "^2.7.1", | ||
"rimraf": "^3.0.2", | ||
"source-map-loader": "^3.0.0", | ||
"ts-loader": "^9.2.3", | ||
"ts-node": "^10.0.0", | ||
"tslib": "^2.3.0", | ||
"typescript": "^4.3.4", | ||
"webgl-raub": "^2.2.4", | ||
"webpack": "^5.40.0", | ||
"webpack-cli": "^4.7.2", | ||
"webpack-dev-server": "^3.11.2", | ||
"source-map-loader": "^4.0.0", | ||
"ts-loader": "^9.3.1", | ||
"ts-node": "^10.9.1", | ||
"tslib": "^2.4.0", | ||
"typescript": "^4.8.2", | ||
"webgl-raub": "^2.2.6", | ||
"webpack": "^5.74.0", | ||
"webpack-cli": "^4.10.0", | ||
"webpack-dev-server": "^4.10.1", | ||
"xvfb-maybe": "^0.2.1", | ||
"yaml": "^1.10.2" | ||
"yaml": "^2.1.1" | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a particular reason to move the cli to
dependencies
? Or just accidental?