ember-tribe 0.6.6 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,15 +2,8 @@ ember-tribe
2
2
  ==============================================================================
3
3
 
4
4
  An addon that connects EmberJS to Tribe API.
5
- Tribe is a project management framework by Wildfire - https://github.com/wil-ldf-ire/tribe
5
+ Tribe is a project management framework by Postcode - https://github.com/tribe-framework/tribe
6
6
 
7
- In config/environment.js of your ember installation:
8
- ```
9
- //Wildfire Tribe config for EmberJS
10
- TribeENV: {
11
- API_URL: 'https://xyz.com/api',
12
- },
13
- ```
14
7
 
15
8
  Compatibility
16
9
  ------------------------------------------------------------------------------
@@ -23,15 +16,24 @@ Compatibility
23
16
  Installation
24
17
  ------------------------------------------------------------------------------
25
18
 
19
+ 1. Install
26
20
  ```
27
21
  ember install ember-tribe
28
22
  ```
29
23
 
24
+ 2. Configure
25
+ - Enter TRIBE_API_URL in .env file in Ember directory.
26
+
27
+ 3. Sync Tribe's types.json with Ember Models
28
+ ```
29
+ php sync-types.php
30
+ ```
31
+
30
32
 
31
33
  Usage
32
34
  ------------------------------------------------------------------------------
33
35
 
34
- For more info visit https://wildfiretech.co/page/our-approach
36
+ For more info visit https://postcodesolutions.com
35
37
 
36
38
 
37
39
  Contributing
@@ -0,0 +1 @@
1
+ TRIBE_API_URL=""
@@ -3,7 +3,7 @@ import ENV from '<%= dasherizedPackageName %>/config/environment';
3
3
  import { underscore } from '@ember/string';
4
4
 
5
5
  export default class ApplicationAdapter extends JSONAPIAdapter {
6
- host = ENV.TribeENV.BASE_URL;
6
+ host = ENV.TribeENV.API_URL;
7
7
  namespace = 'api.php';
8
8
 
9
9
  pathForType(type) {
@@ -0,0 +1,13 @@
1
+ <?php
2
+ $types = json_decode(file_get_contents('../../config/types.json'), true);
3
+
4
+ $commands = "rm app/models -R; ";
5
+ $commands = "rm tests/unit/models -R; ";
6
+ $commands = "mkdir app/models; ";
7
+
8
+ foreach (array_keys($types) as $type) {
9
+ $commands .= "echo \"import Model, { attr } from '@ember-data/model'; export default class ".ucfirst($type)."Model extends Model { @attr modules; }\" >> app/models/".$type.".js; ";
10
+ }
11
+
12
+ exec($commands);
13
+ ?>
@@ -6,6 +6,7 @@ module.exports = {
6
6
  afterInstall() {
7
7
  return this.addAddonsToProject({
8
8
  packages: [
9
+ { name: 'ember-cli-dotenv' },
9
10
  { name: 'ember-cli-sass' },
10
11
  { name: 'ember-cli-favicon' },
11
12
  { name: '@ember/optional-features' },
@@ -1,5 +1,14 @@
1
1
  'use strict';
2
2
 
3
3
  module.exports = function (/* environment, appConfig */) {
4
- return {};
5
- };
4
+ let ENV = {
5
+
6
+ //Wildfire Tribe config for EmberJS
7
+ TribeENV: {
8
+ API_URL: process.env.TRIBE_API_URL,
9
+ },
10
+
11
+ };
12
+
13
+ return ENV;
14
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-tribe",
3
- "version": "0.6.6",
3
+ "version": "1.1.0",
4
4
  "description": "The default blueprint for using Tribe within EmberJS.",
5
5
  "keywords": [
6
6
  "ember-addon"