@turbo/types 2.4.5-canary.2 → 2.4.5-canary.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turbo/types",
3
- "version": "2.4.5-canary.2",
3
+ "version": "2.4.5-canary.4",
4
4
  "description": "Turborepo types",
5
5
  "homepage": "https://turbo.build/repo",
6
6
  "license": "MIT",
@@ -88,6 +88,10 @@
88
88
  "$ref": "#/definitions/EnvMode",
89
89
  "description": "Turborepo's Environment Modes allow you to control which environment variables are available to a task at runtime:\n\n- `\"strict\"`: Filter environment variables to only those that are specified in the `env` and `globalEnv` keys in `turbo.json`.\n- `\"loose\"`: Allow all environment variables for the process to be available.\n\nDocumentation: https://turbo.build/repo/docs/reference/configuration#envmode",
90
90
  "default": "strict"
91
+ },
92
+ "boundaries": {
93
+ "$ref": "#/definitions/RootBoundariesConfig",
94
+ "description": "Configuration for `turbo boundaries`. Allows users to restrict a package's dependencies and dependents"
91
95
  }
92
96
  },
93
97
  "additionalProperties": false,
@@ -253,6 +257,60 @@
253
257
  "loose"
254
258
  ]
255
259
  },
260
+ "RootBoundariesConfig": {
261
+ "type": "object",
262
+ "properties": {
263
+ "implicitDependencies": {
264
+ "type": "array",
265
+ "items": {
266
+ "type": "string"
267
+ },
268
+ "description": "Declares any implicit dependencies, i.e. any dependency not declared in a package.json. These can include dependencies automatically injected by a framework or a testing library."
269
+ },
270
+ "tags": {
271
+ "$ref": "#/definitions/BoundariesRulesMap",
272
+ "description": "The boundaries rules for tags. Restricts which packages can import a tag and which packages a tag can import"
273
+ }
274
+ },
275
+ "additionalProperties": false
276
+ },
277
+ "BoundariesRulesMap": {
278
+ "type": "object",
279
+ "additionalProperties": {
280
+ "type": "object",
281
+ "properties": {
282
+ "dependencies": {
283
+ "$ref": "#/definitions/Permissions",
284
+ "description": "Rules for a tag's dependencies. Restricts which packages a tag can import"
285
+ },
286
+ "dependents": {
287
+ "$ref": "#/definitions/Permissions",
288
+ "description": "Rules for a tag's dependents. Restricts which packages can import this tag."
289
+ }
290
+ },
291
+ "additionalProperties": false
292
+ }
293
+ },
294
+ "Permissions": {
295
+ "type": "object",
296
+ "properties": {
297
+ "allow": {
298
+ "type": "array",
299
+ "items": {
300
+ "type": "string"
301
+ },
302
+ "description": "Lists which tags are allowed. Any tag not included will be banned If omitted, all tags are permitted"
303
+ },
304
+ "deny": {
305
+ "type": "array",
306
+ "items": {
307
+ "type": "string"
308
+ },
309
+ "description": "Lists which tags are banned."
310
+ }
311
+ },
312
+ "additionalProperties": false
313
+ },
256
314
  "WorkspaceSchema": {
257
315
  "type": "object",
258
316
  "properties": {
@@ -278,6 +336,17 @@
278
336
  "default": [
279
337
  "//"
280
338
  ]
339
+ },
340
+ "tags": {
341
+ "type": "array",
342
+ "items": {
343
+ "type": "string"
344
+ },
345
+ "description": "Used to tag a package for boundaries rules. Boundaries rules can restrict which packages a tag group can import or be imported by."
346
+ },
347
+ "boundaries": {
348
+ "$ref": "#/definitions/BoundariesConfig",
349
+ "description": "Configuration for `turbo boundaries` that is specific to this package"
281
350
  }
282
351
  },
283
352
  "required": [
@@ -286,6 +355,19 @@
286
355
  ],
287
356
  "additionalProperties": false,
288
357
  "description": "A `turbo.json` file in a package in the monorepo (not the root)"
358
+ },
359
+ "BoundariesConfig": {
360
+ "type": "object",
361
+ "properties": {
362
+ "implicitDependencies": {
363
+ "type": "array",
364
+ "items": {
365
+ "type": "string"
366
+ },
367
+ "description": "Declares any implicit dependencies, i.e. any dependency not declared in a package.json. These can include dependencies automatically injected by a framework or a testing library."
368
+ }
369
+ },
370
+ "additionalProperties": false
289
371
  }
290
372
  }
291
373
  }
@@ -88,6 +88,10 @@
88
88
  "$ref": "#/definitions/EnvMode",
89
89
  "description": "Turborepo's Environment Modes allow you to control which environment variables are available to a task at runtime:\n\n- `\"strict\"`: Filter environment variables to only those that are specified in the `env` and `globalEnv` keys in `turbo.json`.\n- `\"loose\"`: Allow all environment variables for the process to be available.\n\nDocumentation: https://turbo.build/repo/docs/reference/configuration#envmode",
90
90
  "default": "strict"
91
+ },
92
+ "boundaries": {
93
+ "$ref": "#/definitions/RootBoundariesConfig",
94
+ "description": "Configuration for `turbo boundaries`. Allows users to restrict a package's dependencies and dependents"
91
95
  }
92
96
  },
93
97
  "additionalProperties": false,
@@ -253,6 +257,60 @@
253
257
  "loose"
254
258
  ]
255
259
  },
260
+ "RootBoundariesConfig": {
261
+ "type": "object",
262
+ "properties": {
263
+ "implicitDependencies": {
264
+ "type": "array",
265
+ "items": {
266
+ "type": "string"
267
+ },
268
+ "description": "Declares any implicit dependencies, i.e. any dependency not declared in a package.json. These can include dependencies automatically injected by a framework or a testing library."
269
+ },
270
+ "tags": {
271
+ "$ref": "#/definitions/BoundariesRulesMap",
272
+ "description": "The boundaries rules for tags. Restricts which packages can import a tag and which packages a tag can import"
273
+ }
274
+ },
275
+ "additionalProperties": false
276
+ },
277
+ "BoundariesRulesMap": {
278
+ "type": "object",
279
+ "additionalProperties": {
280
+ "type": "object",
281
+ "properties": {
282
+ "dependencies": {
283
+ "$ref": "#/definitions/Permissions",
284
+ "description": "Rules for a tag's dependencies. Restricts which packages a tag can import"
285
+ },
286
+ "dependents": {
287
+ "$ref": "#/definitions/Permissions",
288
+ "description": "Rules for a tag's dependents. Restricts which packages can import this tag."
289
+ }
290
+ },
291
+ "additionalProperties": false
292
+ }
293
+ },
294
+ "Permissions": {
295
+ "type": "object",
296
+ "properties": {
297
+ "allow": {
298
+ "type": "array",
299
+ "items": {
300
+ "type": "string"
301
+ },
302
+ "description": "Lists which tags are allowed. Any tag not included will be banned If omitted, all tags are permitted"
303
+ },
304
+ "deny": {
305
+ "type": "array",
306
+ "items": {
307
+ "type": "string"
308
+ },
309
+ "description": "Lists which tags are banned."
310
+ }
311
+ },
312
+ "additionalProperties": false
313
+ },
256
314
  "WorkspaceSchema": {
257
315
  "type": "object",
258
316
  "properties": {
@@ -278,6 +336,17 @@
278
336
  "default": [
279
337
  "//"
280
338
  ]
339
+ },
340
+ "tags": {
341
+ "type": "array",
342
+ "items": {
343
+ "type": "string"
344
+ },
345
+ "description": "Used to tag a package for boundaries rules. Boundaries rules can restrict which packages a tag group can import or be imported by."
346
+ },
347
+ "boundaries": {
348
+ "$ref": "#/definitions/BoundariesConfig",
349
+ "description": "Configuration for `turbo boundaries` that is specific to this package"
281
350
  }
282
351
  },
283
352
  "required": [
@@ -286,6 +355,19 @@
286
355
  ],
287
356
  "additionalProperties": false,
288
357
  "description": "A `turbo.json` file in a package in the monorepo (not the root)"
358
+ },
359
+ "BoundariesConfig": {
360
+ "type": "object",
361
+ "properties": {
362
+ "implicitDependencies": {
363
+ "type": "array",
364
+ "items": {
365
+ "type": "string"
366
+ },
367
+ "description": "Declares any implicit dependencies, i.e. any dependency not declared in a package.json. These can include dependencies automatically injected by a framework or a testing library."
368
+ }
369
+ },
370
+ "additionalProperties": false
289
371
  }
290
372
  }
291
373
  }
@@ -52,6 +52,15 @@ export interface WorkspaceSchema extends BaseSchema {
52
52
  * @defaultValue `["//"]`
53
53
  */
54
54
  extends: Array<string>;
55
+ /**
56
+ * Used to tag a package for boundaries rules. Boundaries rules can restrict
57
+ * which packages a tag group can import or be imported by.
58
+ */
59
+ tags?: Array<string>;
60
+ /**
61
+ * Configuration for `turbo boundaries` that is specific to this package
62
+ */
63
+ boundaries?: BoundariesConfig;
55
64
  }
56
65
 
57
66
  export interface RootSchema extends BaseSchema {
@@ -155,6 +164,11 @@ export interface RootSchema extends BaseSchema {
155
164
  * @defaultValue `"strict"`
156
165
  */
157
166
  envMode?: EnvMode;
167
+
168
+ /**
169
+ * Configuration for `turbo boundaries`. Allows users to restrict a package's dependencies and dependents
170
+ */
171
+ boundaries?: RootBoundariesConfig;
158
172
  }
159
173
 
160
174
  export interface Pipeline {
@@ -372,6 +386,47 @@ export interface RemoteCache {
372
386
  teamSlug?: string;
373
387
  }
374
388
 
389
+ export interface Permissions {
390
+ /**
391
+ * Lists which tags are allowed. Any tag not included will be banned
392
+ * If omitted, all tags are permitted
393
+ */
394
+ allow?: Array<string>;
395
+ /**
396
+ * Lists which tags are banned.
397
+ */
398
+ deny?: Array<string>;
399
+ }
400
+
401
+ interface TagRules {
402
+ /**
403
+ * Rules for a tag's dependencies. Restricts which packages a tag can import
404
+ */
405
+ dependencies?: Permissions;
406
+ /**
407
+ * Rules for a tag's dependents. Restricts which packages can import this tag.
408
+ */
409
+ dependents?: Permissions;
410
+ }
411
+
412
+ export type BoundariesRulesMap = Record<string, TagRules>;
413
+
414
+ export interface BoundariesConfig {
415
+ /**
416
+ * Declares any implicit dependencies, i.e. any dependency not declared in a package.json.
417
+ * These can include dependencies automatically injected by a framework or a testing library.
418
+ */
419
+ implicitDependencies?: Array<string>;
420
+ }
421
+
422
+ export interface RootBoundariesConfig extends BoundariesConfig {
423
+ /**
424
+ * The boundaries rules for tags. Restricts which packages
425
+ * can import a tag and which packages a tag can import
426
+ */
427
+ tags?: BoundariesRulesMap;
428
+ }
429
+
375
430
  export const isRootSchemaV2 = (schema: Schema): schema is RootSchema =>
376
431
  !("extends" in schema);
377
432