diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 0000000..cd16123 --- /dev/null +++ b/.cspell.json @@ -0,0 +1,11 @@ +{ + "version": "0.2", + "words": [ + "dbaeumer", + "isaacscript", + "sarisia", + "steamapps", + "technote", + "tstl" + ] +} diff --git a/.env_template b/.env_template new file mode 100644 index 0000000..9bc16a2 --- /dev/null +++ b/.env_template @@ -0,0 +1,2 @@ +STEAM_USERNAME="" +STEAM_PASSWORD="" diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..8f0aa09 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,23 @@ +// This is the configuration file for ESLint, the TypeScript linter +// https://eslint.org/docs/user-guide/configuring +module.exports = { + extends: [ + // The linter base is the IsaacScript mod config + // https://github.com/IsaacScript/eslint-config-isaacscript/blob/main/mod.js + "eslint-config-isaacscript/mod", + ], + + parserOptions: { + // ESLint needs to know about the project's TypeScript settings in order for TypeScript-specific + // things to lint correctly + // We do not point this at "./tsconfig.json" because certain files (such at this file) should be + // linted but not included in the actual project output + project: "./tsconfig.eslint.json", + }, + + // We modify the linting rules from the base for some specific things + // (listed in alphabetical order) + rules: { + // Insert changed or disabled rules here, if necessary + }, +}; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9787e8f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI + +on: [push, pull_request] + +jobs: + build_and_lint: + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + # The default version is 14 + # The ESLint config requires Node 16 to work properly + node-version: '16' + + - name: Retrieve the cached "node_modules" directory (if present) + uses: actions/cache@v2 + id: node-cache + with: + path: node_modules + key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + + - name: Install dependencies (if the cached directory was not found) + if: steps.node-cache.outputs.cache-hit != 'true' + run: npm ci + + - name: Test to see if the project compiles + run: bash build.sh + + - name: Perform automated checks + run: bash lint.sh + + # To enable CI failure notifications over Discord, add a "DISCORD_WEBHOOK" secret to the + # repository equal to the URL for the webhook, and then uncomment the lines below + + #discord: + # name: Discord Failure Notification + # needs: [build_and_lint] + # if: always() # This is needed to always run this job, even if the other jobs fail + # runs-on: ubuntu-latest + # steps: + # - uses: technote-space/workflow-conclusion-action@v2 + # - if: ${{ secrets.DISCORD_WEBHOOK }} != '' && env.WORKFLOW_CONCLUSION != 'success' && env.WORKFLOW_CONCLUSION != 'cancelled' + # uses: sarisia/actions-status-discord@v1 + # with: + # webhook: ${{ secrets.DISCORD_WEBHOOK }} + # status: ${{ env.WORKFLOW_CONCLUSION }} + # title: "" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..de9d0a7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,134 @@ +# ---------------------- +# BlueBabyPetrifiedStart +# ---------------------- + +# Per-user IsaacScript settings +isaacscript.json + +# The transpiled Lua output +mod/main.lua + +# MacOS artifacts +.DS_Store + +# -------------------------------------------------------------- +# GitHub Node.gitignore template +# https://github.com/github/gitignore/blob/master/Node.gitignore +# -------------------------------------------------------------- + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..e3fdf72 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,15 @@ +// This is the configuration file for Prettier, the auto-formatter +// https://prettier.io/docs/en/configuration.html +module.exports = { + // https://prettier.io/docs/en/options.html#trailing-commas + // The default is "es5" - Trailing commas where valid in ES5 (objects, arrays, etc.) + // However, always having trailing commas is objectively better + // The Airbnb style guide agrees: + // https://github.com/airbnb/javascript#commas--dangling + // Prettier itself also acknowledges Nik Graf's blog in their official blog: + // https://prettier.io/blog/2020/03/21/2.0.0.html#change-default-value-for-trailingcomma-to-es5-6963httpsgithubcomprettierprettierpull6963-by-fiskerhttpsgithubcomfisker + // https://medium.com/@nikgraf/why-you-should-enforce-dangling-commas-for-multiline-statements-d034c98e36f8 + // Prettier will change the default in the future: + // https://github.com/prettier/prettier/issues/9369 + trailingComma: "all", +}; diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..be93c4f --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,10 @@ +// These are Visual Studio Code extensions that are intended to be used with this particular +// repository +// https://go.microsoft.com/fwlink/?LinkId=827846 +{ + "recommendations": [ + "dbaeumer.vscode-eslint", // The TypeScript linter + "streetsidesoftware.code-spell-checker", // A spell-checker extension based on cspell + "typescript-to-lua.vscode-typescript-to-lua", // The TypeScriptToLua extension + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..72c9b2a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,49 @@ +// These are Visual Studio Code settings that should apply to this particular repository +{ + // ---------------- + // Vanilla settings + // ---------------- + + // This matches the Airbnb JavaScript style guide + "editor.rulers": [100], + "editor.tabSize": 2, + + "files.associations": { + "*.anm2": "xml", // anm2 files are just XML files + }, + + // Linux line endings are used in this project + "files.eol": "\n", + + // Automatically removing all trailing whitespace when saving a file + "files.trimTrailingWhitespace": true, + + // Configure glob patterns for excluding files and folders in full text searches and quick open + "search.exclude": { + "**/mod/main.lua": true, + "**/*.png": true, + "**/*.wav": true, + }, + + // ----------------- + // Language settings + // ----------------- + + // By default, VSCode will not automatically fill-in function arguments + "javascript.suggest.completeFunctionCalls": true, + "typescript.suggest.completeFunctionCalls": true, + + // Automatically run the formatter when a JavaScript or TypeScript file is saved + "[javascript]": { + "editor.codeActionsOnSave": [ + "source.fixAll.eslint", + ], + "editor.tabSize": 2, + }, + "[typescript]": { + "editor.codeActionsOnSave": [ + "source.fixAll.eslint", + ], + "editor.tabSize": 2, + }, +} diff --git a/README.md b/README.md index b2827d1..5925263 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ # BlueBabyPetrifiedStart BlueBabyPetrifiedStart is a mod for *[The Binding of Isaac: Repentance](https://store.steampowered.com/app/1426300/The_Binding_of_Isaac_Repentance/)*, written in [TypeScript](https://www.typescriptlang.org/) using the [IsaacScript](https://isaacscript.github.io/) framework. -"# BlueBabyPetrifiedPoopMod"