Skip to content

Commit a55691a

Browse files
committed
fix(gen): fix another type stripping; also TS doesn't like default exports
1 parent bf8f9fc commit a55691a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

Diff for: src/generators/app/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,10 @@ export class Generator extends Base {
483483
.find(jscodeshift.TypeAnnotation)
484484
.remove()
485485
.toSource();
486+
contents = jscodeshift(contents)
487+
.find(jscodeshift.GenericTypeAnnotation)
488+
.remove()
489+
.toSource();
486490

487491
// remove any `type Foo = { .. }` declarations
488492
contents = jscodeshift(contents)

Diff for: templates/app/client/app/app.constants.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
export default from '../../server/config/environment/shared';
1+
<%_ if(filters.babel) { -%>
2+
export default from '../../server/config/environment/shared';<% } %>
3+
<%_ if(filters.ts) { -%>
4+
import shared from '../../server/config/environment/shared';
5+
6+
module.exports.default = shared;<% } %>

Diff for: templates/app/server/config/environment/shared.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
exports = module.exports = {
3+
module.exports.default = {
44
env: process.env.NODE_ENV,
55
port: process.env.PORT || <%= devPort %>,
66
// List of user roles

0 commit comments

Comments
 (0)