Skip to content
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

update package install and build scripts #224

Merged
merged 2 commits into from Apr 10, 2017

Conversation

joshgav
Copy link
Contributor

@joshgav joshgav commented Apr 8, 2017

  • Adds a prepare script to replace the prepublish script for npm install in npm@5+, see resolving prepublish-on-install npm/npm#10074.
  • Built artifacts from tsc are aggregated and stored in ./out for easier workspace management (e.g. npm run clean).
  • New test case added which isn't transpiled by tsc to test some scenarios. Includes a test for loading the transpiled module, since it's now in ./out.

The actual steps required to install for development and production stay the same as now documented in the README:

  • use npm install to install dependencies and for local usage, e.g. with npm link,
  • use npm test to install, build, and test as before

When installed in production environments, the "prepare" script is not called. We'd continue to rely on prepublish to precompile for dependants.

* Adds a prepare script to replace the prepublish script for `npm install`
in npm@5+.
* Built artifacts from tsc are aggregated and stored in ./out for easier
workspace management.
* New test case which isn't transpiled by tsc to test some scenarios.
Includes a test for loading the transpiled module.

PR-URL:
Reviewed-By:
Reviewed-By:
@OsvaldoRosado
Copy link
Member

Why prepare vs prepublishOnly?

@joshgav
Copy link
Contributor Author

joshgav commented Apr 10, 2017

@OsvaldoRosado I think we need prepare for our dev-time workflow, so that if someone npm install's and npm link's the library it fully works. Without prepare, npm install will install dependencies but not transpile TS, which I don't think is our current expectation.

And in case you ask ;), I didn't choose postinstall for this cause postinstall is run even when we are ourselves a dependency (which is usually the case in users' environments). In that case they should have pretranspiled files from the prepublish step (which we ourselves run). OTOH prepare is only run when the module is itself the top-level project (i.e. not a dependency).

@OsvaldoRosado
Copy link
Member

It looks like this is failing our tests <= node 0.12. I think its the use of arrow function in endtoend.js

@OsvaldoRosado OsvaldoRosado merged commit 8238a55 into microsoft:develop Apr 10, 2017
@joshgav
Copy link
Contributor Author

joshgav commented Apr 10, 2017

@OsvaldoRosado

I think its the use of arrow function in endtoend.js

Thanks! Fixed.

OsvaldoRosado added a commit that referenced this pull request May 10, 2017
* Add build script command

* Adds schema and typescript files to npmignore

* Add tagOverrides and contextObjects (#210)

* Add tagOverrides and contextObjects

Also updated documentation. Yes, it's 1 commit. Yes, I'm a terrible person for doing that.

* Add contextObject + formatting

* Fix CORS error when using library with browserify

Fixes an obscure problem when trying to use the ApplicationInsights node.js library with a browserify application.

* Add missing docs (#218)

* Update cross component dependency type (#219)

* migrate from typings to @types (#221)

* Add sampling support (#217)

* Add sampling support

* Fix test failure

* Update readme

* Fix race condition in readme example

* Fix build error from typings changes

* update package install and build scripts (#224)

* update package install and build scripts

* Adds a prepare script to replace the prepublish script for `npm install`
in npm@5+.
* Built artifacts from tsc are aggregated and stored in ./out for easier
workspace management.
* New test case which isn't transpiled by tsc to test some scenarios.
Includes a test for loading the transpiled module.

PR-URL:
Reviewed-By:
Reviewed-By:

* fixup! update package install and build scripts

* edits to comments in applicationinsights.ts (#223)

* edits to comments

* fixup! edits to comments

* Use autogenerated schemas (#228)

* Update BOND schema, update generated typescript with new comment generation

* Update autogenerated schemas. Migrate project to only use autogenerated schema classes

* Fix build errors

* Address PR feedback

* Add missing metric

* Change metric names to be in line with .NET SDK for common metrics

* Fix broken percentage units in performance counters

* pick up generated Declaration submodule (#232)

* Set the host app version to the context tags. #183 (#233)

* Sets version to the context tags

* No Readme changes

* Correct unit test

* Update Client.ts

Typo on the comment solved and switched the method name from setVersion to overrideApplicationVersion.

* Update Client.tests.ts

I apologize for the inconvenience, unit test corrected.

* Updating how cross-application correlations are tracked (#231)

* Updating how cross-application correlations are tracked

Instead of using a hash of the instrumentation key we now use the appId, matching the .NET sdk.
We also use different headers to match the .NET sdk.

* Updating to only issue appId requests once per ikey

* Exposing profileQueryEndpoint property

Allows for the appId query target to be configured separately to the telemetry endpoint.
It may be specified either by the APPINSIGHTS_PROFILE_QUERY_ENDPOINT environment variable,
or explicitly via client.config.profileQueryEndpoint. Note that it must be set synchronously
with the creation of the Config otherwise the value will not be used.

* Allowing appId lookups to be cancelled if a new endpoint is specified

* Adding operationId to outbound HTTP headers

* Provide access to contracts (#234)

* Provide access to contracts

* Test for access to contracts

* Change access to Contracts from Client.ts to applicationinsights.ts

* Fix baseTypes (#236)

* update README

* address Alex's feedback

* Fixing CorrelationId

There was a typo which lead to the `correlationIdPrefix` being null.

* Adding diagnostic-channel (#235)

* Adding diagnostic-channel

By using diagnostic-channel and diagnostic-channel-publishers, we can support context tracking through third-party libraries as well as getting additional telemetry for those dependencies.

* Fixing cyclical reference and supporting multiple AI clients in diagnostic-channel subscribers

* Updating readme with diagnostic-channel information

* Update Readme (#238)

* Enable automatic correlation by default (#239)

* Include typescript definitions in NPM package (#240)

* Update package.json to 0.20 (#241)
OsvaldoRosado added a commit that referenced this pull request May 12, 2017
This code was out of date after #224, leading to the package.json being not found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants