apollo-server/packages/apollo-engine-reporting-protobuf/package.json

33 lines
1 KiB
JSON
Raw Permalink Normal View History

{
"name": "apollo-engine-reporting-protobuf",
"version": "0.2.1",
"description": "Protobuf format for Apollo Engine",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
(engine-reporting) Include `encodedTraces` only once. (#2040) * AER: Remove encodedTraces to prevent duplicates When there are multiple instances of apollo-engine-reporting, the `Trace.encode` method gets wrapped each time to add the `encodedTraces`. In order to prevent them from being added to the protobuf multiple times, we remove the encodedTraces after adding them once * Add changelog * Move incremental Trace encoding to a-e-r-protobuf To enable incrmental compilation of traces, we add a patch to the Trace.encode method generated by protobujs to accept and store encoded traces. Occassionally with multiple instances of apollo-engine-reporting that share the same version of the protobuf, the wrapper method gets applied more than once. In order to ensure that the wrapper only gets applied once, we patch the Trace.encode method inside of apollo-engine-protobuf. tsc hangs on the processing the generated protobuf.js files, so the tsconfig.json ignores the generated protobuf file. In order for the typescript index.ts file to compile the generated protobuf.js file is output to the src folder. To ensure the protobuf files are available to the production build, `npm run compile` copies the protobuf file manually from src to dist. * Reexport protobuf import after modification `export * from './protobuf'` exports the unmodified reference * Update comment on Trace.encode to point at a-e-r-p The override now occurs inside of apollo-engine-reporting-protobuf due to the case of having multiple reporting challenges, so we need to update the comments to help indicate that * Remove typescript build step In order to simplify the generation of this library, we move the change the index.ts file into index.js and remove the typescript build step. Since the type safety is created by the protobufjs generation, this seems acceptable. In general this portion of the code should remain relatively stable, so generating and copying the code with `prepare` remains reasonable.
2018-12-04 02:06:08 -08:00
"prepare": "npm run pbjs && npm run pbts && cp src/* dist",
"pbjs": "bash -c 'mkdir -p dist && pbjs --target static-module --out dist/protobuf.js --wrap commonjs --force-number <(grep -v \"package mdg.engine.proto\" src/reports.proto)'",
"pbts": "pbts -o dist/protobuf.d.ts dist/protobuf.js"
},
"repository": {
"type": "git",
"url": "https://github.com/apollographql/apollo-engine-reporting/tree/master/packages/apollo-engine-reporting-protobuf"
},
"keywords": [
"GraphQL",
"Apollo",
"Engine",
"Server",
"Javascript"
],
"author": "Apollo <community@apollographql.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/apollographql/apollo-engine-reporting/issues"
},
"homepage": "https://github.com/apollographql/apollo-engine-reporting#readme",
"dependencies": {
"protobufjs": "^6.8.6"
}
}