-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the ability to read files from Starlark (#1045)
* Add the ability to read files from Starlark Starlark scripts can now load arbitrary files from their bundle and read them using a Python-like `open()` and `read()` API. A `readall()` convenience function is also provided. The examples have been updated to use this functionality where relevant. For example: ``` load("icon.png", icon = "file") BTC_ICON = icon.readall() ``` The `pixlet render` command can now accept an entire directory containing multiple Starlark files and static resources. * Remove `file.open` and `read()` Remove the `open()` and `read()` functions, so the only way to read a file is `readall()`. If there is demand for the other methods, we can add them back later. * Add directory support to `pixlet serve` * Implement `pixlet bundle` for directories * Fix path problems on Windows `fs.FS` always uses slash-separated paths, even on Windows. So we should be manipulating those paths with `path`, not `filepath`. * Switch tarfs implementations for Windows support It appears that `nlepage/go-tarfs` correctly supports Windows by [using `path` instead of `filepath`][1]. [1]: nlepage/go-tarfs#7
- Loading branch information
1 parent
757a72a
commit fe59c71
Showing
48 changed files
with
606 additions
and
455 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
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
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
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 @@ | ||
this file is not used in the 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
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.