{"id":21531926,"url":"https://github.com/matrixai/typescript-demo-electron","last_synced_at":"2025-09-02T11:34:19.038Z","repository":{"id":48035842,"uuid":"344651250","full_name":"MatrixAI/TypeScript-Demo-Electron","owner":"MatrixAI","description":"TypeScript Electron Demo Project using Nix","archived":false,"fork":false,"pushed_at":"2021-08-04T01:38:56.000Z","size":635,"stargazers_count":8,"open_issues_count":3,"forks_count":3,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-24T02:12:20.767Z","etag":null,"topics":["electron","nix","typescript"],"latest_commit_sha":null,"homepage":"https://matrix.ai","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MatrixAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-05T00:48:17.000Z","updated_at":"2024-04-14T02:47:49.000Z","dependencies_parsed_at":"2022-09-26T21:20:21.455Z","dependency_job_id":null,"html_url":"https://github.com/MatrixAI/TypeScript-Demo-Electron","commit_stats":null,"previous_names":[],"tags_count":6,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2FTypeScript-Demo-Electron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2FTypeScript-Demo-Electron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2FTypeScript-Demo-Electron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2FTypeScript-Demo-Electron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatrixAI","download_url":"https://codeload.github.com/MatrixAI/TypeScript-Demo-Electron/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248134009,"owners_count":21053370,"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":["electron","nix","typescript"],"created_at":"2024-11-24T02:18:12.717Z","updated_at":"2025-04-10T00:29:12.452Z","avatar_url":"https://github.com/MatrixAI.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeScript-Demo-Electron\n\n[![pipeline status](https://gitlab.com/MatrixAI/open-source/TypeScript-Demo-Electron/badges/master/pipeline.svg)](https://gitlab.com/MatrixAI/open-source/TypeScript-Demo-Electron/commits/master)\n\n## Installation\n\nBuilding the package:\n\n```sh\nnix-build -E '(import ./pkgs.nix {}).callPackage ./default.nix {}'\n```\n\nBuilding the releases:\n\n```sh\nnix-build ./release.nix --attr application\nnix-build ./release.nix --attr docker\n# packages for distribution\nnix-build ./release.nix --attr package.linux.x64.deb\nnix-build ./release.nix --attr package.linux.x64.rpm\nnix-build ./release.nix --attr package.windows.x64.exe\nnix-build ./release.nix --attr package.darwin.x64.zip\n```\n\nInstall into Nix user profile:\n\n```sh\nnix-env -f ./release.nix --install --attr application\n```\n\nInstall into Docker:\n\n```sh\ndocker load --input \"$(nix-build ./release.nix --attr docker)\"\n```\n\nRunning from Docker will require https://gist.github.com/CMCDragonkai/f7ca9b3ce8a64aa21ab68cf69dfc9f04\n\n## Development\n\nRun `nix-shell`, and once you're inside, you can use:\n\n```\n# install (or reinstall packages from package.json)\nnpm install\n# build the development dist and watch for file changes\nnpm run watch\n# build the production dist\nnpm run build\n# run the repl (this allows you to import from ./src)\nnpm run ts-node\n# run the tests\nnpm run test\n# lint the source code\nnpm run lint\n# automatically fix the source\nnpm run lintfix\n```\n\nIf you want to run the Electron application, just run:\n\n```\nelectron .\n```\n\nThis will run against the `dist`.\n\nCombine `npm run watch` with `electron .`.\n\nUse manual refresh whenever the `dist` has been rebuilt.\n\n---\n**Known Development Pitfalls**:\n* In the `webpack.config.js`, `svg` files use the `file-loader`. When important `svg`s as a vue component, using `vue-svg-loader`, configure the webpack as such:\nREMOVE THE SVG FROM THE `file-loader`\nIn `electronRenderer`:\n```js\n{\n  test: /\\.svg$/,\n  use: ['vue-loader', 'vue-svg-loader']\n}\n```\n\n### Using the REPL\n\n```\n$ npm run ts-node\n\u003e import fs from 'fs';\n\u003e fs\n\u003e import { Library } from '@';\n\u003e Library\n\u003e import Library as Library2 from './src/lib/Library';\n```\n\nYou can also create test files in `./src`, and run them with `npm run ts-node ./src/test.ts`.\n\nThis allows you to test individual pieces of typescript code and it makes it easier when doing large scale rearchitecting of TypeScript code.\n\n### Webpack Configuration\n\nThe main is the `electronMain`, this compiles the node-side or \"main\" of electron.\n\nThe `electronRenderer` is the frontend side. This is similar to the SPA application. With style loader and stuff.\n\n### Building Electron Application\n\nYou must use `umask 022` if you are interactively using `fakeroot` to build `deb` packages.\n\nWe are using `@electron-forge/cli` to build the electron apps for different platforms. The configuration can be found in `forge.config.js`.\n\nIt includes a list of [makers](https://www.electronforge.io/config/makers).\n\nIt also has `packageConfig`, which defines `electronZipDir`, which is the location for the cached electron binaries for different platforms. This gets used during the `nix-build` phase, as `nix` building is done in an offline environment, and requires caching ensure the required binaries used by `electron-forge` are present.\n\nNote that the `electron` and `@electron-forge/cli` must be the same version between Nix specified dependencies and NPM specified dependencies. If they are not the same version, undefined behaviour may occur.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrixai%2Ftypescript-demo-electron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatrixai%2Ftypescript-demo-electron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrixai%2Ftypescript-demo-electron/lists"}