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 +11 -9
- package/blueprints/ember-tribe/files/.env +1 -0
- package/blueprints/ember-tribe/files/app/adapters/application.js +1 -1
- package/blueprints/ember-tribe/files/sync-types.php +13 -0
- package/blueprints/ember-tribe/index.js +1 -0
- package/config/environment.js +11 -2
- package/package.json +1 -1
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
|
|
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://
|
|
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.
|
|
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
|
+
?>
|
package/config/environment.js
CHANGED