diff --git a/.eslintrc.js b/.eslintrc.js index d3533925..93c1775a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -15,6 +15,7 @@ module.exports = { 'vue/multi-word-component-names': 'off', 'vue/no-useless-template-attributes': 'off', 'vue/one-component-per-file': 'off', + 'vue/no-reserved-component-names': 'off', '@typescript-eslint/ban-ts-comment': 'off', '@typescript-eslint/no-var-requires': 'off', '@typescript-eslint/no-non-null-assertion': 'off', @@ -34,6 +35,7 @@ module.exports = { 'plugin:vue/vue3-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended-requiring-type-checking', + 'plugin:prettier/recommended', ], ignorePatterns: [ '*.mjs', diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..d7ae16bf --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,32 @@ +name: Lint + +on: + push: + branches: [$default-branch] + paths-ignore: + - '**.md' + pull_request: + paths-ignore: + - '**.md' + workflow_dispatch: + +jobs: + setup_and_lin: + runs-on: macos-latest + steps: + - name: Setup node + uses: actions/setup-node@v2 + with: + node-version: '16.14.0' + + - name: Set yarn version + run: yarn set version 1.22.18 + + - name: Checkout Books + uses: actions/checkout@v2 + + - name: Install Dependencies + run: yarn + + - name: Lint + run: yarn lint \ No newline at end of file diff --git a/README.md b/README.md index f22aec77..ad494e5a 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,22 @@ To run Frappe Books in development mode (with hot reload, etc): yarn dev ``` +**Note: First Boot** + +When you run `yarn dev` electron will run immediately but the UI will take a +couple of seconds to render this because of how dev mode works. Each file is +individually served by the dev server. And there are many files that have to be +sent. + + +**Note: Debug Electron Main Process** + +When in dev mode electron runs with the `--inspect` flag which allows an +external debugger to connect to port 5858. You can use chrome for this by +visiting `chrome://inspect` while Frappe Books is running in dev mode. + +See more [here](https://www.electronjs.org/docs/latest/tutorial/debugging-main-process#external-debuggers). + #### Build To build Frappe Books and create an installer: @@ -99,7 +115,7 @@ To build Frappe Books and create an installer: yarn build ``` -**Note** +**Note: Build Target** By default the above command will build for your computer's operating system and architecture. To build for other environments (example: for linux from a windows computer) check the _Building_ section at diff --git a/build/scripts/dev.mjs b/build/scripts/dev.mjs index a7aaf9e0..06b00e56 100644 --- a/build/scripts/dev.mjs +++ b/build/scripts/dev.mjs @@ -53,6 +53,8 @@ const ctx = await esbuild.context({ const fswatcher = chokidar.watch([ path.join(root, 'main.ts'), path.join(root, 'main'), + path.join(root, 'backend'), + path.join(root, 'schemas'), ]); /** diff --git a/main/contactMothership.ts b/main/contactMothership.ts index 486d7dfe..2f415911 100644 --- a/main/contactMothership.ts +++ b/main/contactMothership.ts @@ -14,7 +14,7 @@ export function getUrlAndTokenString(): Creds { '../creds/log_creds.txt' ); if (!fs.existsSync(errLogCredsPath)) { - errLogCredsPath = path.join(__dirname, '../log_creds.txt'); + errLogCredsPath = path.join(__dirname, '..', '..', 'log_creds.txt'); } if (!fs.existsSync(errLogCredsPath)) { diff --git a/package.json b/package.json index ab0e1bde..a60f52ae 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "postuninstall": "electron-rebuild", "script:translate": "scripts/runner.sh scripts/generateTranslations.ts", "script:profile": "scripts/profile.sh", - "test": "scripts/test.sh" + "test": "scripts/test.sh", + "lint": "eslint . --ext ts,vue" }, "dependencies": { "@codemirror/autocomplete": "^6.4.2", diff --git a/src/index.html b/src/index.html index 994e55c9..14242038 100644 --- a/src/index.html +++ b/src/index.html @@ -6,8 +6,6 @@