@usebruno/filestore 0.7.0 → 0.7.1

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 +1 @@
1
- {"version":3,"file":"stringifyCollection.d.ts","sourceRoot":"","sources":["../../../src/formats/yml/stringifyCollection.ts"],"names":[],"mappings":"AAkEA,QAAA,MAAM,mBAAmB,mBAAoB,GAAG,eAAe,GAAG,KAAG,MAmMpE,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"stringifyCollection.d.ts","sourceRoot":"","sources":["../../../src/formats/yml/stringifyCollection.ts"],"names":[],"mappings":"AAkEA,QAAA,MAAM,mBAAmB,mBAAoB,GAAG,eAAe,GAAG,KAAG,MA2MpE,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usebruno/filestore",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "license": "MIT",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -58,12 +58,12 @@ const parseCollection = (ymlString: string): ParsedCollection => {
58
58
  // protobuf
59
59
  if (oc.config?.protobuf) {
60
60
  brunoConfig.protobuf = {
61
- protofFiles: oc.config.protobuf.protoFiles?.map((protoFile: any) => ({
61
+ protoFiles: oc.config.protobuf.protoFiles?.map((protoFile: any) => ({
62
62
  path: protoFile.path
63
63
  })) || [],
64
64
  importPaths: oc.config.protobuf.importPaths?.map((importPath: any) => ({
65
65
  path: importPath.path,
66
- disabled: importPath.disabled || false
66
+ enabled: importPath.disabled !== true
67
67
  })) || []
68
68
  };
69
69
  }
@@ -16,7 +16,7 @@ import type { Auth } from '@opencollection/types/common/auth';
16
16
  const hasCollectionConfig = (brunoConfig: any): boolean => {
17
17
  // protobuf
18
18
  const hasProtobuf = (
19
- brunoConfig.protobuf?.protofFiles?.length > 0
19
+ brunoConfig.protobuf?.protoFiles?.length > 0
20
20
  || brunoConfig.protobuf?.importPaths?.length > 0
21
21
  );
22
22
 
@@ -77,17 +77,25 @@ const stringifyCollection = (collectionRoot: any, brunoConfig: any): string => {
77
77
  if (hasCollectionConfig(brunoConfig)) {
78
78
  oc.config = {};
79
79
 
80
- if (brunoConfig.protobuf?.protofFiles?.length) {
81
- oc.config.protobuf = {
82
- protoFiles: brunoConfig.protobuf.protofFiles.map((protoFile: any): ProtoFileItem => ({
80
+ if (brunoConfig.protobuf?.protoFiles?.length || brunoConfig.protobuf?.importPaths?.length) {
81
+ oc.config.protobuf = {};
82
+
83
+ if (brunoConfig.protobuf.protoFiles?.length) {
84
+ oc.config.protobuf.protoFiles = brunoConfig.protobuf.protoFiles.map((protoFile: any): ProtoFileItem => ({
83
85
  type: 'file' as const,
84
86
  path: protoFile.path
85
- })),
86
- importPaths: brunoConfig.protobuf.importPaths.map((importPath: any): ProtoFileImportPath => ({
87
- path: importPath.path,
88
- disabled: importPath.disabled
89
- }))
90
- };
87
+ }));
88
+ }
89
+
90
+ if (brunoConfig.protobuf.importPaths?.length) {
91
+ oc.config.protobuf.importPaths = brunoConfig.protobuf.importPaths.map((importPath: any): ProtoFileImportPath => {
92
+ const item: ProtoFileImportPath = { path: importPath.path };
93
+ if (importPath.enabled === false) {
94
+ item.disabled = true;
95
+ }
96
+ return item;
97
+ });
98
+ }
91
99
  }
92
100
 
93
101
  // proxy - only write newer format