Skip to content
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

Update ember-firebase-dependency and usage #140

Merged
merged 2 commits into from
Dec 10, 2020
Merged
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
19 changes: 19 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,29 @@ module.exports = {
globals: {
FastBoot: 'readonly',
},
settings: {
'import/resolver': {
node: {
extensions: ['.mjs', '.js', '.json', '.ts']
}
},
'import/extensions': [
'.js',
'.mjs',
'.jsx',
'.ts',
],
},
rules: {
'semi': 'off', // enforced by @typescript-eslint/semi
'import/no-unresolved': 'off',
'import/no-extraneous-dependencies': 'off',
'import/extensions': ['error', 'ignorePackages', {
js: 'never',
mjs: 'never',
jsx: 'never',
ts: 'never',
}],
'class-methods-use-this': 'off',
'no-underscore-dangle': 'off',
},
Expand Down
2 changes: 1 addition & 1 deletion addon/transforms/timestamp.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { typeOf } from '@ember/utils';
import Transform from '@ember-data/serializer/transform';

import firebase from 'firebase';
import firebase from 'firebase/app';

export default class TimestampTransform extends Transform {
public deserialize(value: firebase.firestore.Timestamp): Date {
Expand Down
22 changes: 22 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Getting Started

## Pre-setup

In your `ember-cli-build.js`, set the exclusion of `'firebase'` in the `ember-auto-import` settings. This is because `firebase` package is already included as a shim in this addon.

```javascript
'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function (defaults) {
const app = new EmberApp(defaults, {
autoImport: {
exclude: ['firebase']
}
});

...

return app.toTree();
};
```

## Configuration

### 1. Setup Firebase and Addon Configuration
Expand Down
3 changes: 3 additions & 0 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
module.exports = function (defaults) {
const app = new EmberAddon(defaults, {
'ember-cli-babel': { includePolyfill: true },
autoImport: {
exclude: ['firebase']
}
});

/*
Expand Down
Loading