-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prep testlab for publishing #219
Conversation
3ade9b5
to
557063e
Compare
```js | ||
const Application = require('@loopback/loopback').Application; | ||
const app = new Application(); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore this, I'm branching off another branch that has these files. Will disappear once I land #213 and rebase.
server.bind('applications.myApp').to(app); | ||
return new Client(server); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These too -- they will be gone after rebase.
92801b9
to
9621bf1
Compare
const should = require('should'); | ||
const testlab = require('..'); | ||
|
||
describe('testlab', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should not here that this is a JS smoke test - not a real test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well it's using the real compiled files, but yes a true test would have to require the dep from NPMJS (ie. add testlab as a true dep via npm install -S testlab
). Renaming to smoke test for clarity.
"clean": "rm *.tgz; rm -rf ./package", | ||
"prepublish": "npm run build", | ||
"test": "mocha", | ||
"verify": "npm run clean && npm pack && tar xvzf *.tgz && tree package" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this for local testing only? tree
is only avail. via brew
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, only for local testing to make sure the packaged contents are what we expect. tar
is not available on Windows too, but this NPM script should be temporary. Will remove once we get more insight into final publishing routines.
6eb3da1
to
5567a5f
Compare
- Add smoke test to ensure exported module works as expected
5567a5f
to
652ee29
Compare
package | ||
src | ||
test | ||
tsconfig.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should be using an explicit white-list of files to include in the package via package.json files
property, rather than maintaining a backlist in .npmignore
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the list of files can specify directories too, e.g.
"files": [
"index.js",
"index.d.ts",
"lib"
]
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"outDir": "./lib", | ||
"strictNullChecks": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't duplicate this configuration, inherit it from top-level tsconfig.json
instead.
Ideally, the project-level tsconfig.json
should configure only include
and exclude
, all compilerOptions
should be inherited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done - see #220
@superkhau I am afraid this build the type information when running
I.e. when you |
See d41ee54 |
cc @bajtos @raymondfeng