From 740ac276a03850ed868cec38bddf5ff6404e4159 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sun, 11 Dec 2022 20:50:33 +0530 Subject: Backported some configurations from the adonis rewrite --- .editorconfig | 3 +++ .eslintignore | 37 ++++++++++++++++++++++++++- .gitignore | 64 +++++++++++++++++++++++++++++++++-------------- .husky/pre-commit | 3 ++- .npmrc | 3 +++ .prettierignore | 2 ++ .prettierrc.js | 2 +- CONTRIBUTING.md | 2 +- scripts/build-unix.sh | 10 +++++--- scripts/build-windows.ps1 | 10 +++++--- 10 files changed, 107 insertions(+), 29 deletions(-) create mode 100644 .prettierignore diff --git a/.editorconfig b/.editorconfig index 4a7ea30..79ef292 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,5 +8,8 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true +[*.json] +insert_final_newline = ignore + [*.md] trim_trailing_whitespace = false diff --git a/.eslintignore b/.eslintignore index 12a665b..79e0599 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,36 @@ -recipes/ +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Coverage directory used by tools like istanbul +coverage +.eslintcache + +# Dependency directory +# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git +node_modules + +# OSX +.DS_Store + +.idea +.pnpm-debug.log* +*.css.d.ts +*.sass.d.ts +*.scss.d.ts + +/build/ +/out/ +/recipes/ + +# package files +package.json +pnpm-lock.yaml + +# Json +*.json diff --git a/.gitignore b/.gitignore index d28e5fd..062f0fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,12 @@ -# Created by https://www.toptal.com/developers/gitignore/api/vim,node,yarn,react,macos,visualstudiocode,intellij -# Edit at https://www.toptal.com/developers/gitignore?templates=vim,node,yarn,react,macos,visualstudiocode,intellij +# Created by https://www.toptal.com/developers/gitignore/api/vim,node,yarn,macos,intellij,visualstudiocode +# Edit at https://www.toptal.com/developers/gitignore?templates=vim,node,yarn,macos,intellij,visualstudiocode ### Intellij ### # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # User-specific stuff -/**/workspace.xml +.idea/**/workspace.xml .idea/**/tasks.xml .idea/**/usage.statistics.xml .idea/**/dictionaries @@ -65,6 +65,9 @@ atlassian-ide-plugin.xml # Cursive Clojure plugin .idea/replstate.xml +# SonarLint plugin +.idea/sonarlint/ + # Crashlytics plugin (for Android Studio and IntelliJ) com_crashlytics_export_strings.xml crashlytics.properties @@ -107,6 +110,10 @@ fabric.properties # https://plugins.jetbrains.com/plugin/12206-codestream .idea/codestream.xml +# Azure Toolkit for IntelliJ plugin +# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij +.idea/**/azureSettings.xml + ### macOS ### # General .DS_Store @@ -136,6 +143,10 @@ Network Trash Folder Temporary Items .apdisk +### macOS Patch ### +# iCloud generated files +*.icloud + ### Node ### # Logs logs @@ -143,6 +154,7 @@ logs npm-debug.log* yarn-debug.log* yarn-error.log* +lerna-debug.log* .pnpm-debug.log* # Diagnostic reports (https://nodejs.org/api/report.html) @@ -192,6 +204,9 @@ web_modules/ # Optional eslint cache .eslintcache +# Optional stylelint cache +.stylelintcache + # Microbundle cache .rpt2_cache/ .rts2_cache_cjs/ @@ -207,10 +222,12 @@ web_modules/ # Yarn Integrity file .yarn-integrity -# dotenv environment variables file +# dotenv environment variable files .env -.env.test -.env.production +.env.development.local +.env.test.local +.env.production.local +.env.local # parcel-bundler cache (https://parceljs.org/) .cache @@ -233,6 +250,12 @@ dist # vuepress build output .vuepress/dist +# vuepress v2.x temp and cache directory +.temp + +# Docusaurus cache and generated files +.docusaurus + # Serverless directories .serverless/ @@ -255,18 +278,14 @@ dist .yarn/install-state.gz .pnp.* -### react ### -.DS_* -**/*.backup.* -**/*.back.* - -node_modules +### Node Patch ### +# Serverless Webpack directories +.webpack/ -*.sublime* +# Optional stylelint cache -psd -thumb -sketch +# SvelteKit build / generate output +.svelte-kit ### Vim ### # Swap @@ -295,21 +314,25 @@ tags !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json -*.code-workspace +!.vscode/*.code-snippets # Local History for Visual Studio Code .history/ +# Built Visual Studio Code Extensions +*.vsix + ### VisualStudioCode Patch ### # Ignore all local history of files .history .ionide ### yarn ### -# https://yarnpkg.com/advanced/qa#which-files-should-be-gitignored +# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored .yarn/* !.yarn/releases +!.yarn/patches !.yarn/plugins !.yarn/sdks !.yarn/versions @@ -321,7 +344,7 @@ tags # and uncomment the following lines # .pnp.* -# End of https://www.toptal.com/developers/gitignore/api/vim,node,yarn,react,macos,visualstudiocode,intellij +# End of https://www.toptal.com/developers/gitignore/api/vim,node,yarn,macos,intellij,visualstudiocode # Adonis directory for storing tmp files @@ -336,5 +359,8 @@ tmp # Uploaded recipes recipes/ +# sentry properties +sentry.properties + resources/announcements/*.json !resources/announcements/version.json diff --git a/.husky/pre-commit b/.husky/pre-commit index 1a92cb3..5bdf80f 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -5,5 +5,6 @@ FILE_NAME="$(dirname "$0")/_/husky.sh" # Conditionally invoke so as to avoid running npm commands if this is a clean checkout (ie before installing npm modules) if [ -f $FILE_NAME ]; then . $FILE_NAME - npm run lint + pnpm prepare-code + pnpm lint fi diff --git a/.npmrc b/.npmrc index aafab16..9de4cdb 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,5 @@ save-exact = true engine-strict = true +unsafe-perm = true +legacy-peer-deps = true +frozen-lockfile = false diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..bb3cd4c --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +build +recipes diff --git a/.prettierrc.js b/.prettierrc.js index 6a0a094..443f0c6 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -2,4 +2,4 @@ module.exports = { singleQuote: true, arrowParens: 'avoid', trailingComma: 'all', -}; +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d815919..18856bf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -141,4 +141,4 @@ pnpm start --dev #### Javascript Coding style-checker -- Please use `es-lint` and the defined rules to maintain a consistent style +- Please use `lint` and `lint:fix` and the defined rules to maintain a consistent style diff --git a/scripts/build-unix.sh b/scripts/build-unix.sh index 28d0e7c..a7cb003 100755 --- a/scripts/build-unix.sh +++ b/scripts/build-unix.sh @@ -104,16 +104,20 @@ mkdir -p data # ----------------------------------------------------------------------------- printf "\n*************** Building recipes ***************\n" pushd recipes -pnpm i -pnpm package +pnpm i && pnpm lint && pnpm reformat-files && pnpm package popd +# ----------------------------------------------------------------------------- # Now the meat..... pnpm i -node ace migration:refresh +pnpm prepare-code +pnpm lint +# TODO: Uncomment after fixing tests +# pnpm test # ----------------------------------------------------------------------------- printf "\n*************** Building app ***************\n" +node ace migration:refresh pnpm start --dev printf "\n*************** App successfully stopped! ***************\n" diff --git a/scripts/build-windows.ps1 b/scripts/build-windows.ps1 index 5af7392..7a5004e 100644 --- a/scripts/build-windows.ps1 +++ b/scripts/build-windows.ps1 @@ -154,16 +154,20 @@ if (-not (Test-Path -Path "data")) { # ----------------------------------------------------------------------------- Write-Host "*************** Building recipes ***************" Push-Location recipes -pnpm i -pnpm package +pnpm i && pnpm lint && pnpm reformat-files && pnpm package Pop-Location +# ----------------------------------------------------------------------------- # Now the meat..... & pnpm i -& node ace migration:refresh +& pnpm prepare-code +& pnpm lint +# TODO: Uncomment after fixing tests +# & pnpm test # ----------------------------------------------------------------------------- Write-Host "*************** Starting app ***************" +& node ace migration:refresh & pnpm start --dev Write-Host "*************** App successfully stopped! ***************" -- cgit v1.2.3-70-g09d2