├── README.md ├── src ├── slack │ ├── constants.ts │ ├── events │ │ ├── index.ts │ │ └── message.ts │ ├── actions │ │ ├── index.ts │ │ └── registerTeam.ts │ ├── README.md │ ├── index.ts │ └── blocks │ │ └── dashboardBlocks.ts ├── index.ts ├── app.test.ts ├── app.ts ├── tsconfig.json └── logger.ts ├── Authors.md ├── .env.sample ├── .prettierrc ├── .editorconfig ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── CONTRIBUTING.md ├── THIRD-PARTY-NOTICES.txt ├── app.json ├── jest.config.js ├── .eslintrc.js ├── LICENSE ├── .gitignore ├── package.json └── CODE_OF_CONDUCT.md /README.md: -------------------------------------------------------------------------------- 1 | # Hangar 2 | One stop for all the tools hackathon sponsors need 3 | -------------------------------------------------------------------------------- /src/slack/constants.ts: -------------------------------------------------------------------------------- 1 | export const registerTeamActionId = 'registerTeam'; 2 | -------------------------------------------------------------------------------- /Authors.md: -------------------------------------------------------------------------------- 1 | # Authors 2 | 3 | - Spencer Kaiser (spencer.kaiser@aa.com) 4 | - John Kahn (john.kahn@aa.com) -------------------------------------------------------------------------------- /.env.sample: -------------------------------------------------------------------------------- 1 | SLACK_SIGNING_SECRET="XXXXXXXXXXXXXXXX" 2 | SLACK_BOT_TOKEN="xoxb-XXXXXXXXXXXXXXXX" 3 | 4 | NODE_ENV="development" -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "always", 3 | "singleQuote": true, 4 | "printWidth": 150, 5 | "tabWidth": 2, 6 | "useTabs": false, 7 | "trailingComma": "all" 8 | } 9 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 4 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import app from './app'; 2 | import logger from './logger'; 3 | 4 | const PORT = process.env.PORT || 3000; 5 | app.listen(PORT, () => { 6 | logger.info(`Listening on port ${PORT}`); 7 | }); 8 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # To lookup more information on an owner, visit: 2 | # https://ghe.aa.com/{USERNAME} 3 | # ... where "{USERNAME}" is the user's GitHub username. 4 | 5 | # Project owners 6 | # John Kahn, Spencer Kaiser 7 | * @johnkahn @spencerkaiser 8 | -------------------------------------------------------------------------------- /THIRD-PARTY-NOTICES.txt: -------------------------------------------------------------------------------- 1 | With the exception of dependencies documented within package.json and code written by those listed in Authors.md, this project is entirely composed of custom code. If 3rd party code is utilized in the future, attribution will be added here. 2 | -------------------------------------------------------------------------------- /src/slack/events/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from '@slack/bolt'; 2 | import logger from '../../logger'; 3 | import message from './message'; 4 | 5 | export default function register(app: App): void { 6 | logger.info('Registering event listeners'); 7 | message(app); 8 | } 9 | -------------------------------------------------------------------------------- /src/app.test.ts: -------------------------------------------------------------------------------- 1 | import 'jest'; 2 | import supertest from 'supertest'; 3 | import app from './app'; 4 | 5 | describe('GET /', () => { 6 | it('responds successfully', (done) => { 7 | supertest(app) 8 | .get('/') 9 | .expect(200, done); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /src/app.ts: -------------------------------------------------------------------------------- 1 | import 'dotenv/config'; 2 | import express from 'express'; 3 | import { slackApp } from './slack'; 4 | 5 | const app = express(); 6 | 7 | app.get('/', (_req, res) => { 8 | res.send('👋'); 9 | }); 10 | 11 | app.use(slackApp); 12 | 13 | export default app; 14 | -------------------------------------------------------------------------------- /src/slack/actions/index.ts: -------------------------------------------------------------------------------- 1 | import { App } from '@slack/bolt'; 2 | import logger from '../../logger'; 3 | import registerTeam from './registerTeam'; 4 | 5 | export default function register(app: App): void { 6 | logger.info('Registering action listeners'); 7 | registerTeam(app); 8 | } 9 | -------------------------------------------------------------------------------- /src/slack/README.md: -------------------------------------------------------------------------------- 1 | # Slack App Setup 2 | - Create an app on the [Slack API Site](api.slack.com) 3 | - Add a bot user 4 | - Add event subscriptions for `message.im` (Note: you'll need a local app running with [`ngrok`](https://ngrok.com) or an app url from your deployed app; append `/slack/events` to your URL) 5 | - Enable _Interactive Components_ and use your app URL and append `slack/events` -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "American Airlines Hangar: Hackathon Sponsor Toolkit", 3 | "description": "One stop for all the tools hackathon sponsors need", 4 | "repository": "https://github.com/AmericanAirlines/Hangar", 5 | "logo": "https://avatars2.githubusercontent.com/u/28813424?s=200&v=4", 6 | "keywords": ["node", "express", "typescript", "jest", "react", "American Airlines", "hackathon sponsor"] 7 | } 8 | -------------------------------------------------------------------------------- /src/slack/events/message.ts: -------------------------------------------------------------------------------- 1 | import { App } from '@slack/bolt'; 2 | import dashboardBlocks from '../blocks/dashboardBlocks'; 3 | 4 | function register(bolt: App): void { 5 | bolt.message(({ say }) => { 6 | // TODO: Use RTM to open a socket? How else will we accept resumes? 7 | say({ 8 | text: '', 9 | blocks: dashboardBlocks, 10 | }); 11 | }); 12 | } 13 | 14 | export default register; 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Pre-requisites: 2 | - [ ] I looked through both [open and closed issues](../issues?utf8=✓&q=is%3Aissue) and did not find another request for the same or similar feature. 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | globals: { 3 | 'ts-jest': { 4 | tsConfig: 'src/tsconfig.json', 5 | }, 6 | }, 7 | moduleFileExtensions: [ 8 | 'js', 9 | 'json', 10 | 'jsx', 11 | 'ts', 12 | 'tsx', 13 | ], 14 | roots: [ 15 | 'src', 16 | ], 17 | transform: { 18 | '^.+\\.(ts|tsx)$': 'ts-jest', 19 | }, 20 | testMatch: [ 21 | '**/*.test.(ts|js)', 22 | ], 23 | testEnvironment: 'node', 24 | preset: 'ts-jest', 25 | } 26 | -------------------------------------------------------------------------------- /src/slack/actions/registerTeam.ts: -------------------------------------------------------------------------------- 1 | import { App } from '@slack/bolt'; 2 | import { registerTeamActionId } from '../constants'; 3 | 4 | // Ignore snake_case types from @slack/bolt 5 | /* eslint-disable @typescript-eslint/camelcase */ 6 | 7 | function register(bolt: App): void { 8 | bolt.action({ action_id: registerTeamActionId }, async ({ ack, say }) => { 9 | ack(); 10 | say({ 11 | text: "You're registered!", 12 | }); 13 | }); 14 | } 15 | 16 | export default register; 17 | -------------------------------------------------------------------------------- /src/slack/index.ts: -------------------------------------------------------------------------------- 1 | import { App, ExpressReceiver, LogLevel } from '@slack/bolt'; 2 | import actions from './actions'; 3 | import events from './events'; 4 | 5 | const receiver = new ExpressReceiver({ signingSecret: process.env.SLACK_SIGNING_SECRET }); 6 | 7 | const bolt = new App({ 8 | receiver, 9 | token: process.env.SLACK_BOT_TOKEN, 10 | logLevel: process.env.NODE_ENV === 'development' ? LogLevel.DEBUG : LogLevel.INFO, 11 | }); 12 | 13 | // Register listeners: 14 | actions(bolt); 15 | events(bolt); 16 | 17 | export const slackApp = receiver.app; 18 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Pre-Requisites 2 | - [ ] Yes, I updated [Authors.md](../Authors.md) **OR** this is not my first contribution 3 | - [ ] Yes, I included and/or modified tests to cover relavent code **OR** my change is non-technical 4 | - [ ] Yes, I wrote this code entirely myself **OR** I properly attributed these changes in [Third Party Notices](../THIRD-PARTY-NOTICES.txt) 5 | 6 | ## Description of Changes 7 | 8 | 9 | ## Related Issues 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "moduleResolution": "node", 6 | "outDir": "../dist", 7 | "esModuleInterop": true, 8 | "noImplicitAny": true, 9 | "noEmitOnError": true, 10 | "sourceMap": true, 11 | "forceConsistentCasingInFileNames": true, 12 | "lib": ["esnext", "esnext.asynciterable"], 13 | "emitDecoratorMetadata": true, 14 | "experimentalDecorators": true 15 | }, 16 | "include": [ 17 | "./**/*.ts" 18 | ], 19 | "exclude": [ 20 | "node_modules", 21 | "./**/*.test.ts" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve. Please make sure to use a descriptive title for the issue. 4 | title: '[Bug] - YOUR_TITLE_HERE' 5 | labels: bug 6 | --- 7 | 8 | ### Pre-requisites: 9 | - [ ] I looked through both [open and closed issues](../issues?utf8=✓&q=is%3Aissue) and did not find an existing bug. 10 | 11 | ## Description 12 | 13 | 14 | ## Expected Behavior 15 | 16 | 17 | ## Actual Behavior 18 | 19 | 20 | ## Steps to Reproduce 21 | 22 | 23 | ## Other Information 24 | 25 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: '@typescript-eslint/parser', 3 | plugins: ['@typescript-eslint', 'jest'], 4 | env: { 5 | commonjs: true, 6 | es6: true, 7 | node: true, 8 | 'jest/globals': true, 9 | }, 10 | extends: ['airbnb-base', 'plugin:@typescript-eslint/recommended'], 11 | globals: { 12 | Atomics: 'readonly', 13 | SharedArrayBuffer: 'readonly', 14 | }, 15 | parserOptions: { 16 | ecmaVersion: 2018, 17 | }, 18 | rules: { 19 | 'import/no-extraneous-dependencies': ['error', { devDependencies: ['**/*.test.ts'] }], 20 | 'max-len': [0], 21 | 'import/prefer-default-export': ['off'], 22 | }, 23 | settings: { 24 | 'import/resolver': { 25 | node: { 26 | extensions: ['.js', '.ts'], 27 | }, 28 | }, 29 | }, 30 | }; 31 | -------------------------------------------------------------------------------- /src/slack/blocks/dashboardBlocks.ts: -------------------------------------------------------------------------------- 1 | import { KnownBlock, Block } from '@slack/types'; 2 | import { registerTeamActionId } from '../constants'; 3 | 4 | // Ignore snake_case types from @slack/bolt 5 | /* eslint-disable @typescript-eslint/camelcase */ 6 | 7 | const blocks: (KnownBlock | Block)[] = [ 8 | { 9 | type: 'section', 10 | text: { 11 | type: 'mrkdwn', 12 | text: 13 | "Hey there :wave: I'm a bot and I hope I can help you have an amazing experience this weekend! Here are some of the things I can help with:", 14 | }, 15 | }, 16 | { 17 | type: 'divider', 18 | }, 19 | { 20 | type: 'section', 21 | text: { 22 | type: 'mrkdwn', 23 | text: '*Register Your Team*\nHacking with us this weekend? Make sure you register your team so we know to reach out before judging starts!', 24 | }, 25 | accessory: { 26 | type: 'button', 27 | text: { 28 | type: 'plain_text', 29 | text: 'Register', 30 | }, 31 | action_id: registerTeamActionId, 32 | }, 33 | }, 34 | ]; 35 | 36 | export default blocks; 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project. 4 | title: '[Feature Request] - YOUR_TITLE_HERE' 5 | --- 6 | 7 | ### Pre-requisites: 8 | - [ ] I looked through both [open and closed issues](../issues?utf8=✓&q=is%3Aissue) and did not find another request for the same or similar feature. 9 | 10 | ## Is your feature request related to a problem, or an open issue? Describe the problem, and if applicable, reference the issue. 11 | 12 | 13 | 14 | 15 | ## Describe the solution you'd like 16 | 17 | 18 | 19 | ## Describe alternatives you've considered 20 | 21 | 22 | 23 | ## Additional context 24 | 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 American Airlines 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | # Build Directory 4 | dist 5 | 6 | # Logs 7 | logs 8 | *.log 9 | npm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | 13 | # Runtime data 14 | pids 15 | *.pid 16 | *.seed 17 | *.pid.lock 18 | 19 | # Directory for instrumented libs generated by jscoverage/JSCover 20 | lib-cov 21 | 22 | # Coverage directory used by tools like istanbul 23 | coverage 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (http://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # Typescript v1 declaration files 45 | typings/ 46 | 47 | # Optional npm cache directory 48 | .npm 49 | 50 | # Optional eslint cache 51 | .eslintcache 52 | 53 | # Optional REPL history 54 | .node_repl_history 55 | 56 | # Output of 'npm pack' 57 | *.tgz 58 | 59 | # Yarn Integrity file 60 | .yarn-integrity 61 | 62 | # dotenv environment variables file 63 | .env 64 | 65 | # IDE/Editor 66 | *.swp 67 | .idea/ 68 | *.iml 69 | .vscode/ 70 | -------------------------------------------------------------------------------- /src/logger.ts: -------------------------------------------------------------------------------- 1 | import winston, { format } from 'winston'; 2 | 3 | const level = process.env.LOG_LEVEL || 'debug'; 4 | 5 | // Winston Logging Levels 6 | // 0: emerg 7 | // 1: alert 8 | // 2: crit 9 | // 3: error 10 | // 4: warning 11 | // 5: notice 12 | // 6: info 13 | // 7: debug 14 | 15 | const simpleErrorFormat = winston.format((info) => { 16 | const newInfo = { ...info }; 17 | if (newInfo.level.includes('error')) { 18 | if (newInfo.stack) { 19 | const stack = newInfo.stack 20 | .split('\n') 21 | .slice(1) 22 | .join('\n'); 23 | 24 | newInfo.message += `\n${stack}`; 25 | } 26 | 27 | if (newInfo.data) { 28 | const data = JSON.stringify(newInfo.data, null, 4) 29 | .split('\n') 30 | .map((line) => ` ${line}`) 31 | .join('\n'); 32 | newInfo.message += `\n${data}`; 33 | } 34 | 35 | delete newInfo.code; 36 | delete newInfo.data; 37 | delete newInfo.stack; 38 | } 39 | 40 | return newInfo; 41 | }); 42 | 43 | const logger = winston.createLogger({ 44 | format: format.combine(format.colorize(), format.splat(), simpleErrorFormat(), format.simple()), 45 | transports: [new winston.transports.Console({ level })], 46 | levels: { 47 | emerg: 0, 48 | alert: 1, 49 | crit: 2, 50 | error: 3, 51 | warning: 4, 52 | notice: 5, 53 | info: 6, 54 | debug: 7, 55 | }, 56 | }); 57 | 58 | export default logger; 59 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hangar", 3 | "version": "1.0.0", 4 | "description": "One stop for all the tools hackathon sponsors need", 5 | "main": "index.js", 6 | "scripts": { 7 | "dev": "npm-run-all -l build -p build:watch start:watch", 8 | "start": "node dist/index.js", 9 | "start:watch": "nodemon -w dist -e js dist/index.js", 10 | "build": "tsc -p src/ --pretty", 11 | "build:watch": "npm run build -- -w", 12 | "build:ci": "run-s lint build test", 13 | "lint": "eslint src/**/*.ts --max-warnings 0", 14 | "lint:fix": "npm run lint -- --fix", 15 | "lint:staged": "lint-staged", 16 | "checkstyle": "prettier -l src/**/*.ts", 17 | "checkstyle:fix": "npm run checkstyle -- --write", 18 | "test": "jest", 19 | "test:changed": "jest -o" 20 | }, 21 | "repository": { 22 | "type": "git", 23 | "url": "git+https://github.com/AmericanAirlines/Hangar.git" 24 | }, 25 | "authors": [ 26 | "John Kahn ", 27 | "Spencer Kaiser " 28 | ], 29 | "license": "MIT", 30 | "bugs": { 31 | "url": "https://github.com/AmericanAirlines/Hangar/issues" 32 | }, 33 | "homepage": "https://github.com/AmericanAirlines/Hangar#readme", 34 | "engines": { 35 | "node": ">=10.0.0" 36 | }, 37 | "husky": { 38 | "hooks": { 39 | "pre-commit": "run-s build lint:staged test" 40 | } 41 | }, 42 | "lint-staged": { 43 | "linters": { 44 | "src/**/*.{js,ts}": [ 45 | "npm run checkstyle:fix", 46 | "npm run lint:fix", 47 | "git add" 48 | ] 49 | }, 50 | "ignore": [ 51 | "**/*.test.ts" 52 | ] 53 | }, 54 | "nodemonConfig": { 55 | "delay": "400" 56 | }, 57 | "dependencies": { 58 | "@slack/bolt": "^1.4.0", 59 | "@slack/types": "^1.2.1", 60 | "body-parser": "^1.19.0", 61 | "cors": "^2.8.5", 62 | "dotenv": "^6.2.0", 63 | "express": "^4.16.4", 64 | "typescript": "^3.3.3333", 65 | "winston": "^3.2.1" 66 | }, 67 | "devDependencies": { 68 | "@types/cors": "^2.8.6", 69 | "@types/dotenv": "^6.1.0", 70 | "@types/express": "^4.17.1", 71 | "@types/jest": "^24.0.6", 72 | "@types/node": "^11.9.5", 73 | "@types/supertest": "^2.0.8", 74 | "@types/winston": "^2.4.4", 75 | "@typescript-eslint/eslint-plugin": "^2.0.0", 76 | "@typescript-eslint/parser": "^2.0.0", 77 | "eslint": "^6.2.2", 78 | "eslint-config-airbnb-base": "^14.0.0", 79 | "eslint-plugin-import": "^2.18.2", 80 | "eslint-plugin-jest": "^22.15.2", 81 | "husky": "^1.3.1", 82 | "jest": "^24.1.0", 83 | "lint-staged": "^8.1.4", 84 | "nodemon": "^1.18.10", 85 | "npm-run-all": "^4.1.5", 86 | "prettier": "^1.18.2", 87 | "supertest": "^4.0.2", 88 | "ts-jest": "^24.0.0" 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to make participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies within all project spaces, and it also applies when 49 | an individual is representing the project or its community in public spaces. 50 | Examples of representing a project or community include using an official 51 | project e-mail address, posting via an official social media account, or acting 52 | as an appointed representative at an online or offline event. Representation of 53 | a project may be further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the [project team](mailto:john.kahn@aa.com,spencer.kaiser@aa.com). All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Hey there 👋 2 | First off, thanks for stopping by! At American, we're passionate about building products that improve the experience of our customers through technology. 3 | 4 | ## Bugs & Feature Requests 5 | Whether you found something that isn't working right, something that could be improved, or you'd like to suggest a feature, please start with the tasks below. 6 | 7 | ### Existing Issues 8 | Search through this project's [issues](../../../issues) and see if your issue/suggestion is already being tracked. If you find something that matches your issue, join the conversation! 9 | 10 | ### Create an Issue 11 | #### Bug Reports 12 | If you didn't find what you were looking for, [create a new Bug report](../../../issues/new?template=bug_report.md) and fill in the required fields to help steer us in the right direction. We'll check it out and get back to you when we can. 13 | 14 | #### Feature Requests 15 | If you didn't find what you were looking for, [create a new Feature request](../../../issues/new?template=feature_request.md) with a title starting with `[Feature Request] - ` to help us differentiate it from a bug. Give us as much information as you can about the feature you'd like to see added. We'll review your request and get back to you. If we feel that it's something that fits well with our project goals, we'll add relevant labels and add any additional details we feel might be valuable to the community. 16 | 17 | ## Contributing 18 | Interested in helping out? Awesome! Head on over to the [issues page](../../../issues) to see what we need help on. Highest priority items can always be found with the [high priority label](../../../issues?utf8=✓&q=is%3Aopen+label%3A"high+priority"+label%3A"help+wanted"+). 19 | 20 | Need a little help to get started? We've marked some tasks with the `help wanted` and `good first issue` labels. You can find those items [here](../../../issues?utf8=✓&q=is%3Aopen+label%3A"good+first+issue"+label%3A"help+wanted"+). After you find something you can contribute to, follow these steps to make your contribution: 21 | 1. Comment on the issue, letting us know that you want to take it. 22 | 1. Fork the repo. 23 | 1. Make your changes. 24 | 1. Create a pull request when you're ready to have your code reviewed. 25 | 26 | More info can be found in [Forking and Pull Requests](#forking-and-pull-requests) below. 27 | 28 | ### Forking and Pull Requests 29 | When you're ready to start writing code, make sure you [fork](https://help.github.com/articles/fork-a-repo/) this repo and use that fork to make your changes. It's also helpful to turn on [branch protection](https://help.github.com/en/articles/configuring-protected-branches) for your repo's `master` branch and make sure to enforce the protection for admins as well. 30 | 31 | #### Tracking Upstream 32 | To track and sync the main (upstream) repo, run this command to create a remote: `git remote add upstream git@github.com:AmericanAirlines/Hangar.git`. Whenever you need to sync your current branch with the `upstream master` branch, run `git pull upstream master`. 33 | 34 | #### Branching 35 | When you start development, sync your local `master` with upstream using the command above, then create a new branch with `git checkout -b yourNewBranchName` and begin making your changes. 36 | 37 | #### Committing 38 | When you are ready to commit code, please do so on a feature/bugfix branch and commit only the files that are relevant to your change (e.g., **do not use** `git add .` or `git commit -a`). After the first time you run `npm i` to install dependencies, a git `pre-commit` will be setup which will perform several actions when you run `git commit`: 39 | - `lint:fix` which will lint all changed files and perform corrections where possible 40 | - `checkstyle:fix` which will checkstyle all changed files and perform corrections where possible 41 | - `git add` which will re-add any files that were modified by these scripts 42 | - `test` which will run through the full test suite 43 | If the above is unable to complete because of a `lint`, `checkstyle`, or `test` error, the commit will fail and you will be required to address the problem before being able to commit successfully. 44 | 45 | Finally, if you need to install a new dependency, please use `git add --patch package-lock.json` to add any relevant hunks from `package-lock.json` to your commit, instead of adding _all_ changes in the file. 46 | 47 | #### Creating a Pull Request 48 | As soon as you're ready for a code review, create a [pull request](https://help.github.com/articles/about-pull-requests/) and follow the steps below: 49 | 1. Use the `Hangar:master` branch as your PR's base branch and select your branch as the `compare` branch 50 | 1. Make sure your PR branch is as up-to-date as possible (we'll handle merge conflicts if one arises) 51 | 1. Fill out all fields suggested by the template, including links to issue(s) your PR addresses. This will help prevent duplication of efforts. For information on how to reference issues to close them, read up on [closing issues using keywords here](https://help.github.com/articles/closing-issues-using-keywords/). 52 | 1. If it's your first contribution, make sure your PR includes a modification to `AUTHORS.md` to include your first and last name as well as your email address *or* your GitHub handle 53 | 54 | #### Attribution 55 | If your contribution uses code from another source, make sure you properly attribute it. Cite the source of your code where the code is used and include attribution in `ThirdPartyNotices.md`. Both of these must be present in your PR before we'll merge. 56 | --------------------------------------------------------------------------------