-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🎉 First implementation of the website with Ember.js #175
Open
frinyvonnick
wants to merge
3
commits into
master
Choose a base branch
from
website
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM node:12-alpine | ||
RUN apk add --no-cache git | ||
WORKDIR /usr/local/app | ||
COPY package.json package-lock.json ./ | ||
RUN npm ci | ||
COPY src/ src | ||
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "gitmoji-changelog-server", | ||
"version": "1.0.0", | ||
"main": "src/index.js", | ||
"license": "MIT", | ||
"dependencies": { | ||
"cors": "^2.8.5", | ||
"express": "^4.17.1", | ||
"fs-extra": "^8.1.0", | ||
"gitmoji-changelog": "^2.0.1", | ||
"simple-git": "^1.129.0" | ||
}, | ||
"scripts": { | ||
"start": "node src/index.js" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* | ||
!src/ | ||
!package*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const express = require('express') | ||
const path = require('path') | ||
const os = require('os') | ||
const fs = require('fs') | ||
const childProcess = require('child_process') | ||
const { removeSync } = require('fs-extra') | ||
const simpleGit = require('simple-git/promise') | ||
const cors = require('cors') | ||
|
||
const app = express() | ||
const port = process.env.PORT | ||
|
||
app.use(cors()) | ||
|
||
app.get('/', async (req, res) => { | ||
const { repository } = req.query | ||
const tempDir = path.join(os.tmpdir(), 'gitmoji-changelog') | ||
if (fs.existsSync(tempDir)) removeSync(tempDir) | ||
fs.mkdirSync(tempDir) | ||
|
||
const simpleGitInstance = simpleGit(tempDir) | ||
|
||
await simpleGitInstance.clone(repository) | ||
|
||
const cwd = path.join(tempDir, repository.split('/').pop().slice(0, -4)) | ||
childProcess.execSync(path.join(__dirname, '..', 'node_modules/.bin/gitmoji-changelog'), { cwd }) | ||
|
||
const output = fs.readFileSync(path.join(cwd, 'CHANGELOG.md')) | ||
removeSync(tempDir) | ||
|
||
res.send(output.toString('utf8')) | ||
}) | ||
app.listen(port, () => console.log(`Example app listening on port ${port}!`)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
/** | ||
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# unconventional js | ||
/blueprints/*/files/ | ||
/vendor/ | ||
|
||
# compiled output | ||
/dist/ | ||
/tmp/ | ||
|
||
# dependencies | ||
/bower_components/ | ||
/node_modules/ | ||
|
||
# misc | ||
/coverage/ | ||
!.* | ||
|
||
# ember-try | ||
/.node_modules.ember-try/ | ||
/bower.json.ember-try | ||
/package.json.ember-try |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
module.exports = { | ||
root: true, | ||
parser: 'babel-eslint', | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
ecmaFeatures: { | ||
legacyDecorators: true | ||
} | ||
}, | ||
plugins: [ | ||
'ember' | ||
], | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:ember/recommended' | ||
], | ||
env: { | ||
browser: true | ||
}, | ||
rules: { | ||
'ember/no-jquery': 'error' | ||
}, | ||
overrides: [ | ||
// node files | ||
{ | ||
files: [ | ||
'.eslintrc.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 | ||
}, | ||
plugins: ['node'], | ||
rules: Object.assign({}, require('eslint-plugin-node').configs.recommended.rules, { | ||
// add your custom rules and overrides for node files here | ||
|
||
// this can be removed once the following is fixed | ||
// https://github.com/mysticatea/eslint-plugin-node/issues/77 | ||
'node/no-unpublished-require': 'off' | ||
}) | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# compiled output | ||
/dist/ | ||
/tmp/ | ||
|
||
# dependencies | ||
/bower_components/ | ||
/node_modules/ | ||
|
||
# misc | ||
/.env* | ||
/.pnp* | ||
/.sass-cache | ||
/connect.lock | ||
/coverage/ | ||
/libpeerconnection.log | ||
/npm-debug.log* | ||
/testem.log | ||
/yarn-error.log | ||
|
||
# ember-try | ||
/.node_modules.ember-try/ | ||
/bower.json.ember-try | ||
/package.json.ember-try |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
extends: 'octane' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
language: node_js | ||
node_js: | ||
- "8" | ||
|
||
sudo: false | ||
dist: trusty | ||
|
||
addons: | ||
chrome: stable | ||
|
||
cache: | ||
yarn: true | ||
|
||
env: | ||
global: | ||
# See https://git.io/vdao3 for details. | ||
- JOBS=1 | ||
|
||
branches: | ||
only: | ||
- master | ||
|
||
before_install: | ||
- curl -o- -L https://yarnpkg.com/install.sh | bash | ||
- export PATH=$HOME/.yarn/bin:$PATH | ||
|
||
install: | ||
- yarn install --non-interactive | ||
|
||
script: | ||
- yarn lint:hbs | ||
- yarn lint:js | ||
- yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"ignore_dirs": ["tmp", "dist"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# gitmoji-changelog-website | ||
|
||
This README outlines the details of collaborating on this Ember application. | ||
A short introduction of this app could easily go here. | ||
|
||
## Prerequisites | ||
|
||
You will need the following things properly installed on your computer. | ||
|
||
* [Git](https://git-scm.com/) | ||
* [Node.js](https://nodejs.org/) | ||
* [Yarn](https://yarnpkg.com/) | ||
* [Ember CLI](https://ember-cli.com/) | ||
* [Google Chrome](https://google.com/chrome/) | ||
|
||
## Installation | ||
|
||
* `git clone <repository-url>` this repository | ||
* `cd gitmoji-changelog-website` | ||
* `yarn install` | ||
|
||
## Running / Development | ||
|
||
* `ember serve` | ||
* Visit your app at [http://localhost:4200](http://localhost:4200). | ||
* Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests). | ||
|
||
### Code Generators | ||
|
||
Make use of the many generators for code, try `ember help generate` for more details | ||
|
||
### Running Tests | ||
|
||
* `ember test` | ||
* `ember test --server` | ||
|
||
### Linting | ||
|
||
* `yarn lint:hbs` | ||
* `yarn lint:js` | ||
* `yarn lint:js --fix` | ||
|
||
### Building | ||
|
||
* `ember build` (development) | ||
* `ember build --environment production` (production) | ||
|
||
### Deploying | ||
|
||
Specify what it takes to deploy your app. | ||
|
||
## Further Reading / Useful Links | ||
|
||
* [ember.js](https://emberjs.com/) | ||
* [ember-cli](https://ember-cli.com/) | ||
* Development Browser Extensions | ||
* [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi) | ||
* [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 './config/environment'; | ||
|
||
export default class App extends Application { | ||
modulePrefix = config.modulePrefix; | ||
podModulePrefix = config.podModulePrefix; | ||
Resolver = Resolver; | ||
} | ||
|
||
loadInitializers(App, config.modulePrefix); |
Empty file.
24 changes: 24 additions & 0 deletions
24
packages/gitmoji-changelog-website/app/components/repository-input.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<section aria-label="repository input"> | ||
<h2>Type your repository's url</h2> | ||
<form {{on "submit" this.onSubmit}}> | ||
<label for="repository" class="visuallyhidden">Repository's url</label> | ||
<input | ||
id="repository" | ||
name="repository" | ||
type="text" | ||
value={{this.repositoryUrl}} | ||
{{on "keydown" this.updateRepositoryUrl}} | ||
placeholder="https://github.com/frinyvonnick/gitmoji-changelog.git" | ||
/> | ||
{{#if this.changelog}} | ||
<section aria-label="changelog"> | ||
{{markdown-to-html this.changelog}} | ||
</section> | ||
{{/if}} | ||
{{#if this.loading}} | ||
<section aria-label="changelog"> | ||
<p>Loading...</p> | ||
</section> | ||
{{/if}} | ||
</form> | ||
</section> |
33 changes: 33 additions & 0 deletions
33
packages/gitmoji-changelog-website/app/components/repository-input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import Component from "@glimmer/component"; | ||
import { tracked } from "@glimmer/tracking"; | ||
import { action } from "@ember/object"; | ||
|
||
export default class RepositoryInputComponent extends Component { | ||
@tracked repositoryUrl | ||
@tracked changelog = '' | ||
@tracked loading = false | ||
|
||
@action | ||
onSubmit(e) { | ||
e.preventDefault() | ||
this.loading = true | ||
fetch(`http://localhost:9999/?repository=${this.repositoryUrl}`) | ||
.then(res => res.text()) | ||
.then(changelog => { | ||
const formattedChangelog = changelog | ||
.split('\n') | ||
.slice(1) | ||
.join('\n') | ||
this.changelog = formattedChangelog | ||
this.loading = false | ||
}) | ||
.catch((err) => { | ||
console.error(err) | ||
}) | ||
} | ||
|
||
@action | ||
updateRepositoryUrl(e) { | ||
this.repositoryUrl = e.target.value | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<section aria-label="usage"> | ||
<h2>Open your terminal and execute the following command:</h2> | ||
<pre>npx gitmoji-changelog</pre> | ||
</section> |
Empty file.
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no
this.loading = false
incatch
part ?