Installing from repository - tremho/thunderbolt-common GitHub Wiki

To download and use Thunderbolt from the repository for development, you need to set things up in the following way.

  1. Create a workspace directory for this development. Mine is tbd.

  2. Clone the thunderbolt repos:

        git clone [email protected]:tremho/thunderbolt-common.git
        git clone [email protected]:tremho/thunderbolt-desktop.git
        git clone [email protected]:tremho/thunderbolt-mobile.git
        git clone [email protected]:tremho/thunderbolt-cli.git
    
  3. Build each of these and create a local link for npm:

        cd ../thunderbolt-common; tsc;  npm link
        cd ../thunderbolt-desktop; tsc; npm link
        cd ../thunderbolt-mobile; tsc; npm link
        cd ../thunderbolt-cli; tsc; npm link
    
  4. create a new folder for your thunderbolt app. This folder should be alongside the repository folders for development.

  5. from this folder, run tbx init to set up a new app or do it manually:

  • create a package.json file. It should look like this (you can change the name, and id and version to match your own):
{
  "name": "tbTest",
  "version": "1.0.0",
  "projId": "com.tremho.tbtest",
  "description": "tester during development for thunderbolt-platform",
  "backMain": "src/tbAppBack.ts",
  "frontMain": "src/tbAppFront.ts",
  "dependencies": {
    "@riotjs/webpack-loader": "^5.0.0",
    "awesome-typescript-loader": "^5.2.1",
    "css-element-queries": "^1.2.3",
    "riot": "^5.3.3",
    "typescript": "^4.2.4"
  },
  "devDependencies": {
    "@types/node": "^15.3.0"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
  },
  "author": "tremho",
  "license": "ISC"
}
  • run npm install
  1. add the tsconfig.json file. it should look like this:
{
  "compilerOptions": {
    "outDir": "./build",
    "allowJs": true,
    "target": "ES2015",                          /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
    "module": "commonjs",                     /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
    "sourceMap": true,
    "lib": [
      "dom",
      "es2015",
      "scripthost",
      "es2015.proxy"
    ],
    /* Advanced Options */
    "strict": true,                           /* Enable all strict type-checking options. */
    "esModuleInterop": true,                  /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
    "skipLibCheck": true,                     /* Skip type checking of declaration files. */
    "forceConsistentCasingInFileNames": true  /* Disallow inconsistently-cased references to the same file. */
  },
  "exclude": [
    "./node_modules/"
  ],
  "include": [
    "**/*.ts",
    "src/preload.js"
  ],
  "typeRoots": [
    "./typings",
    "./node_modules/@types"
  ]
}

  1. add a README.md file if you like. tax init adds one.

  2. create the directories src, src/assets, src/components, src/pages src/scss

  3. At this point you are ready to create a Thunderbolt app. Follow the directions elsewhere for this (synopsis: create tbAppBack.ts and tbAppFront.ts in src, and your page code in src/pages. Then execute tbx build / tbx run.)

  4. If you make code changes in the repositories, you must rebuild these for your tbx app to see the changes. Here's a handy make script that updates all the thunderbolt modules:

CWD=`pwd`
cd ../thunderbolt-common; tsc;  npm link
cd ../thunderbolt-desktop; tsc; npm link
cd ../thunderbolt-mobile; tsc; npm link
cd ../thunderbolt-cli; tsc; npm link
cd $CWD
npm link thunderbolt-desktop
npm link thunderbolt-common
npm link thunderbolt-cli