-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feature/wasm pack #10
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
fa42a89
starting wasm feature
maebli ea594d3
fixing clippy error
maebli 2bdaf58
moving module up
maebli 6270206
wasm looking better
maebli 9ee8af9
improving "full parse" function to be re-used in wasm and also in cli
maebli c0262b8
using serde in main package now and successfully used in wasm
maebli a9423f5
fixing serde feature naming
maebli 1eabe9e
removing wee_alloc
maebli a44fed4
adding a web page parser
maebli 9d6bb1d
adjusting pipeline
maebli 055ee5c
adding wasm pack
maebli 233bccc
adding some files that were missing
maebli e4553bb
removing test that does not work
maebli 6632f48
fixing clippy warning in wasm pack
maebli 90b287d
removing leftover weealoc
maebli a1afd3b
bumping version for release
maebli ba1a73f
fixing pipeline
maebli 02af844
finally found why tag triggers not working
maebli daa096c
trying again to npm publish
maebli f262ecc
Minor code style fixes
SarthakSingh31 ba31ea3
Moved the profile for wasm crate to root Cargo.toml
SarthakSingh31 f9a50e2
Merge pull request #11 from SarthakSingh31/sar/feature/wasm-pack
maebli e69bd71
removing dead code
maebli 22949fb
trying again to publish to npm
maebli 4b9e1d5
next attempt
maebli 4d7107d
trying again
maebli 2a14d94
adding possibly missing npm install
maebli e0ebf64
fixing last step
maebli 1e899ed
adding permissions
maebli 373a6c3
adding documentation
maebli 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
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
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
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
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,122 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>Wired M-Bus Parser</title> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.0/styles/default.min.css"> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.0/highlight.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.0/languages/json.min.js"></script> | ||
<style> | ||
body { | ||
font-family: Arial, sans-serif; | ||
margin: 0; | ||
padding: 20px; | ||
background-color: #ffffff; | ||
} | ||
|
||
.header { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
margin-bottom: 20px; | ||
} | ||
|
||
.header img { | ||
margin-right: 10px; | ||
} | ||
|
||
h1 { | ||
color: #333; | ||
margin: 0; | ||
} | ||
|
||
form { | ||
background: #fff; | ||
padding: 20px; | ||
border-radius: 8px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
max-width: 600px; | ||
margin: 0 auto; | ||
} | ||
|
||
label { | ||
display: block; | ||
margin-bottom: 8px; | ||
font-weight: bold; | ||
} | ||
|
||
textarea { | ||
width: 100%; | ||
padding: 10px; | ||
border: 1px solid #ddd; | ||
border-radius: 4px; | ||
box-sizing: border-box; | ||
margin-bottom: 10px; | ||
font-family: monospace; | ||
} | ||
|
||
input[type="button"] { | ||
background-color: #4CAF50; | ||
color: white; | ||
padding: 10px 20px; | ||
border: none; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
} | ||
|
||
input[type="button"]:hover { | ||
background-color: #45a049; | ||
} | ||
|
||
pre { | ||
background: #f0f0f0; | ||
padding: 10px; | ||
border-radius: 4px; | ||
white-space: pre-wrap; | ||
word-wrap: break-word; | ||
} | ||
|
||
#output { | ||
margin-top: 20px; | ||
max-width: 600px; | ||
margin: 20px auto 0; | ||
padding: 20px; | ||
border-radius: 8px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div class="header"> | ||
<img id="banner" src="meter.png" alt="Meter Banner"> | ||
<h1>Wired M-Bus Parser with WASM</h1> | ||
</div> | ||
<form> | ||
<label for="inputstring">Input String:</label> | ||
<textarea rows="5" cols="80" id="inputstring"></textarea> | ||
<input id="m_bus_parse" type="button" value="Parse JSON" /> | ||
</form> | ||
<pre id="output"></pre> | ||
<script type="module"> | ||
import init, { m_bus_parse } from "./m_bus_parser_wasm_pack.js"; | ||
|
||
async function setup() { | ||
await init(); // Ensure the WASM module is initialized | ||
|
||
document.getElementById('m_bus_parse').addEventListener('click', () => { | ||
const inputString = document.getElementById('inputstring').value; | ||
const result = m_bus_parse(inputString); | ||
const formattedResult = JSON.stringify(JSON.parse(result), null, 2); // Pretty-print the JSON | ||
const outputElement = document.getElementById("output"); | ||
outputElement.textContent = formattedResult; | ||
hljs.highlightElement(outputElement); // Apply syntax highlighting | ||
}); | ||
} | ||
|
||
setup(); // Set up the event listeners after the page is loaded | ||
</script> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.
Oops, something went wrong.
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.
you don't need to say
optional = false
. It has no effect so you can leave it.