Skip to content

Commit dc43460

Browse files
committed
Revert "Inline usage reporting protobuf into main package (#6515)"
This reverts commit 0b58585. This leaves the fix of adding cors and body-parser to server's deps and leaves the removal of a TODO(AS4) about this. The build process for this package is completely different from a normal TS package, so keeping it together seems best. This seems like it'll make setting up ESM builds easier.
1 parent dae6dda commit dc43460

File tree

31 files changed

+3492
-1063
lines changed

31 files changed

+3492
-1063
lines changed

.codesandbox/ci.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"buildCommand": "compile",
33
"installCommand": "install-with-npm-8.5",
44
"packages": [
5+
"packages/usage-reporting-protobuf",
56
"packages/server"
67
],
78
"sandboxes": ["apollo-server-typescript-3opde","apollo-server"],

package-lock.json

Lines changed: 3373 additions & 999 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
"codegen": "graphql-codegen",
2222
"prettier-check": "prettier --check .",
2323
"prettier-fix": "prettier --write .",
24-
"spell-check": "cspell lint '**' --no-progress || (echo 'Add any real words to cspell-dict.txt.'; exit 1)",
25-
"protobuf-generate": "rm -rf packages/server/usageReportingProtobuf/generated && mkdir packages/server/usageReportingProtobuf/generated && npm run protobuf-pbjs && npm run protobuf-pbts",
26-
"protobuf-pbjs": "apollo-pbjs --target static-module --out packages/server/usageReportingProtobuf/generated/protobuf.js --wrap commonjs --force-number --no-from-object packages/server/usageReportingProtobuf/reports.proto",
27-
"protobuf-pbts": "apollo-pbts -o packages/server/usageReportingProtobuf/generated/protobuf.d.ts packages/server/usageReportingProtobuf/generated/protobuf.js",
28-
"protobuf-update": "curl -sSfo packages/server/usageReportingProtobuf/reports.proto https://usage-reporting.api.apollographql.com/proto/reports.proto"
24+
"spell-check": "cspell lint '**' --no-progress || (echo 'Add any real words to cspell-dict.txt.'; exit 1)"
2925
},
3026
"workspaces": [
3127
"packages/*"

packages/server/.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ src/**/__tests__/**
55
dist/**/__tests__/**
66
!package.json
77
!README.md
8-
!usageReportingProtobuf/**/*

packages/server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"node": ">=12.0"
2626
},
2727
"dependencies": {
28-
"@apollo/protobufjs": "1.2.2",
28+
"@apollo/usage-reporting-protobuf": "^3.3.0",
2929
"@apollo/utils.createhash": "^1.1.0",
3030
"@apollo/utils.fetcher": "^1.0.0",
3131
"@apollo/utils.isnodelike": "^1.1.0",

packages/server/src/__tests__/integration/apolloServerTests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import express from 'express';
55
import bodyParser from 'body-parser';
66
import loglevel from 'loglevel';
77

8-
import { Report, Trace } from '../../../usageReportingProtobuf';
8+
import { Report, Trace } from '@apollo/usage-reporting-protobuf';
99

1010
import {
1111
GraphQLSchema,

packages/server/src/__tests__/plugin/usageReporting/plugin.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
ITrace,
99
ITracesAndStats,
1010
ContextualizedStats,
11-
} from '../../../../usageReportingProtobuf';
11+
} from '@apollo/usage-reporting-protobuf';
1212
import { pluginsEnabledForSchemaResolvers } from '../../../utils/schemaInstrumentation';
1313
import nock from 'nock';
1414
import sumBy from 'lodash.sumby';

packages/server/src/__tests__/plugin/usageReporting/stats.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Trace } from '../../../../usageReportingProtobuf';
1+
import { Trace } from '@apollo/usage-reporting-protobuf';
22
import { dateToProtoTimestamp } from '../../../plugin/traceTreeBuilder';
33
import {
44
OurContextualizedStats,

packages/server/src/__tests__/plugin/usageReporting/traceDetails.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { makeTraceDetails } from '../../../plugin/usageReporting/traceDetails';
2-
import { Trace } from '../../../../usageReportingProtobuf';
2+
import { Trace } from '@apollo/usage-reporting-protobuf';
33
import { GraphQLError } from 'graphql';
44

55
const variables: Record<string, any> = {

packages/server/src/externalTypes/graphql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Trace } from '../../usageReportingProtobuf';
1+
import type { Trace } from '@apollo/usage-reporting-protobuf';
22
import type { Logger } from '@apollo/utils.logger';
33
import type {
44
DocumentNode,

0 commit comments

Comments
 (0)