From 42eaa8761f1720dc6c3b5600be86859142da76ac Mon Sep 17 00:00:00 2001 From: Daniel Haus Date: Wed, 1 Nov 2023 03:47:42 +0100 Subject: [PATCH] Initial commit. --- .eslintignore | 3 + .eslintrc.json | 55 +++++++++++++++++ .gitattributes | 1 + .github/CODEOWNERS | 1 + .github/dependabot.yml | 13 ++++ .github/pull_request_template.md | 5 ++ .github/workflows/package.yml | 50 +++++++++++++++ .gitignore | 101 +++++++++++++++++++++++++++++++ .prettierignore | 3 + .prettierrc.json | 10 +++ README.md | 1 + 11 files changed, 243 insertions(+) create mode 100644 .eslintignore create mode 100644 .eslintrc.json create mode 100644 .gitattributes create mode 100644 .github/CODEOWNERS create mode 100644 .github/dependabot.yml create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/package.yml create mode 100644 .gitignore create mode 100644 .prettierignore create mode 100644 .prettierrc.json create mode 100644 README.md diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..6de9a76 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +dist/ +lib/ +node_modules/ diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..2421732 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,55 @@ +{ + "plugins": ["jest", "@typescript-eslint"], + "extends": ["plugin:github/recommended"], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 9, + "sourceType": "module", + "project": "./tsconfig.json" + }, + "rules": { + "i18n-text/no-en": "off", + "eslint-comments/no-use": "off", + "import/no-namespace": "off", + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": "error", + "@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}], + "@typescript-eslint/no-require-imports": "error", + "@typescript-eslint/array-type": "error", + "@typescript-eslint/await-thenable": "error", + "@typescript-eslint/ban-ts-comment": "error", + "camelcase": "off", + "@typescript-eslint/consistent-type-assertions": "error", + "@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}], + "@typescript-eslint/func-call-spacing": ["error", "never"], + "@typescript-eslint/no-array-constructor": "error", + "@typescript-eslint/no-empty-interface": "error", + "@typescript-eslint/no-explicit-any": "error", + "@typescript-eslint/no-extraneous-class": "error", + "@typescript-eslint/no-for-in-array": "error", + "@typescript-eslint/no-inferrable-types": "error", + "@typescript-eslint/no-misused-new": "error", + "@typescript-eslint/no-namespace": "error", + "@typescript-eslint/no-non-null-assertion": "warn", + "@typescript-eslint/no-unnecessary-qualifier": "error", + "@typescript-eslint/no-unnecessary-type-assertion": "error", + "@typescript-eslint/no-useless-constructor": "error", + "@typescript-eslint/no-var-requires": "error", + "@typescript-eslint/prefer-for-of": "warn", + "@typescript-eslint/prefer-function-type": "warn", + "@typescript-eslint/prefer-includes": "error", + "@typescript-eslint/prefer-string-starts-ends-with": "error", + "@typescript-eslint/promise-function-async": "error", + "@typescript-eslint/require-array-sort-compare": "error", + "@typescript-eslint/restrict-plus-operands": "error", + "semi": "off", + "@typescript-eslint/semi": ["error", "never"], + "@typescript-eslint/type-annotation-spacing": "error", + "@typescript-eslint/unbound-method": "error" + }, + "env": { + "node": true, + "es6": true, + "jest/globals": true + } +} diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..af30937 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +dist/** -diff linguist-generated=true diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..ed19501 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @dhaus67 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5481a09 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + open-pull-requests-limit: 1 + schedule: + interval: daily + + - package-ecosystem: npm + directory: / + open-pull-requests-limit: 1 + schedule: + interval: daily diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..f35e1c6 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,5 @@ +# Description + + \ No newline at end of file diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000..cc8c38a --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,50 @@ +name: Package Action + +on: + push: + branches: + - main + paths-ignore: + - 'dist/**' + workflow_dispatch: + +jobs: + package: + name: Package dist files + runs-on: ubuntu-latest + permissions: + id-token: write + contents: write + env: + # Output logs to file in case we need to inspect errors. + GITSIGN_LOG: "/tmp/gitsign.log" + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js 20.x + uses: actions/setup-node@v3.8.1 + with: + node-version: 20.x + + - name: Deps + run: | + npm ci + + - name: Lint + run: | + npm run lint + + - name: Package + run: | + npm run build + npm run package +# TODO(dhaus): Configure secrets in repository to enable pushing the dist. +# - uses: chainguard-dev/actions/setup-gitsign@main +# - name: Commit Dist +# run: | +# git config --global user.email "roxbot@stackrox.com" +# git config --global user.name "Robot Rox" +# git add dist +# git commit -m "chore: Update dist" || echo "No changes to commit." +# git push origin diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..47a43ae --- /dev/null +++ b/.gitignore @@ -0,0 +1,101 @@ +# Dependency directory +node_modules + +.idea + +# Rest pulled from 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 +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# 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 + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# OS metadata +.DS_Store +Thumbs.db + +# Ignore built ts files +__tests__/runner/* +lib/**/* diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..6de9a76 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +dist/ +lib/ +node_modules/ diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..c34bafc --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,10 @@ +{ + "printWidth": 80, + "tabWidth": 2, + "useTabs": false, + "semi": false, + "singleQuote": true, + "trailingComma": "none", + "bracketSpacing": false, + "arrowParens": "avoid" +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..d78ac92 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Central Login