File tree Expand file tree Collapse file tree 4 files changed +108
-100
lines changed Expand file tree Collapse file tree 4 files changed +108
-100
lines changed Original file line number Diff line number Diff line change 1
- import fetch from 'fetch' ;
2
1
import Service from '@ember/service' ;
3
2
import { tracked } from '@glimmer/tracking' ;
4
3
4
+ import mappings from 'ember-rfc176-data/mappings.json' ;
5
+
5
6
const LOCALNAME_CONVERSIONS = {
6
7
Object : 'EmberObject' ,
7
8
Array : 'EmberArray' ,
@@ -13,8 +14,6 @@ export default class LegacyModuleMappingsService extends Service {
13
14
14
15
async initMappings ( ) {
15
16
try {
16
- let response = await this . fetch ( ) ;
17
- let mappings = await response . json ( ) ;
18
17
let newMappings = this . buildMappings ( mappings ) ;
19
18
this . mappings = newMappings ;
20
19
} catch ( e ) {
@@ -33,9 +32,9 @@ export default class LegacyModuleMappingsService extends Service {
33
32
}
34
33
35
34
fetch ( ) {
36
- return fetch ( '/assets/mappings.json' ) ;
35
+ // TODO refactor app to not use this fetch method
36
+ return mappings ;
37
37
}
38
-
39
38
getModule ( name , documentedModule ) {
40
39
if ( ! this . mappings ) {
41
40
return '' ;
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
const EmberApp = require ( 'ember-cli/lib/broccoli/ember-app' ) ;
4
- const Funnel = require ( 'broccoli-funnel' ) ;
5
- const mergeTrees = require ( 'broccoli-merge-trees' ) ;
6
4
const envIsProduction = process . env . EMBER_ENV === 'production' ;
7
5
const premberUrls = require ( './prember-urls' ) ;
8
6
const nodeSass = require ( 'node-sass' ) ;
@@ -57,12 +55,6 @@ module.exports = function (defaults) {
57
55
} ,
58
56
} ) ;
59
57
60
- let mappingsTree = new Funnel ( 'node_modules/ember-rfc176-data/' , {
61
- srcDir : '/' ,
62
- include : [ 'mappings.json' ] ,
63
- destDir : '/assets/' ,
64
- } ) ;
65
-
66
58
const { Webpack } = require ( '@embroider/webpack' ) ;
67
59
const appTree = require ( '@embroider/compat' ) . compatBuild ( app , Webpack , {
68
60
staticAddonTrees : true ,
@@ -72,5 +64,5 @@ module.exports = function (defaults) {
72
64
staticComponents : true ,
73
65
} ) ;
74
66
75
- return mergeTrees ( [ require ( 'prember' ) . prerender ( app , appTree ) , mappingsTree ] ) ;
67
+ return require ( 'prember' ) . prerender ( app , appTree ) ;
76
68
} ;
Original file line number Diff line number Diff line change 61
61
"bourbon-neat" : " ^1.9.1" ,
62
62
"broccoli-asset-rev" : " ^3.0.0" ,
63
63
"broccoli-funnel" : " ^2.0.1" ,
64
- "broccoli-merge-trees" : " ^2.0.0" ,
65
64
"ember-a11y-testing" : " ^0.5.4" ,
66
65
"ember-anchor" : " ^1.0.3" ,
67
66
"ember-auto-import" : " ^2.7.2" ,
You can’t perform that action at this time.
0 commit comments