@bufbuild/protoplugin 2.5.0 → 2.5.2

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.
@@ -19,31 +19,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.transpile = transpile;
20
20
  const typescript_1 = __importDefault(require("typescript"));
21
21
  const vfs_1 = require("@typescript/vfs");
22
- // The default options used to auto-transpile if needed.
23
- const defaultOptions = {
24
- // Type checking
25
- strict: false,
26
- // modules
27
- module: typescript_1.default.ModuleKind.ES2020,
28
- moduleResolution: typescript_1.default.ModuleResolutionKind.Node10,
29
- noResolve: true,
30
- resolveJsonModule: false,
31
- // emit
32
- emitBOM: false,
33
- importsNotUsedAsValues: typescript_1.default.ImportsNotUsedAsValues.Preserve,
34
- newLine: typescript_1.default.NewLineKind.LineFeed,
35
- preserveValueImports: false,
36
- // JavaScript Support
37
- allowJs: true,
38
- checkJs: false,
39
- // Language and Environment
40
- lib: [],
41
- moduleDetection: typescript_1.default.ModuleDetectionKind.Force,
42
- target: typescript_1.default.ScriptTarget.ES2017,
43
- // Completeness
44
- skipLibCheck: true,
45
- skipDefaultLibCheck: false,
46
- };
47
22
  /**
48
23
  * Create a transpiler using the given compiler options, which will compile the
49
24
  * content provided in the files array.
@@ -52,7 +27,7 @@ const defaultOptions = {
52
27
  * TypeScript for stability. This version is denoted in this workspace's
53
28
  * package.json. For the default set of compiler options, we use a lenient
54
29
  * set of options because the general goal is to emit code as best as we can.
55
- * For a list of the options used, see `defaultOptions` above.
30
+ * For a list of the options used, see `const defaultOptions` in function transpile.
56
31
  *
57
32
  * If this is not desirable for plugin authors, they are free to provide their
58
33
  * own transpile function as part of the plugin initialization. If one is
@@ -82,6 +57,30 @@ function createTranspiler(options, files) {
82
57
  });
83
58
  }
84
59
  function transpile(files, transpileJs, transpileDts, jsImportStyle) {
60
+ const defaultOptions = {
61
+ // Type checking
62
+ strict: false,
63
+ // modules
64
+ module: typescript_1.default.ModuleKind.ES2020,
65
+ moduleResolution: typescript_1.default.ModuleResolutionKind.Node10,
66
+ noResolve: true,
67
+ resolveJsonModule: false,
68
+ // emit
69
+ emitBOM: false,
70
+ importsNotUsedAsValues: typescript_1.default.ImportsNotUsedAsValues.Preserve,
71
+ newLine: typescript_1.default.NewLineKind.LineFeed,
72
+ preserveValueImports: false,
73
+ // JavaScript Support
74
+ allowJs: true,
75
+ checkJs: false,
76
+ // Language and Environment
77
+ lib: [],
78
+ moduleDetection: typescript_1.default.ModuleDetectionKind.Force,
79
+ target: typescript_1.default.ScriptTarget.ES2017,
80
+ // Completeness
81
+ skipLibCheck: true,
82
+ skipDefaultLibCheck: false,
83
+ };
85
84
  const options = Object.assign(Object.assign({}, defaultOptions), { declaration: transpileDts, emitDeclarationOnly: transpileDts && !transpileJs });
86
85
  if (jsImportStyle == "legacy_commonjs") {
87
86
  options.module = typescript_1.default.ModuleKind.CommonJS;
@@ -13,31 +13,6 @@
13
13
  // limitations under the License.
14
14
  import ts from "typescript";
15
15
  import { createDefaultMapFromNodeModules, createSystem, createVirtualCompilerHost, } from "@typescript/vfs";
16
- // The default options used to auto-transpile if needed.
17
- const defaultOptions = {
18
- // Type checking
19
- strict: false,
20
- // modules
21
- module: ts.ModuleKind.ES2020,
22
- moduleResolution: ts.ModuleResolutionKind.Node10,
23
- noResolve: true,
24
- resolveJsonModule: false,
25
- // emit
26
- emitBOM: false,
27
- importsNotUsedAsValues: ts.ImportsNotUsedAsValues.Preserve,
28
- newLine: ts.NewLineKind.LineFeed,
29
- preserveValueImports: false,
30
- // JavaScript Support
31
- allowJs: true,
32
- checkJs: false,
33
- // Language and Environment
34
- lib: [],
35
- moduleDetection: ts.ModuleDetectionKind.Force,
36
- target: ts.ScriptTarget.ES2017,
37
- // Completeness
38
- skipLibCheck: true,
39
- skipDefaultLibCheck: false,
40
- };
41
16
  /**
42
17
  * Create a transpiler using the given compiler options, which will compile the
43
18
  * content provided in the files array.
@@ -46,7 +21,7 @@ const defaultOptions = {
46
21
  * TypeScript for stability. This version is denoted in this workspace's
47
22
  * package.json. For the default set of compiler options, we use a lenient
48
23
  * set of options because the general goal is to emit code as best as we can.
49
- * For a list of the options used, see `defaultOptions` above.
24
+ * For a list of the options used, see `const defaultOptions` in function transpile.
50
25
  *
51
26
  * If this is not desirable for plugin authors, they are free to provide their
52
27
  * own transpile function as part of the plugin initialization. If one is
@@ -76,6 +51,30 @@ function createTranspiler(options, files) {
76
51
  });
77
52
  }
78
53
  export function transpile(files, transpileJs, transpileDts, jsImportStyle) {
54
+ const defaultOptions = {
55
+ // Type checking
56
+ strict: false,
57
+ // modules
58
+ module: ts.ModuleKind.ES2020,
59
+ moduleResolution: ts.ModuleResolutionKind.Node10,
60
+ noResolve: true,
61
+ resolveJsonModule: false,
62
+ // emit
63
+ emitBOM: false,
64
+ importsNotUsedAsValues: ts.ImportsNotUsedAsValues.Preserve,
65
+ newLine: ts.NewLineKind.LineFeed,
66
+ preserveValueImports: false,
67
+ // JavaScript Support
68
+ allowJs: true,
69
+ checkJs: false,
70
+ // Language and Environment
71
+ lib: [],
72
+ moduleDetection: ts.ModuleDetectionKind.Force,
73
+ target: ts.ScriptTarget.ES2017,
74
+ // Completeness
75
+ skipLibCheck: true,
76
+ skipDefaultLibCheck: false,
77
+ };
79
78
  const options = Object.assign(Object.assign({}, defaultOptions), { declaration: transpileDts, emitDeclarationOnly: transpileDts && !transpileJs });
80
79
  if (jsImportStyle == "legacy_commonjs") {
81
80
  options.module = ts.ModuleKind.CommonJS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bufbuild/protoplugin",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Helps to create your own Protocol Buffers code generators.",
6
6
  "keywords": [
@@ -35,12 +35,9 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@bufbuild/protobuf": "2.5.0",
38
+ "@bufbuild/protobuf": "2.5.2",
39
39
  "@typescript/vfs": "^1.5.2",
40
40
  "typescript": "5.4.5"
41
41
  },
42
- "files": ["dist/**"],
43
- "devDependencies": {
44
- "@types/lz-string": "^1.5.0"
45
- }
42
+ "files": ["dist/**"]
46
43
  }