@bufbuild/protoplugin 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { Schema } from "./ecmascript/schema.js";
1
+ import type { Schema } from "./ecmascript/schema.js";
2
2
  import type { FileInfo } from "./ecmascript/generated-file.js";
3
3
  import type { Plugin } from "./plugin.js";
4
4
  import type { FeatureSetDefaults } from "@bufbuild/protobuf";
@@ -1,8 +1,8 @@
1
- import { AnyDesc, DescEnum, DescExtension, DescFile, DescMessage } from "@bufbuild/protobuf";
1
+ import type { AnyDesc, DescEnum, DescExtension, DescFile, DescMessage } from "@bufbuild/protobuf";
2
2
  import type { ImportSymbol } from "./import-symbol.js";
3
3
  import type { RuntimeImports } from "./runtime-imports.js";
4
4
  import type { JSDocBlock } from "./jsdoc.js";
5
- import { ExportDeclaration, LiteralProtoInt64, LiteralString, RefDescEnum, RefDescMessage } from "./opaque-printables.js";
5
+ import type { ExportDeclaration, LiteralProtoInt64, LiteralString, RefDescEnum, RefDescMessage } from "./opaque-printables.js";
6
6
  /**
7
7
  * All types that can be passed to GeneratedFile.print()
8
8
  */
@@ -1,4 +1,4 @@
1
- import { DescFile } from "@bufbuild/protobuf";
1
+ import type { DescFile } from "@bufbuild/protobuf";
2
2
  /**
3
3
  * A configuration for rewriting import paths, a feature mainly used for
4
4
  * remote code generation in the BSR npm registry, which makes it possible
@@ -1,5 +1,5 @@
1
- import { AnyDesc, DescExtension, DescFile } from "@bufbuild/protobuf";
2
- import { Printable } from "./generated-file.js";
1
+ import type { AnyDesc, DescExtension, DescFile } from "@bufbuild/protobuf";
2
+ import type { Printable } from "./generated-file.js";
3
3
  export { reifyWkt } from "./reify-wkt.js";
4
4
  export type { Target } from "./target.js";
5
5
  export type { Schema } from "./schema.js";
@@ -1,5 +1,5 @@
1
- import type { AnyDesc } from "@bufbuild/protobuf";
2
- import { Message, MessageType, ScalarType } from "@bufbuild/protobuf";
1
+ import type { AnyDesc, MessageType } from "@bufbuild/protobuf";
2
+ import { Message, ScalarType } from "@bufbuild/protobuf";
3
3
  /**
4
4
  * @deprecated Please use extensions instead.
5
5
  *
@@ -1,5 +1,4 @@
1
- import type { DescExtension } from "@bufbuild/protobuf";
2
- import { DescField } from "@bufbuild/protobuf";
1
+ import type { DescExtension, DescField } from "@bufbuild/protobuf";
3
2
  import type { GeneratedFile, Printable } from "./generated-file.js";
4
3
  import type { ImportSymbol } from "./import-symbol.js";
5
4
  /**
@@ -1,4 +1,5 @@
1
- import { DescEnum, DescExtension, DescMessage, LongType, ScalarType } from "@bufbuild/protobuf";
1
+ import type { DescEnum, DescExtension, DescMessage } from "@bufbuild/protobuf";
2
+ import { LongType, ScalarType } from "@bufbuild/protobuf";
2
3
  export type LiteralProtoInt64 = {
3
4
  readonly kind: "es_proto_int64";
4
5
  type: ScalarType.INT64 | ScalarType.SINT64 | ScalarType.SFIXED64 | ScalarType.UINT64 | ScalarType.FIXED64;
@@ -1,5 +1,5 @@
1
- import { Target } from "./target.js";
2
- import { RewriteImports } from "./import-path.js";
1
+ import type { Target } from "./target.js";
2
+ import type { RewriteImports } from "./import-path.js";
3
3
  export interface ParsedParameter {
4
4
  targets: Target[];
5
5
  tsNocheck: boolean;
@@ -1,9 +1,9 @@
1
1
  import type { CodeGeneratorRequest, DescFile } from "@bufbuild/protobuf";
2
2
  import { FeatureSetDefaults } from "@bufbuild/protobuf";
3
3
  import type { FileInfo, GeneratedFile } from "./generated-file.js";
4
- import { RuntimeImports } from "./runtime-imports.js";
4
+ import type { RuntimeImports } from "./runtime-imports.js";
5
5
  import type { Target } from "./target.js";
6
- import { ParsedParameter } from "./parameter.js";
6
+ import type { ParsedParameter } from "./parameter.js";
7
7
  /**
8
8
  * Schema describes the files and types that the plugin is requested to
9
9
  * generate.
@@ -118,7 +118,7 @@ function transpile(files, transpileJs, transpileDts, jsImportStyle) {
118
118
  throw err;
119
119
  }
120
120
  if (result.emitSkipped) {
121
- throw Error("An problem occurred during transpilation and files were not generated. Contact the plugin author for support.");
121
+ throw Error("A problem occurred during transpilation and files were not generated. Contact the plugin author for support.");
122
122
  }
123
123
  return results;
124
124
  }
@@ -1,5 +1,5 @@
1
- import { Schema as SchemaInternal } from "./ecmascript/schema.js";
2
- export { Plugin } from "./plugin.js";
1
+ import type { Schema as SchemaInternal } from "./ecmascript/schema.js";
2
+ export type { Plugin } from "./plugin.js";
3
3
  export { runNodeJs } from "./run-node.js";
4
4
  export { createEcmaScriptPlugin } from "./create-es-plugin.js";
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { Schema } from "./ecmascript/schema.js";
1
+ import type { Schema } from "./ecmascript/schema.js";
2
2
  import type { FileInfo } from "./ecmascript/generated-file.js";
3
3
  import type { Plugin } from "./plugin.js";
4
4
  import type { FeatureSetDefaults } from "@bufbuild/protobuf";
@@ -1,8 +1,8 @@
1
- import { AnyDesc, DescEnum, DescExtension, DescFile, DescMessage } from "@bufbuild/protobuf";
1
+ import type { AnyDesc, DescEnum, DescExtension, DescFile, DescMessage } from "@bufbuild/protobuf";
2
2
  import type { ImportSymbol } from "./import-symbol.js";
3
3
  import type { RuntimeImports } from "./runtime-imports.js";
4
4
  import type { JSDocBlock } from "./jsdoc.js";
5
- import { ExportDeclaration, LiteralProtoInt64, LiteralString, RefDescEnum, RefDescMessage } from "./opaque-printables.js";
5
+ import type { ExportDeclaration, LiteralProtoInt64, LiteralString, RefDescEnum, RefDescMessage } from "./opaque-printables.js";
6
6
  /**
7
7
  * All types that can be passed to GeneratedFile.print()
8
8
  */
@@ -11,7 +11,7 @@
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { LongType, protoInt64, ScalarType, } from "@bufbuild/protobuf";
14
+ import { LongType, protoInt64, ScalarType } from "@bufbuild/protobuf";
15
15
  import { createImportSymbol } from "./import-symbol.js";
16
16
  import { makeImportPathRelative } from "./import-path.js";
17
17
  import { createJsDocBlock } from "./jsdoc.js";
@@ -1,4 +1,4 @@
1
- import { DescFile } from "@bufbuild/protobuf";
1
+ import type { DescFile } from "@bufbuild/protobuf";
2
2
  /**
3
3
  * A configuration for rewriting import paths, a feature mainly used for
4
4
  * remote code generation in the BSR npm registry, which makes it possible
@@ -1,5 +1,5 @@
1
- import { AnyDesc, DescExtension, DescFile } from "@bufbuild/protobuf";
2
- import { Printable } from "./generated-file.js";
1
+ import type { AnyDesc, DescExtension, DescFile } from "@bufbuild/protobuf";
2
+ import type { Printable } from "./generated-file.js";
3
3
  export { reifyWkt } from "./reify-wkt.js";
4
4
  export type { Target } from "./target.js";
5
5
  export type { Schema } from "./schema.js";
@@ -11,7 +11,7 @@
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { codegenInfo, } from "@bufbuild/protobuf";
14
+ import { codegenInfo } from "@bufbuild/protobuf";
15
15
  import { createJsDocBlock as createJsDocBlockInternal } from "./jsdoc.js";
16
16
  export { reifyWkt } from "./reify-wkt.js";
17
17
  export { createImportSymbol } from "./import-symbol.js";
@@ -1,5 +1,5 @@
1
- import type { AnyDesc } from "@bufbuild/protobuf";
2
- import { Message, MessageType, ScalarType } from "@bufbuild/protobuf";
1
+ import type { AnyDesc, MessageType } from "@bufbuild/protobuf";
2
+ import { Message, ScalarType } from "@bufbuild/protobuf";
3
3
  /**
4
4
  * @deprecated Please use extensions instead.
5
5
  *
@@ -11,7 +11,7 @@
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { proto3, BinaryReader, ScalarType, } from "@bufbuild/protobuf";
14
+ import { proto3, BinaryReader, Message, ScalarType } from "@bufbuild/protobuf";
15
15
  /**
16
16
  * @deprecated Please use extensions instead.
17
17
  *
@@ -1,5 +1,4 @@
1
- import type { DescExtension } from "@bufbuild/protobuf";
2
- import { DescField } from "@bufbuild/protobuf";
1
+ import type { DescExtension, DescField } from "@bufbuild/protobuf";
3
2
  import type { GeneratedFile, Printable } from "./generated-file.js";
4
3
  import type { ImportSymbol } from "./import-symbol.js";
5
4
  /**
@@ -11,7 +11,7 @@
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { codegenInfo, LongType, ScalarType, } from "@bufbuild/protobuf";
14
+ import { codegenInfo, LongType, ScalarType } from "@bufbuild/protobuf";
15
15
  const { localName, getUnwrappedFieldType, scalarZeroValue } = codegenInfo;
16
16
  /**
17
17
  * @deprecated Please use GeneratedFile.string() instead
@@ -1,4 +1,5 @@
1
- import { DescEnum, DescExtension, DescMessage, LongType, ScalarType } from "@bufbuild/protobuf";
1
+ import type { DescEnum, DescExtension, DescMessage } from "@bufbuild/protobuf";
2
+ import { LongType, ScalarType } from "@bufbuild/protobuf";
2
3
  export type LiteralProtoInt64 = {
3
4
  readonly kind: "es_proto_int64";
4
5
  type: ScalarType.INT64 | ScalarType.SINT64 | ScalarType.SFIXED64 | ScalarType.UINT64 | ScalarType.FIXED64;
@@ -11,4 +11,4 @@
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- export {};
14
+ import { LongType, ScalarType } from "@bufbuild/protobuf";
@@ -1,5 +1,5 @@
1
- import { Target } from "./target.js";
2
- import { RewriteImports } from "./import-path.js";
1
+ import type { Target } from "./target.js";
2
+ import type { RewriteImports } from "./import-path.js";
3
3
  export interface ParsedParameter {
4
4
  targets: Target[];
5
5
  tsNocheck: boolean;
@@ -1,9 +1,9 @@
1
1
  import type { CodeGeneratorRequest, DescFile } from "@bufbuild/protobuf";
2
2
  import { FeatureSetDefaults } from "@bufbuild/protobuf";
3
3
  import type { FileInfo, GeneratedFile } from "./generated-file.js";
4
- import { RuntimeImports } from "./runtime-imports.js";
4
+ import type { RuntimeImports } from "./runtime-imports.js";
5
5
  import type { Target } from "./target.js";
6
- import { ParsedParameter } from "./parameter.js";
6
+ import type { ParsedParameter } from "./parameter.js";
7
7
  /**
8
8
  * Schema describes the files and types that the plugin is requested to
9
9
  * generate.
@@ -11,7 +11,7 @@
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { codegenInfo, createDescriptorSet, } from "@bufbuild/protobuf";
14
+ import { codegenInfo, createDescriptorSet, FeatureSetDefaults, } from "@bufbuild/protobuf";
15
15
  import { createGeneratedFile } from "./generated-file.js";
16
16
  import { createRuntimeImports } from "./runtime-imports.js";
17
17
  import { createImportSymbol } from "./import-symbol.js";
@@ -112,7 +112,7 @@ export function transpile(files, transpileJs, transpileDts, jsImportStyle) {
112
112
  throw err;
113
113
  }
114
114
  if (result.emitSkipped) {
115
- throw Error("An problem occurred during transpilation and files were not generated. Contact the plugin author for support.");
115
+ throw Error("A problem occurred during transpilation and files were not generated. Contact the plugin author for support.");
116
116
  }
117
117
  return results;
118
118
  }
@@ -1,5 +1,5 @@
1
- import { Schema as SchemaInternal } from "./ecmascript/schema.js";
2
- export { Plugin } from "./plugin.js";
1
+ import type { Schema as SchemaInternal } from "./ecmascript/schema.js";
2
+ export type { Plugin } from "./plugin.js";
3
3
  export { runNodeJs } from "./run-node.js";
4
4
  export { createEcmaScriptPlugin } from "./create-es-plugin.js";
5
5
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bufbuild/protoplugin",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "license": "(Apache-2.0 AND BSD-3-Clause)",
5
5
  "description": "Helps to create your own Protocol Buffers code generators.",
6
6
  "repository": {
@@ -11,8 +11,8 @@
11
11
  "scripts": {
12
12
  "clean": "rm -rf ./dist/*",
13
13
  "build": "npm run build:cjs && npm run build:esm",
14
- "build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
15
- "build:esm": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module ES2015 --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
14
+ "build:cjs": "../../node_modules/typescript/bin/tsc --project tsconfig.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
15
+ "build:esm": "../../node_modules/typescript/bin/tsc --project tsconfig.json --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
16
16
  "attw": "attw --pack"
17
17
  },
18
18
  "type": "module",
@@ -36,7 +36,7 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "@bufbuild/protobuf": "1.8.0",
39
+ "@bufbuild/protobuf": "1.9.0",
40
40
  "@typescript/vfs": "^1.4.0",
41
41
  "typescript": "4.5.2"
42
42
  },