webpipe-js 2.0.1 → 2.0.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.
package/dist/index.cjs CHANGED
@@ -143,6 +143,7 @@ var Parser = class {
143
143
  let graphqlSchema;
144
144
  const queries = [];
145
145
  const mutations = [];
146
+ let featureFlags;
146
147
  while (!this.eof()) {
147
148
  this.skipWhitespaceOnly();
148
149
  if (this.eof()) break;
@@ -177,6 +178,11 @@ var Parser = class {
177
178
  mutations.push(mutation);
178
179
  continue;
179
180
  }
181
+ const flags = this.tryParse(() => this.parseFeatureFlags());
182
+ if (flags) {
183
+ featureFlags = flags;
184
+ continue;
185
+ }
180
186
  const namedPipe = this.tryParse(() => this.parseNamedPipeline());
181
187
  if (namedPipe) {
182
188
  namedPipe.lineNumber = this.getLineNumber(start);
@@ -216,7 +222,7 @@ var Parser = class {
216
222
  const start = Math.max(0, idx);
217
223
  this.report("Unclosed backtick-delimited string", start, start + 1, "warning");
218
224
  }
219
- return { configs, pipelines, variables, routes, describes, comments, graphqlSchema, queries, mutations };
225
+ return { configs, pipelines, variables, routes, describes, comments, graphqlSchema, queries, mutations, featureFlags };
220
226
  }
221
227
  eof() {
222
228
  return this.pos >= this.len;
@@ -598,6 +604,15 @@ var Parser = class {
598
604
  this.skipWhitespaceOnly();
599
605
  return { name, pipeline, inlineComment: inlineComment || void 0 };
600
606
  }
607
+ parseFeatureFlags() {
608
+ this.expect("featureFlags");
609
+ this.skipInlineSpaces();
610
+ this.expect("=");
611
+ this.skipWhitespaceOnly();
612
+ const pipeline = this.parsePipeline();
613
+ this.skipWhitespaceOnly();
614
+ return pipeline;
615
+ }
601
616
  parseRoute() {
602
617
  const method = this.parseMethod();
603
618
  this.skipInlineSpaces();
package/dist/index.d.cts CHANGED
@@ -8,6 +8,7 @@ interface Program {
8
8
  graphqlSchema?: GraphQLSchema;
9
9
  queries: QueryResolver[];
10
10
  mutations: MutationResolver[];
11
+ featureFlags?: Pipeline;
11
12
  }
12
13
  interface Comment {
13
14
  type: 'standalone' | 'inline';
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ interface Program {
8
8
  graphqlSchema?: GraphQLSchema;
9
9
  queries: QueryResolver[];
10
10
  mutations: MutationResolver[];
11
+ featureFlags?: Pipeline;
11
12
  }
12
13
  interface Comment {
13
14
  type: 'standalone' | 'inline';
package/dist/index.mjs CHANGED
@@ -94,6 +94,7 @@ var Parser = class {
94
94
  let graphqlSchema;
95
95
  const queries = [];
96
96
  const mutations = [];
97
+ let featureFlags;
97
98
  while (!this.eof()) {
98
99
  this.skipWhitespaceOnly();
99
100
  if (this.eof()) break;
@@ -128,6 +129,11 @@ var Parser = class {
128
129
  mutations.push(mutation);
129
130
  continue;
130
131
  }
132
+ const flags = this.tryParse(() => this.parseFeatureFlags());
133
+ if (flags) {
134
+ featureFlags = flags;
135
+ continue;
136
+ }
131
137
  const namedPipe = this.tryParse(() => this.parseNamedPipeline());
132
138
  if (namedPipe) {
133
139
  namedPipe.lineNumber = this.getLineNumber(start);
@@ -167,7 +173,7 @@ var Parser = class {
167
173
  const start = Math.max(0, idx);
168
174
  this.report("Unclosed backtick-delimited string", start, start + 1, "warning");
169
175
  }
170
- return { configs, pipelines, variables, routes, describes, comments, graphqlSchema, queries, mutations };
176
+ return { configs, pipelines, variables, routes, describes, comments, graphqlSchema, queries, mutations, featureFlags };
171
177
  }
172
178
  eof() {
173
179
  return this.pos >= this.len;
@@ -549,6 +555,15 @@ var Parser = class {
549
555
  this.skipWhitespaceOnly();
550
556
  return { name, pipeline, inlineComment: inlineComment || void 0 };
551
557
  }
558
+ parseFeatureFlags() {
559
+ this.expect("featureFlags");
560
+ this.skipInlineSpaces();
561
+ this.expect("=");
562
+ this.skipWhitespaceOnly();
563
+ const pipeline = this.parsePipeline();
564
+ this.skipWhitespaceOnly();
565
+ return pipeline;
566
+ }
552
567
  parseRoute() {
553
568
  const method = this.parseMethod();
554
569
  this.skipInlineSpaces();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpipe-js",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Web Pipe parser",
5
5
  "license": "ISC",
6
6
  "author": "William Cotton",