Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ember-tomster authored and aerovulpe committed Sep 25, 2023
0 parents commit 441e88d
Show file tree
Hide file tree
Showing 42 changed files with 56,198 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false

[*.{diff,md}]
trim_trailing_whitespace = false
15 changes: 15 additions & 0 deletions .ember-cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
/**
Ember CLI sends analytics information by default. The data is completely
anonymous, but there are times when you might want to disable this behavior.

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false,

/**
Setting `isTypeScriptProject` to true will force the blueprint generators to generate TypeScript
rather than JavaScript by default, when a TypeScript version of a given blueprint is available.
*/
"isTypeScriptProject": false
}
13 changes: 13 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# unconventional js
/blueprints/*/files/

# compiled output
/dist/

# misc
/coverage/
!.*
.*/

# ember-try
/.node_modules.ember-try/
56 changes: 56 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
'use strict';

module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},
},
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true,
},
rules: {},
overrides: [
// node files
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./lib/*/index.js',
'./server/**/*.js',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
extends: ['plugin:n/recommended'],
},
{
// test files
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
push:
branches:
- main
- master
pull_request: {}

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
lint:
name: "Lint"
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Install Dependencies
run: npm ci
- name: Lint
run: npm run lint

test:
name: "Test"
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Install Dependencies
run: npm ci
- name: Run Tests
run: npm test
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# compiled output
/dist/
/declarations/

# dependencies
/node_modules/

# misc
/.env*
/.pnp*
/.eslintcache
/coverage/
/npm-debug.log*
/testem.log
/yarn-error.log

# ember-try
/.node_modules.ember-try/
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# broccoli-debug
/DEBUG/
/.idea/
13 changes: 13 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# unconventional js
/blueprints/*/files/

# compiled output
/dist/

# misc
/coverage/
!.*
.*/

# ember-try
/.node_modules.ember-try/
12 changes: 12 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

module.exports = {
overrides: [
{
files: '*.{js,ts}',
options: {
singleQuote: true,
},
},
],
};
8 changes: 8 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# unconventional files
/blueprints/*/files/

# compiled output
/dist/

# addons
/.node_modules.ember-try/
5 changes: 5 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
};
5 changes: 5 additions & 0 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended',
};
3 changes: 3 additions & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignore_dirs": ["dist"]
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# chatkitty-indie-hackers-demo
12 changes: 12 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from 'chatkitty-indie-hackers-demo/config/environment';

export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
}

loadInitializers(App, config.modulePrefix);
Empty file added app/components/.gitkeep
Empty file.
Empty file added app/controllers/.gitkeep
Empty file.
5 changes: 5 additions & 0 deletions app/controllers/chat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Controller from '@ember/controller';

export default class ChatController extends Controller {
queryParams = ['current-user'];
}
Empty file added app/helpers/.gitkeep
Empty file.
24 changes: 24 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>IH Demo</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">

{{content-for "head"}}

<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css">
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/chatkitty-indie-hackers-demo.css">

{{content-for "head-footer"}}
</head>
<body>
{{content-for "body"}}

<script src="{{rootURL}}assets/vendor.js"></script>
<script src="{{rootURL}}assets/chatkitty-indie-hackers-demo.js"></script>

{{content-for "body-footer"}}
</body>
</html>
Empty file added app/models/.gitkeep
Empty file.
11 changes: 11 additions & 0 deletions app/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import EmberRouter from '@ember/routing/router';
import config from 'chatkitty-indie-hackers-demo/config/environment';

export default class Router extends EmberRouter {
location = config.locationType;
rootURL = config.rootURL;
}

Router.map(function () {
this.route('chat', { path: '/chat/:username' });
});
Empty file added app/routes/.gitkeep
Empty file.
55 changes: 55 additions & 0 deletions app/routes/chat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import Route from '@ember/routing/route';

export default class ChatRoute extends Route {
model(params, transition) {
let currentUser = transition.to.queryParams['current-user'] || 'csallen';
let username = params.username;

const userMap = {
csallen: {
display_name: 'Courtland Allen',
display_picture:
'https://storage.googleapis.com/indie-hackers.appspot.com/avatars/300x300_ibTLPyjwVebnZjMGKvz6ztarnuV2.webp?1694472104876',
},
channingallen: {
display_name: 'Channing Allen',
display_picture:
'https://storage.googleapis.com/indie-hackers.appspot.com/avatars/300x300_PWairgiOpneHvkGJri7RVbtORKI2.webp?1689703300131',
},
HelpStay: {
display_name: 'Shay',
display_picture:
'https://storage.googleapis.com/indie-hackers.appspot.com/avatars/300x300_tDOUNPCt56OY5voGhwJxT1iFnj82.webp?1691251548769',
},
goutham8: {
display_name: 'Goutham',
display_picture:
'https://storage.googleapis.com/indie-hackers.appspot.com/avatars/300x300_jk4udTil1vUsZWWZgH9W6emiI0U2.webp?1683385735709',
},
gwesterman: {
display_name: 'Gordon Westerman',
display_picture:
'https://storage.googleapis.com/indie-hackers.appspot.com/avatars/300x300_61tEWxEjhzVD42Gd5Lx6PQCUhiW2.webp?1693919932732',
},
aerovulpe: {
display_name: 'Aaron Nwabuoku',
display_picture:
'https://storage.googleapis.com/indie-hackers.appspot.com/avatars/300x300_Fpnxr5j7s0YXVCFxpsZWs0oN3Ac2.webp?1695569564831',
},
August_BK: {
display_name: 'Raymond Chen',
display_picture:
'https://storage.googleapis.com/indie-hackers.appspot.com/avatars/96x96_B66BJ8EXJEZZZnKmGVwBnd31ChL2.webp',
},
};

return {
username: currentUser,
route: {
name: 'direct-messages',
chat_users: [username],
},
profile: userMap[currentUser],
};
}
}
9 changes: 9 additions & 0 deletions app/routes/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Route from '@ember/routing/route';
import { service } from '@ember/service';

export default class IndexRoute extends Route {
@service router;
beforeModel() {
this.router.transitionTo('chat', 'channingallen');
}
}
Loading

0 comments on commit 441e88d

Please sign in to comment.