Initial commit.

This commit is contained in:
2023-12-30 00:42:13 +00:00
commit 3d8bb29c55
15 changed files with 213 additions and 0 deletions

3
.eslintrc Normal file
View File

@@ -0,0 +1,3 @@
{
"extends": ["./node_modules/@roku-cloud-sdk/dev-tools/linter-config/.eslintrc"]
}

14
.gitignore vendored Normal file
View File

@@ -0,0 +1,14 @@
.rokurc
dist*
**/.DS_Store
.nyc_output/
coverage/
node_modules/
build/
.idea/
package-lock.json
public/
cloud-sdk-modules/
roku-dev-config.js
app.bin
*.iml

2
.npmrc Normal file
View File

@@ -0,0 +1,2 @@
package-lock=false
registry=https://artifactory.tools.roku.com/artifactory/api/npm/roku

1
README.md Normal file
View File

@@ -0,0 +1 @@
*Make it sparkle...*

15
package.json Normal file
View File

@@ -0,0 +1,15 @@
{
"name": "Banvor",
"version": "1.0.0",
"description": "Experimental Sokoban using Roku React SDK",
"scripts": {
"rk": "rk"
},
"devDependencies": {
"@roku-web-cloud-sdk/dev-tools": "*"
},
"dependencies": {
"@roku-web-cloud-sdk/tools": "*"
},
"prettier": "@roku-cloud-sdk/dev-tools/linter-config/.prettierrc.json"
}

23
roku-config.js Normal file
View File

@@ -0,0 +1,23 @@
module.exports = () => ({
app: {
entryPoint: "./src/index.jsx",
clientEntryPoint: "./src/client-entry-point.mjs",
packageEntryPoint: "./src/package/package.mjs",
name: "Banvor",
developerId: "0",
useRealReact: true
},
publish: {
defaultAlias: "qa",
defaultV8Alias: "production"
},
cloudland: {
isCloudland: true
},
developer: {
username: "banvor.vostan.org@gmail.com"
},
package: {
defaultOrigin: "https://banvor.vostan.org/roku/banvor/v/1"
}
});

5
src/app.mjs Normal file
View File

@@ -0,0 +1,5 @@
// Application entry point is called once per application launch (not session)
export const appMain = () => {
const app = {};
return app;
};

View File

@@ -0,0 +1,5 @@
export const clientMain = () => ({});
export const getClientConfigs = () => {
return {};
};

37
src/config/config.mjs Normal file
View File

@@ -0,0 +1,37 @@
/*
You can put configuration variables such as endpoints and flags in here
`common` should include default values
the rest of the sections will provide overrides for various alias
Alias is passed in as launch the application
Use key names with dots such as "my.service.endpoint"
Values should all be strings and co-erced into other types in your program code
*/
export const getConfig = alias => {
if (!alias) {
return {};
}
const config = {
development: () => ({
development: "true",
env: "development"
}),
common: () => ({
env: "common",
"common.value": "true"
}),
qa: () => ({
env: "qa"
}),
staging: () => ({
env: "staging"
}),
production: () => ({
env: "production"
})
};
return config[alias] ? config[alias]() : {};
};

BIN
src/img/background.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 MiB

BIN
src/img/channel-poster.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
src/img/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

35
src/index.jsx Normal file
View File

@@ -0,0 +1,35 @@
import React from "react";
import { Scene } from "@roku-web-cloud-sdk/components/scene.jsx";
import { Label } from "@roku-web-cloud-sdk/components/label.jsx";
import { useConfig, useAsyncEffect } from "@roku-cloud-sdk/roku-hooks";
import { getConfig } from "./config/config.mjs";
import background from "./img/background.png";
export { appMain } from "./app.mjs";
const MainScene = ({ app }) => {
const config = useConfig({ getConfig });
/*
useAsyncEffect(async fetch => {
// Fetch is only available with in useAsyncEffect. Make ajax calls here..
}, []);
*/
return (
<Scene backgroundUri={background}>
<Scene.Logo>
<Label style={{ font: "LargeSystemFont" }}>Your App Title</Label>
</Scene.Logo>
<Scene.Clock />
<Scene.Body>Your app goes here!</Scene.Body>
<Scene.Options adjacent />
</Scene>
);
};
// main entry point is called once per session
export const main = ({ app }) => {
return <MainScene app={app} />;
};

50
src/package/package.mjs Normal file
View File

@@ -0,0 +1,50 @@
import splashScreen from "../img/logo.png";
import channelPoster from "../img/channel-poster.png";
/**
* If you have to create multipackage configuration
* getPackageInfo must return object whih has `packages` property
* and all packages should be a fields of `packages`
* name of field should be a package name usually the same as alias
* which used with this package
* also `packages` must have `default` field with mandatory fields `splashScreen`
* `splashColor` and `screenSaver` if application used as screen saver
* also default may contain fields which are common for all packages. All
* packages would be extended with these values at build time.
*
* For example
* export const getPackageInfo = () => ({
* packages: {
* default: {
* splashScreen: splashScreen
* splashColor: "#000000"
* },
* qa: {
* title: "banvor QA"
* minFirmwareVersion: "11.0.0",
* ...
* },
* staging: {
* title: "banvor Staging"
* minFirmwareVersion: "10.5.0",
* ...
* }
* }
* })
*/
export const getPackageInfo = () => ({
title: "Roku CloudSDK App: Banvor",
splashScreen,
channelPoster, // maps to mm_icon_focus_XX in manifest
majorVersion: 1, // note minor version and build version will be managed by tooling
splashColor: "#000000",
bootParams: {
bootSplashColor: [0, 0, 0],
bootSplashImage: splashScreen
},
minFirmwareVersion: "13.0.0",
useNdkLib: true,
useCloudland: true
});

23
tsconfig.json Normal file
View File

@@ -0,0 +1,23 @@
{
"compilerOptions": {
"target": "es6",
"jsx": "react",
"module": "commonjs",
"rootDir": "./",
"moduleResolution": "node",
"baseUrl": "./",
"paths": {
"@roku/cloud-sdk-components": ["node_modules/@roku-web-cloud-sdk/components"],
"flatbuffers": ["node_modules/flatbuffers/ts/flatbuffers.ts"]
},
"typeRoots": ["node_modules/@types"],
"allowJs": true,
"noEmit": true,
"isolatedModules": false,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": false
},
"include": ["src", "node_modules/@roku-web-cloud-sdk", "cloud-sdk-modules"]
}