Comments (7)
Darn. Thanks for pointing this out.
j2L3e: I added the import from serviceName.validate.?s recently. Nothing refers to the "imported" values. It works for JS but not for TS.
f+/cli has been updated to generate that line commented out. We'll fix it in the next day or two.
Published as f+/cli v0.7.21 using generator v0.6.20.
from generator-feathers-plus.
The issue is TypeScript's export default
being compiled to module.exports.default =
.
A ts default export can't be destructured in the import directly.
Keeping the exports unchanged this would work:
import validate from 'service.validate.ts'
and then destructure with const {...} = validate;
from generator-feathers-plus.
The TS way would be named exports, but that would need a lot more changes
from generator-feathers-plus.
I would go for the named exports but for backward compatibility. I assume we can go with
export default moduleExports;
export const create;
...
export function validateCreate;
...
which, although ugly, provides backward compatibility and lets TS use the import { ... } from
syntax?
from generator-feathers-plus.
j2L4e's suggestion published as f+/cli v0.7.22 using generator v0.6.21.
from generator-feathers-plus.
Thanks for solving this issue so quickly!
I solved the problem myself by exporting the moduleExports object directly like export { create, .., quickValidate }
, but this doesn't give backward compatibility in js.
(I don't know if reopening this ticket is appropriate, but I appreciate your tools very much and would like to thank you)
from generator-feathers-plus.
Thanks are always very appreciated.
from generator-feathers-plus.
Related Issues (20)
- Show how to add custom methods?
- Add support for graphql mutations HOT 1
- Generator adds extra type to JSON schema property when using oneOf keyword
- Re-enabling travis with tests for pull requests
- Can't import external schema and spread it into the local schema HOT 2
- How do you define associations in the json schema file? HOT 2
- With no semicolon option generator adds semicolons
- TypeScript: Extract Application interface for reuse HOT 1
- Simple app doesnt run
- Default value not applied when using with $ref
- graphQL populates don't support dot notation
- TypeError: input.split is not a function HOT 3
- Can't compile Typescript HOT 11
- Semicolons when: "semicolons": false, in feathers-gen-specs.json
- Custom code ignored in regenerating app HOT 1
- Upgrade to FeathersJS v4 (Crow)? HOT 5
- Compound key in uniqueItemProperties?
- How to use faker.js arrayElement HOT 2
- TypeError: graphql.getIntrospectionQuery is not a function
- Pass context.data while testing services HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from generator-feathers-plus.