-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add a global starfyre import way * add js * add js files * complete the feature * fix formatting * docs: update starfyre docs
- Loading branch information
Showing
13 changed files
with
39 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ A sample project is hosted on [GitHub](https://github.com/sansyrox/first-starfyr | |
To create an application | ||
|
||
```bash | ||
python3 -m starfyre --create="my-app" | ||
starfyre --create="my-app" | ||
``` | ||
|
||
It will use the [create-starfyre-app](https://github.com/sparckles/create-starfyre-app) as the template to create a new project. | ||
|
@@ -49,7 +49,7 @@ def message(): | |
return "World" | ||
|
||
---client | ||
import js | ||
from starfyre import js | ||
|
||
def handle_click(): | ||
js.console.log("Hello World") | ||
|
@@ -172,9 +172,9 @@ Fireworks = "https://cdn.jsdelivr.net/npm/[email protected]/+esm" | |
You can specify the dependencies using the following commands: | ||
|
||
```bash | ||
python3 -m starfyre --add-pyxide-package="package-name" | ||
python3 -m starfyre --add-server-package="package-name" | ||
python3 -m starfyre --add-js-module="module-name" --as="alias" | ||
starfyre --add-pyxide-package="package-name" | ||
starfyre --add-server-package="package-name" | ||
starfyre --add-js-module="module-name" --as="alias" | ||
``` | ||
|
||
|
||
|
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 |
---|---|---|
|
@@ -30,7 +30,7 @@ A sample project is hosted on [GitHub](https://github.com/sansyrox/first-starfyr | |
To create an application | ||
|
||
```bash | ||
python3 -m starfyre --create="my-app" | ||
starfyre --create="my-app" | ||
``` | ||
|
||
It will use the [create-starfyre-app](https://github.com/sparckles/create-starfyre-app) as the template to create a new project. | ||
|
@@ -46,7 +46,7 @@ def message(): | |
return "World" | ||
|
||
---client | ||
import js | ||
from starfyre import js | ||
|
||
def handle_click(): | ||
js.console.log("Hello World") | ||
|
@@ -169,9 +169,9 @@ Fireworks = "https://cdn.jsdelivr.net/npm/[email protected]/+esm" | |
You can specify the dependencies using the following commands: | ||
|
||
```bash | ||
python3 -m starfyre --add-pyxide-package="package-name" | ||
python3 -m starfyre --add-server-package="package-name" | ||
python3 -m starfyre --add-js-module="module-name" --as="alias" | ||
starfyre --add-pyxide-package="package-name" | ||
starfyre --add-server-package="package-name" | ||
starfyre --add-js-module="module-name" --as="alias" | ||
``` | ||
|
||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import ujson as json | ||
import js | ||
import ujson as json | ||
|
||
|
||
def is_listener(name): | ||
|
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,6 @@ | ||
import js | ||
from pyscript import display, document, window | ||
|
||
websocket = js.WebSocket | ||
|
||
__all__ = ["websocket", "document", "window", "js", "display"] |
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 |
---|---|---|
|
@@ -2,8 +2,7 @@ | |
|
||
import random | ||
|
||
import js | ||
|
||
from starfyre import js | ||
|
||
store = GLOBAL_STORE | ||
observers = GLOBAL_OBSERVERS | ||
|
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,3 +1,3 @@ | ||
#!/bin/sh | ||
|
||
python3 -m starfyre --build --path="." | ||
starfyre --build --path="." |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/sh | ||
|
||
python3 -m starfyre --serve --path="." | ||
starfyre --serve --path="." |
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ server_packages = [] | |
[js_modules] | ||
is_odd = "https://cdn.jsdelivr.net/npm/[email protected]/+esm" | ||
Fireworks = "https://cdn.jsdelivr.net/npm/[email protected]/+esm" | ||
|
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,7 @@ | ||
---client | ||
|
||
from pyscript import display | ||
from pyscript import window, document | ||
from starfyre import display | ||
from starfyre import window, document | ||
|
||
|
||
--- |