Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
IzKuipers authored Feb 1, 2024
0 parents commit 5f03084
Show file tree
Hide file tree
Showing 6 changed files with 766 additions and 0 deletions.
9 changes: 9 additions & 0 deletions App.svelte
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>
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions README.md
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;
}
```
3 changes: 3 additions & 0 deletions css/main.css
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;
}
33 changes: 33 additions & 0 deletions ts/app.ts
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
}
}
9 changes: 9 additions & 0 deletions ts/runtime.ts
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);
}
}

0 comments on commit 5f03084

Please sign in to comment.