Skip to content

swap to prember #123

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

root = true


[*]
end_of_line = lf
charset = utf-8
Expand Down
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# misc
/coverage/
!.*
.*/
.eslintcache

# ember-try
/.node_modules.ember-try/
Expand Down
60 changes: 38 additions & 22 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,59 @@
'use strict';

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module'
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: [
'ember'
],
plugins: ['ember'],
extends: [
'eslint:recommended',
'plugin:ember/recommended'
'plugin:ember/recommended',
'plugin:prettier/recommended',
],
env: {
browser: true
},
rules: {
browser: true,
},
rules: {},
overrides: [
// node files
{
files: [
'fastboot-server.js',
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js',
'server/**/*.js'
'./.eslintrc.js',
'./.prettierrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./testem.js',
'./blueprints/*/index.js',
'./config/**/*.js',
'./lib/*/index.js',
'./server/**/*.js',
],
parserOptions: {
sourceType: 'script',
ecmaVersion: 2015
},
env: {
browser: false,
node: true
}
}
]
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
rules: {
// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off',
},
},
{
// Test files:
files: ['tests/**/*-test.{js,ts}'],
extends: ['plugin:qunit/recommended'],
},
],
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/.env*
/.pnp*
/.sass-cache
/.eslintcache
/connect.lock
/coverage/
/libpeerconnection.log
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use-node-version=20.18.1
21 changes: 21 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.eslintcache

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

module.exports = {
singleQuote: true,
};
2 changes: 1 addition & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

module.exports = {
extends: 'recommended'
extends: 'recommended',
};
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ To run the website locally:
* `ember test`
* `ember test --server`

### Linting

* `npm run lint`
* `npm run lint:fix`

### Building

* `ember build` (development)
Expand Down
14 changes: 14 additions & 0 deletions app/adapters/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* eslint-disable ember/no-classic-classes, ember/use-ember-data-rfc-395-imports, prettier/prettier */
import DS from 'ember-data';

export default DS.JSONAPIAdapter.extend({
urlForFindAll(modelName) {
const path = this.pathForType(modelName);
return `/${path}/all.json`;
},

urlForFindRecord(id, modelName) {
const path = this.pathForType(modelName);
return `/${path}/${id}.json`;
}
});
16 changes: 7 additions & 9 deletions app/app.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import Application from '@ember/application';
import Resolver from './resolver';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';
import config from 'fastboot-website/config/environment';

const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Resolver
});
export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
}

loadInitializers(App, config.modulePrefix);

export default App;
1 change: 1 addition & 0 deletions app/components/command-prompt/component.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable ember/no-classic-classes, ember/no-classic-components, ember/require-tagless-components, prettier/prettier */
import Component from '@ember/component';

export default Component.extend({
Expand Down
1 change: 1 addition & 0 deletions app/components/fastboot-logo/component.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable ember/no-classic-classes, ember/no-classic-components, ember/require-tagless-components, prettier/prettier */
import Component from '@ember/component';

export default Component.extend({
Expand Down
1 change: 1 addition & 0 deletions app/components/main-hero-terminal/component.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable ember/no-classic-classes, ember/no-classic-components, ember/require-tagless-components, prettier/prettier */
import Component from '@ember/component';

export default Component.extend({
Expand Down
1 change: 1 addition & 0 deletions app/components/main-hero/component.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable ember/no-classic-classes, ember/no-classic-components, ember/require-tagless-components, prettier/prettier */
import Component from '@ember/component';

export default Component.extend({
Expand Down
1 change: 1 addition & 0 deletions app/components/main-hero/meetup/template.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{! template-lint-disable link-rel-noopener }}
<a
href="https://www.eventbrite.com/e/ember-fastboot-ssr-beyond-tickets-144468965565"
class="main-hero-meetup"
Expand Down
1 change: 1 addition & 0 deletions app/components/main-hero/template.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{! template-lint-disable no-curly-component-invocation no-implicit-this no-link-to-positional-params }}
<div>
<div class="center">
{{fastboot-logo}}
Expand Down
1 change: 1 addition & 0 deletions app/components/main-nav.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable ember/no-classic-classes, ember/no-classic-components, ember/require-tagless-components, prettier/prettier */
import Component from '@ember/component';

export default Component.extend({
Expand Down
1 change: 1 addition & 0 deletions app/components/nav-bar.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable ember/no-classic-classes, ember/no-classic-components, ember/no-component-lifecycle-hooks, ember/no-jquery, ember/require-tagless-components, prettier/prettier */
import $ from 'jquery';
import Component from "@ember/component";

Expand Down
29 changes: 9 additions & 20 deletions app/components/route-error.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
/* eslint-disable ember/no-classic-classes, ember/no-classic-components, ember/require-tagless-components */
import Component from '@ember/component';
import { computed } from '@ember/object';
import markdownFiles from 'ember-fr-markdown-file/markdownFiles';

export default Component.extend({
_parseObj(obj, dir) {
let prefix = dir || '';
let result = [];
let that = this;
for (let prop in obj) {
let value = obj[prop];
if (typeof value === 'object') {
result.push(that._parseObj(value, prop));
} else {
if (prop !== 'intro') {
result.push(`${prefix}/${prop}`.replace(/^\//, ''));
}
}
}
return result;
},
availablePages: computed(function() {
return [].concat.apply([], this._parseObj(markdownFiles));
})
availablePages: computed(function () {
return [
'quickstart',
'docs/user-guide',
'docs/deploying',
'docs/addon-author-guide',
];
}),
});
7 changes: 7 additions & 0 deletions app/models/markdown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* eslint-disable ember/use-ember-data-rfc-395-imports, prettier/prettier */
import DS from 'ember-data';
const { Model, attr } = DS;

export default Model.extend({
content: attr()
});
3 changes: 0 additions & 3 deletions app/resolver.js

This file was deleted.

26 changes: 13 additions & 13 deletions app/router.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
/* eslint-disable ember/classic-decorator-no-classic-methods, ember/no-ember-super-in-es-classes, ember/no-get, ember/no-get-with-default, ember/no-incorrect-calls-with-inline-anonymous-functions, prettier/prettier */
import { get } from '@ember/object';
import { run } from '@ember/runloop';
import EmberRouter from '@ember/routing/router';
import config from './config/environment';
import { inject as injectService } from '@ember/service';
import config from 'fastboot-website/config/environment';
import { inject as service } from '@ember/service';

const Router = EmberRouter.extend({
location: config.locationType,
rootURL: config.rootURL,
metrics: injectService(),
fastboot: injectService(),
export default class Router extends EmberRouter {
location = config.locationType;
rootURL = config.rootURL;

@service metrics;
@service fastboot;

didTransition() {
this._super(...arguments);
if (!get(this, 'fastboot.isFastBoot')) {
this._scrollPage();
this._trackPage();
}
},
}

_scrollPage() {
if (this.fastboot.isFastBoot) {
Expand All @@ -35,24 +37,22 @@ const Router = EmberRouter.extend({
}
window.scrollTo(0, position);
});
},
}

_trackPage() {
if (this.fastboot.isFastBoot) {
return;
}

run.scheduleOnce('afterRender', this, () => {
let page = document.location.pathname;
let title = this.getWithDefault('currentRouteName', 'unknown');

this.metrics.trackPage({ page, title });
});
}
});
};

Router.map(function() {
this.route('page', { path: '*path' });
});

export default Router;
5 changes: 2 additions & 3 deletions app/routes/application.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint-disable ember/no-classic-classes, prettier/prettier */
import Route from '@ember/routing/route';
import { get } from '@ember/object';
import markdownFiles from 'ember-fr-markdown-file/markdownFiles';

export default Route.extend({
model() {
return get(markdownFiles, 'intro');
return this.store.find('markdown', 'intro');
}
});
11 changes: 7 additions & 4 deletions app/routes/page.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/* eslint-disable ember/no-classic-classes */
import Route from '@ember/routing/route';
import { get } from '@ember/object';
import markdownFiles from 'ember-fr-markdown-file/markdownFiles';

export default Route.extend({
model(params) {
return get(markdownFiles, params.path.replace(/\//g, '.')) || null;
}
return this.store.findAll('markdown', { reload: true }).then((result) => {
return result.toArray().find((m) => {
return m.id === params.path;
});
});
},
});
Loading