Skip to content

Commit

Permalink
Fix #1
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasstrehle committed Mar 28, 2024
1 parent 7c3dd90 commit 4d81393
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 53 deletions.
19 changes: 3 additions & 16 deletions .github/workflows/uix-deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,14 @@ on: push
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: "actions/checkout@v3"
- name: Setup Deno
uses: "denoland/setup-deno@v1"
- name: Run Tests
run: "deno run -Aq --import-map https://dev.cdn.unyt.org/importmap.json https://dev.cdn.unyt.org/unyt_tests/run.ts -s --reportfile testreport.xml"
- name: Publish Test Report
uses: "mikepenz/action-junit-report@v3"
if: "success() || failure()"
with:
report_paths: testreport.xml
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: "actions/checkout@v3"
with:
submodules: recursive
- name: Setup Deno
uses: "denoland/setup-deno@v1"
- name: Deploy UIX App
run: "deno run --importmap https://dev.cdn.unyt.org/uix1/importmap.json -Aqr https://dev.cdn.unyt.org/uix1/run.ts --stage prod --detach "
needs: test
run: "deno run --importmap ./importmap.json -Aqr https://cdn.unyt.org/uix@0.2.x/run.ts --stage prod --detach"
5 changes: 0 additions & 5 deletions .vscode/settings.json

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In this demo, we are calculating the digits of PI and creating a [TOR vanity add
```
3. Run the project local
```bash
$ uix -l --port 8000
$ uix --port 8000
```
4. Navigate to your favourite web browser and open http://localhost:8000 to see everything in action.

Expand All @@ -24,7 +24,7 @@ This diagram outlines the UIX default project structure.
.
└── example-threads/
├── common/
│ ├── compoments/
│ ├── components/
│ │ ├── MainPage.scss // Main style declaration
│ │ └── MainPage.tsx // Main component
│ ├── PI-Worker.ts // Worker for PI calculation
Expand All @@ -47,4 +47,4 @@ This diagram outlines the UIX default project structure.

---

<sub>&copy; unyt 2023[unyt.org](https://unyt.org)</sub>
<sub>&copy; unyt 2024[unyt.org](https://unyt.org)</sub>
2 changes: 1 addition & 1 deletion app.dx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ plugin git_deploy (
prod: (
on: 'push'
branch: '*',
test: false
tests: false
)
)
4 changes: 2 additions & 2 deletions backend/.dx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use stage from #public.uix;

endpoint: stage {
prod: @+example_threads
prod: @+threads-example
},

location: stage {
prod: @+unyt_eu1
prod: @+unyt-host-1
},

domain: stage {
Expand Down
18 changes: 9 additions & 9 deletions common/TOR-Worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ await import("https://cdn.jsdelivr.net/npm/js-sha3@0.9.2/src/sha3.min.js");


export type AddressData = {
address: string;
public: {
raw: Uint8Array;
b64: string;
};
private: {
raw: Uint8Array;
b64: string;
};
address: string;
public: {
raw: Uint8Array;
b64: string;
};
private: {
raw: Uint8Array;
b64: string;
};
}

declare const sha3_256: any;
Expand Down
2 changes: 0 additions & 2 deletions common/components/MainPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { template } from "uix/html/template.ts";
import { Component } from "uix/components/Component.ts";

import { spawnThreads, spawnThread } from "unyt_core/threads/threads.ts";
import { always, map } from "unyt_core/functions.ts";
import type { AddressData } from "common/TOR-Worker.ts";
Expand Down Expand Up @@ -71,6 +70,5 @@ export class MainPage extends Component {
this.resultPIs.unshift(pi);

this.calculatingPI = false;

}
}
6 changes: 4 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"importMap": "./importmap.json",
"_publicImportMap": "./importmap.json",
"importMap": "./.datex-cache/importmap.lock.json",
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "uix",
"lib": [
"dom",
"deno.window"
]
}
}
}
3 changes: 3 additions & 0 deletions frontend/entrypoint.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ slot#main {
}
section {
border-top: 0px;
}
body {
font-family: var(--sans-font);
}
6 changes: 1 addition & 5 deletions frontend/entrypoint.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
import { MainPage } from "../common/components/MainPage.tsx";
import { Entrypoint } from "uix/html/entrypoints.ts";

export default {
'/': <MainPage/>
} satisfies Entrypoint;
export default <MainPage/>
15 changes: 7 additions & 8 deletions importmap.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"imports": {
"datex-core-legacy": "https://cdn.unyt.org/datex-core-js-legacy@0.0.x/datex.ts",
"datex-core-legacy/": "https://cdn.unyt.org/datex-core-js-legacy@0.0.x/",
"unyt_core": "https://cdn.unyt.org/datex-core-js-legacy@0.0.x/datex.ts",
"unyt_core/": "https://cdn.unyt.org/datex-core-js-legacy@0.0.x/",
"uix": "https://cdn.unyt.org/uix@0.1.x/uix.ts",
"uix/": "https://cdn.unyt.org/uix@0.1.x/src/",
"uix/jsx-runtime": "https://cdn.unyt.org/uix@0.1.x/src/jsx-runtime/jsx.ts",
"unyt-tests/": "https://cdn.unyt.org/unyt_tests/"
"datex-core-legacy": "https://cdn.unyt.org/datex-core-js-legacy@0.1.x/datex.ts",
"datex-core-legacy/": "https://cdn.unyt.org/datex-core-js-legacy@0.1.x/",
"unyt_core": "https://cdn.unyt.org/datex-core-js-legacy@0.1.x/datex.ts",
"unyt_core/": "https://cdn.unyt.org/datex-core-js-legacy@0.1.x/",
"uix": "https://cdn.unyt.org/uix@0.2.x/uix.ts",
"uix/": "https://cdn.unyt.org/uix@0.2.x/src/",
"uix/jsx-runtime": "https://cdn.unyt.org/uix@0.2.x/src/jsx-runtime/jsx.ts"
}
}

0 comments on commit 4d81393

Please sign in to comment.