generated from IzK-ArcOS/v6-App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5f03084
Showing
6 changed files
with
766 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script lang="ts"> | ||
import { App } from "$types/app"; | ||
import "./css/main.css"; | ||
export let app: App; | ||
</script> | ||
|
||
<h1>Hello, World!</h1> | ||
<p>Working! App {app.metadata.name}, version {app.metadata.version}.</p> |
Large diffs are not rendered by default.
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,38 @@ | ||
> [!IMPORTANT] | ||
> When you're done reading this file, just replace its content with some of your own. You don't _need_ a README, but it would be fun. | ||
# v6-App | ||
The built-in app template for ArcOS v6 | ||
|
||
## What do I do? | ||
> [!IMPORTANT] | ||
> When renaming variables, functions or objects, use F2 to rename it, this prevents broken imports. After renaming, check for unsaved files. | ||
Before doing anything else, change this stuff: | ||
- The name of the class in [runtime.ts](./ts/runtime.ts) to a unique name (preferrably using the ID of the app) | ||
- The name and data of the object in [app.ts](./ts/app.ts) to the properties of the app (use F2 to rename the object) | ||
- The contents of this README file (**after you're done reading it** ofcourse) | ||
|
||
## What's next? | ||
Well, begin writing your application! Use references from the parent codebase to access stuff like the File System. One thing though, try to put _all_ | ||
the logic in the Runtime class instead of in global files. Otherwise it could interfere with the whole PIDs thing. This does mean that the Runtime will | ||
become quite big, oh well. | ||
|
||
### Assets | ||
Assets that are only used by this app can be put in the [assets/](./assets/) directory. Then use the Svelte way of importing the images and assets. | ||
|
||
If the asset is referenced by other apps as well, it's possible that it's already in the parent codebase. Check this to make sure you're not uploading duplicate images. | ||
|
||
### App.svelte | ||
The [App.svelte](./App.svelte) file can have two major exports: | ||
- `export let pid: number`: The PID of the process, will also be passed to the Runtime in the window renderer, | ||
- `export let app: App`: The current process' forked app data. Changing anything here will immediately update the process. | ||
|
||
### main.css | ||
Please use scoped rulesets to only modify the content of _your_ application, leaving the rest of the codebase untouched: | ||
|
||
```css | ||
window#appTemplate > div.foo > div.bar { | ||
la: dee, da; | ||
} | ||
``` |
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 @@ | ||
window#appTemplate { /* Rename appTemplate to the ID of the app */ | ||
color: #f0f; | ||
} |
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,33 @@ | ||
import { DefaultIcon } from "$ts/images/apps"; | ||
import { Runtime } from "./runtime"; | ||
import AppSvelte from "../App.svelte"; | ||
import { App } from "$types/app"; | ||
|
||
export const app: App = { | ||
metadata: { | ||
name: "App Template", | ||
description: "This is an app template", | ||
author: "The ArcOS Team", | ||
version: "0.0.0", | ||
icon: DefaultIcon | ||
}, | ||
runtime: Runtime, | ||
content: AppSvelte, | ||
id: "appTemplate", | ||
size: { w: 0, h: 0 }, | ||
minSize: { w: 0, h: 0 }, | ||
maxSize: { w: 0, h: 0 }, | ||
pos: { x: 0, y: 0 }, | ||
state: { | ||
minimized: false, | ||
maximized: false, | ||
headless: false, | ||
fullscreen: false, | ||
resizable: false | ||
}, | ||
controls: { | ||
minimize: false, | ||
maximize: false, | ||
close: false | ||
} | ||
} |
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 @@ | ||
import { AppRuntime } from "$ts/apps/runtime"; | ||
import { Process } from "$ts/process"; | ||
import type { App, AppMutator } from "$types/app"; | ||
|
||
export class Runtime extends AppRuntime { | ||
constructor(app: App, mutator: AppMutator, process: Process) { | ||
super(app, mutator, process); | ||
} | ||
} |