{"id":21014989,"url":"https://github.com/screamz/xs-dev-typescript-template","last_synced_at":"2026-04-24T21:31:28.487Z","repository":{"id":262982722,"uuid":"888970044","full_name":"ScreamZ/xs-dev-Typescript-template","owner":"ScreamZ","description":"Embedded TypeScript IoT Template for the Moddable SDK using XS-dev","archived":false,"fork":false,"pushed_at":"2024-11-18T14:57:48.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T12:06:14.668Z","etag":null,"topics":["embedded-systems","esp32","moddable","typescript","xs-dev"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ScreamZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-15T11:00:54.000Z","updated_at":"2024-11-20T22:59:30.000Z","dependencies_parsed_at":"2024-11-15T12:33:58.659Z","dependency_job_id":null,"html_url":"https://github.com/ScreamZ/xs-dev-Typescript-template","commit_stats":null,"previous_names":["screamz/xs-dev-typescript-template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2Fxs-dev-Typescript-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2Fxs-dev-Typescript-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2Fxs-dev-Typescript-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreamZ%2Fxs-dev-Typescript-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ScreamZ","download_url":"https://codeload.github.com/ScreamZ/xs-dev-Typescript-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243441839,"owners_count":20291544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded-systems","esp32","moddable","typescript","xs-dev"],"created_at":"2024-11-19T10:08:08.039Z","updated_at":"2026-04-24T21:31:28.452Z","avatar_url":"https://github.com/ScreamZ.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Basic TypeScript templates starter for Embedded Systems\n\n\u003e [!IMPORTANT]\n\u003e This starter template is meant to be used with the Moddable SDK, which is a JS runtime for embedded systems.\n\u003e Learn how to setup an Embedded JavaScript project using [xs-dev](https://xs-dev.js.org/).\n\n## Installation\n\nFor the sake of simplicity, we advise you to use mise-en-place to manage your project.\n\nhttps://mise.jdx.dev/getting-started.html\n\nThis allows to install, package manager and other dependencies for the Moddable SDK and things easily. No more python issues, or node version mismatch.\n\nRequirements:\n\n- Package manager, `pnpm` recommended (`mise use -g pnpm` or https://pnpm.io/installation)\n- Bundler, to transform all file in a single file and resolves modules. Using Bun builder in this repo, but could be esbuild or any other, but you'll need to adapt the configuration accordingly.\n  `mise use -g bun` or https://bun.sh/\n- Python, v3 is nice and easy to install with `mise use -g python`\n- Moddable SDK, easy install with [xs-dev ](https://xs-dev.js.org/features/setup/)\n\nYou might see a warning\n\n```\nmise ERROR Config file ~/dev-workspace/OSS/xs-dev/mise.toml is not trusted.\nTrust it with `mise trust`.\n```\n\nTherefore you can check the content of the file on your own and trust it as asked.\n\nOnce we have all, we can play around.\n\n## Usage\n\nRun `pnpm install` to install the dependencies.\n\nThe root file is `main.ts` and it's the entry point of the application. Then the bundler with crawl all the files and resolve the modules and dependencies, all of this in a single file `dist/main.js`.\n\nBefore injecting the code to the emulator or device we need to transpile the TypeScript files. This is done with the `pnpm build` command. This will generate the `dist` folder with the transpiled files.\n\n- `pnpm build:dev` will transpile whenever a file change automatically using a watcher.\n- `pnpm build:release` will transpile the files once and minify the output, optimizing the code for production.\n\nTherefore you can just do the following\n\n### In development\n\nOpen a shell and run the following commands:\n\n```bash\npnpm build:dev\n```\n\nThen open another shell and run the following command whenever you want to send the code to the device/emulator:\n\n```bash\nxs-dev run\n```\n\n### In release\n\nOpen a shell and run the following commands:\n\n```bash\npnpm build:release\n```\n\nThen open another shell and run the following command whenever you want to send the code to the device/emulator:\n\n```bash\nxs-dev build --mode production\n```\n\nFor more details about building and running the code, please refer to the https://xs-dev.js.org/features/run/.\nWhat this template does is only manage the TypeScript files and the bundling process. The rest is up to you.\n\n## Additional information\n\nTo support what I call « injected libraries » we define `--packages external` to the bundler, this allows to not package the libraries that are already in the Moddable SDK. As current API are not available in `node_modules` we need to do that.\n\nBun treats any import which path do not start with `.`, `..` or `/` as package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscreamz%2Fxs-dev-typescript-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscreamz%2Fxs-dev-typescript-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscreamz%2Fxs-dev-typescript-template/lists"}