commit 3d8bb29c5578767997cbaaf0e09d9e354bc03c19 Author: Vahagn Khachatryan Date: Sat Dec 30 00:42:13 2023 +0000 Initial commit. diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..3c917b7 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,3 @@ +{ + "extends": ["./node_modules/@roku-cloud-sdk/dev-tools/linter-config/.eslintrc"] +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..527c24a --- /dev/null +++ b/.gitignore @@ -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 diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..9e717ca --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +package-lock=false +registry=https://artifactory.tools.roku.com/artifactory/api/npm/roku \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..b7a5f83 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +*Make it sparkle...* diff --git a/package.json b/package.json new file mode 100644 index 0000000..b42333b --- /dev/null +++ b/package.json @@ -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" +} \ No newline at end of file diff --git a/roku-config.js b/roku-config.js new file mode 100644 index 0000000..08c6f8d --- /dev/null +++ b/roku-config.js @@ -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" + } +}); \ No newline at end of file diff --git a/src/app.mjs b/src/app.mjs new file mode 100644 index 0000000..d7da687 --- /dev/null +++ b/src/app.mjs @@ -0,0 +1,5 @@ +// Application entry point is called once per application launch (not session) +export const appMain = () => { + const app = {}; + return app; +}; diff --git a/src/client-entry-point.mjs b/src/client-entry-point.mjs new file mode 100644 index 0000000..dddf1da --- /dev/null +++ b/src/client-entry-point.mjs @@ -0,0 +1,5 @@ +export const clientMain = () => ({}); + +export const getClientConfigs = () => { + return {}; +}; diff --git a/src/config/config.mjs b/src/config/config.mjs new file mode 100644 index 0000000..12d3bd3 --- /dev/null +++ b/src/config/config.mjs @@ -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]() : {}; +}; diff --git a/src/img/background.png b/src/img/background.png new file mode 100644 index 0000000..84eac01 Binary files /dev/null and b/src/img/background.png differ diff --git a/src/img/channel-poster.png b/src/img/channel-poster.png new file mode 100644 index 0000000..a644cb2 Binary files /dev/null and b/src/img/channel-poster.png differ diff --git a/src/img/logo.png b/src/img/logo.png new file mode 100644 index 0000000..4b25c80 Binary files /dev/null and b/src/img/logo.png differ diff --git a/src/index.jsx b/src/index.jsx new file mode 100644 index 0000000..ca9004d --- /dev/null +++ b/src/index.jsx @@ -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 ( + + + + + + Your app goes here! + + + ); +}; + +// main entry point is called once per session +export const main = ({ app }) => { + return ; +}; diff --git a/src/package/package.mjs b/src/package/package.mjs new file mode 100644 index 0000000..7102bce --- /dev/null +++ b/src/package/package.mjs @@ -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 +}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..45a68e1 --- /dev/null +++ b/tsconfig.json @@ -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"] +}