-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add data-target-path to the copy-file action
- Loading branch information
Showing
18 changed files
with
363 additions
and
23 deletions.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,10 @@ | ||
[package] | ||
name = "vanilla-example" | ||
version = "0.1.0" | ||
authors = ["Jens Reimann <[email protected]>"] | ||
edition = "2021" | ||
|
||
[dependencies] | ||
console_error_panic_hook = "0.1" | ||
wasm-bindgen = "0.2" | ||
web-sys = { version = "0.3", features = ["Window", "Document", "HtmlElement", "Node", "Text"] } |
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,7 @@ | ||
Trunk | target-dirs | ||
========================= | ||
An example application demonstrating create a more complex target directory structure in the dist folder, based on | ||
the vanilla example. | ||
|
||
Once you've installed Trunk, simply execute `trunk serve --open` from this example's directory, and you should see the | ||
web application rendered in your browser. |
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,3 @@ | ||
[build] | ||
target = "index.html" | ||
dist = "dist" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,45 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"/> | ||
<title>Trunk | target-path</title> | ||
|
||
<link data-trunk rel="scss" href="src/index.scss"/> | ||
<link data-trunk rel="css" href="src/app.css"/> | ||
<link data-trunk data-no-minify rel="css" href="src/not_minified.css"/> | ||
<base data-trunk-public-url/> | ||
</head> | ||
<body> | ||
|
||
<link data-trunk rel="rust" href="Cargo.toml" data-wasm-opt="z" data-bin="vanilla-example"/> | ||
|
||
<link data-trunk rel="copy-dir" href="assets" data-target-path="static"/> | ||
<link data-trunk rel="copy-file" href="more-assets/rustacean-flat-happy.svg" data-target-path="static"/> | ||
|
||
<script data-trunk src="src/script.js"></script> | ||
<script data-trunk src="src/script.mjs" type="module"></script> | ||
|
||
<table> | ||
<tr> | ||
<th>Test</th> | ||
<th>Outcome</th> | ||
<th>Expected</th> | ||
</tr> | ||
|
||
<tr> | ||
<td><code>copy-dir</code></td> | ||
<td><img src="static/rustacean-flat-happy.png" width="128"/></td> | ||
<td>Should see PNG image</td> | ||
</tr> | ||
|
||
<tr> | ||
<td><code>copy-file</code></td> | ||
<td><img src="static/rustacean-flat-happy.svg" width="128"/></td> | ||
<td>Should see SVG image</td> | ||
</tr> | ||
</table> | ||
|
||
</body> | ||
<script>testFromJavaScript();</script> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
body {} |
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,9 @@ | ||
@charset "utf-8"; | ||
|
||
html { | ||
body { | ||
font-size: 20pt; | ||
color: #111; | ||
font-family: sans-serif; | ||
} | ||
} |
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,26 @@ | ||
#![recursion_limit = "1024"] | ||
|
||
use console_error_panic_hook::set_once as set_panic_hook; | ||
use wasm_bindgen::prelude::*; | ||
use web_sys::window; | ||
|
||
fn start_app() { | ||
let document = window() | ||
.and_then(|win| win.document()) | ||
.expect("Could not access document"); | ||
let body = document.body().expect("Could not access document.body"); | ||
let text_node = document.create_text_node("Hello, world from Vanilla Rust!"); | ||
body.append_child(text_node.as_ref()) | ||
.expect("Failed to append text"); | ||
} | ||
|
||
#[wasm_bindgen(inline_js = "export function snippetTest() { console.log('Hello from JS FFI!'); }")] | ||
extern "C" { | ||
fn snippetTest(); | ||
} | ||
|
||
fn main() { | ||
set_panic_hook(); | ||
snippetTest(); | ||
start_app(); | ||
} |
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,4 @@ | ||
.should_not_be_minified:checked:hover { | ||
--empty-prop: ; | ||
background-color: black; | ||
} |
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,3 @@ | ||
function testFromJavaScript() { | ||
console.log("Hello from JavaScript"); | ||
} |
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,5 @@ | ||
function testFromJavaScriptModule() { | ||
console.log("Hello from JavaScript Module"); | ||
} | ||
|
||
testFromJavaScriptModule(); |
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
Oops, something went wrong.