Comments (18)
{
"compilerOptions": {
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["es2020", "dom"],
"target": "es2020",
"removeComments": true,
"moduleResolution": "node",
"noUnusedLocals": true,
"noUnusedParameters": true,
"inlineSourceMap": true,
"inlineSources": true,
"module": "commonjs",
"isolatedModules": true,
"outDir": "./dist",
"rootDir": "./src",
},
"include": ["./**/*.ts"],
"exclude": ["node_modules/**/*", ".serverless/**/*", ".webpack/**/*", "_warmup/**/*", ".vscode/**/*"]
}
from dynamodb-onetable.
Can you rename OneTypes to OneType in that file and see if that works?
from dynamodb-onetable.
changed it. cleaned up a few files. one last error:
node_modules/dynamodb-onetable/dist/cjs/Table.d.ts:21:25 - error TS2314: Generic type 'Model<T>' requires 1 type argument(s).
21 intercept?: (model: Model, op: string, rec: {}, params: OneParams, raw?: {}) => void,
~~~~~
it looks like the type definitions need to be cleaned up
from dynamodb-onetable.
changed to intercept?: (model: Model<any>, op: string, rec: {}, params: OneParams, raw?: {}) => void,
and it compiled
from dynamodb-onetable.
Cool. Probably should be AnyModel. Can you please try that and then we'll update the NPM.
from dynamodb-onetable.
yep. AnyModel
worked. FYI I also had to remove the trailing ;
in the following files Model.d.ts
, Table.d.ts
from dynamodb-onetable.
Great. I don't understand removing the trailing semicolon? Can you explain a bit more? Thanks.
from dynamodb-onetable.
It seems that type
declarations can use either semicolon or comma (or nothing) as a line terminator.
We have some types line OneTableSchema that use commas:
type OneIndexSchema = {
hash: string,
sort?: string,
description?: string,
follow?: boolean,
}
and others that use semicolon:
export type Entity<T extends OneTypedModel> = {
[P in keyof T]?: EntityField<T[P]>;
};
I'd like to be consistent. What are the best practices / rules. Comma, semicolon or nothing?
I've read that React may bomb on semicolons inside Interface declarations.
from dynamodb-onetable.
Background:
from dynamodb-onetable.
these are the errors:
node_modules/dynamodb-onetable/dist/cjs/Model.d.ts:188:2 - error TS1036: Statements are not allowed in ambient contexts.
188 };
~
node_modules/dynamodb-onetable/dist/cjs/Table.d.ts:57:2 - error TS1036: Statements are not allowed in ambient contexts.
57 };
have no idea why. if i remove the semicolon at the end of the files, it works.
from dynamodb-onetable.
What version of TSC are you using?
I don't see that with 4.0.3
from dynamodb-onetable.
And that is complaining only about the very last semicolon in the file but not the ones before that?
from dynamodb-onetable.
I am at Version 4.1.5
. yeah, it doesn't complain about the ones before. just the last one.
from dynamodb-onetable.
This is our tsconfig we use when testing:
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"baseUrl": "src",
"declaration": true,
"esModuleInterop": true,
"inlineSourceMap": false,
"lib": ["esnext"],
"listEmittedFiles": false,
"listFiles": false,
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"pretty": true,
"resolveJsonModule": true,
"rootDir": "src",
"skipLibCheck": true,
"strict": true,
"traceResolution": false
},
"compileOnSave": false,
"exclude": ["node_modules", "dist"],
"include": ["src"]
}
Can you please share yours and we'll test.
I'm happy with the fix, but I'd like to understand why.
from dynamodb-onetable.
skipLibCheck in our tsconfig was the culprit.
Sorry, we'll apply the fix. Good to understand why we were not seeing this.
from dynamodb-onetable.
nice! thanks for validating!
from dynamodb-onetable.
That has uncovered a few other issues ... :-(
from dynamodb-onetable.
Thank you for assisting. Appreciated.
from dynamodb-onetable.
Related Issues (20)
- params.fields are not respected when using table.getItem() or table.queryItems()
- Metrics.d.ts should not include function interfaces declared as 'async' HOT 7
- Improve: Prohibit the removal of nested object required fields. HOT 1
- Feature: Across entities query HOT 3
- Empty strings are filtered out HOT 2
- Cannot resolve type when ESM HOT 3
- Compound global index not updated if only 1 of 2 properties passed to the update function HOT 1
- Updating unique template field does not remove unique record HOT 2
- "CredentialsProviderError: The SSO session associated with this profile has expired" in "overview" sample... HOT 2
- Create method does not create the sort key if one attribute is undefined HOT 4
- Connecting OneTable to a local dynamodb instance
- Support for Mapped Types HOT 3
- Please Help: Update Problem (referenced attribute) HOT 3
- OneSchema type for getCurrentSchema() not set HOT 2
- Update operation does not remove object from array HOT 1
- Help: retrieving items by GSI1 HOT 1
- nested props are not getting mapped correctly with map attribute
- Getting error while update on object that contains undefined attribute value in it. HOT 2
- Cannot Transparently Pass On JSON String From Previously Unncrypted Field HOT 1
- queryItems requires { hidden:true } to support groupByType for AWS SDK v3 HOT 4
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 dynamodb-onetable.