@vercel/build-utils 3.0.2-canary.0 → 3.1.1-canary.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,7 +1,12 @@
1
1
  import { Framework } from '@vercel/frameworks';
2
2
  import { DetectorFilesystem } from './detectors/filesystem';
3
+ interface BaseFramework {
4
+ slug: Framework['slug'];
5
+ detectors?: Framework['detectors'];
6
+ }
3
7
  export interface DetectFrameworkOptions {
4
8
  fs: DetectorFilesystem;
5
- frameworkList: readonly Framework[];
9
+ frameworkList: readonly BaseFramework[];
6
10
  }
7
11
  export declare function detectFramework({ fs, frameworkList, }: DetectFrameworkOptions): Promise<string | null>;
12
+ export {};
package/dist/index.d.ts CHANGED
@@ -32,3 +32,4 @@ export * from './errors';
32
32
  export declare const isOfficialRuntime: (desired: string, name?: string | undefined) => boolean;
33
33
  export declare const isStaticRuntime: (name?: string | undefined) => boolean;
34
34
  export { workspaceManagers } from './workspaces/workspace-managers';
35
+ export { monorepoManagers } from './monorepos/monorepo-managers';
package/dist/index.js CHANGED
@@ -26857,7 +26857,6 @@ exports.frameworks = [
26857
26857
  placeholder: 'Next.js default',
26858
26858
  },
26859
26859
  },
26860
- getFsOutputDir: async () => '.next',
26861
26860
  getOutputDirName: async () => 'public',
26862
26861
  },
26863
26862
  {
@@ -26903,7 +26902,6 @@ exports.frameworks = [
26903
26902
  dependencies: ['next-plugin-sentry', 'next-sentry-source-maps'],
26904
26903
  },
26905
26904
  ],
26906
- getFsOutputDir: async () => '.next',
26907
26905
  getOutputDirName: async () => 'public',
26908
26906
  cachePattern: '.next/cache/**',
26909
26907
  },
@@ -26998,6 +26996,8 @@ exports.frameworks = [
26998
26996
  description: 'A new Remix app — the result of running `npx create-remix`.',
26999
26997
  website: 'https://remix.run',
27000
26998
  sort: 6,
26999
+ useRuntime: { src: 'package.json', use: '@vercel/remix' },
27000
+ ignoreRuntimes: ['@vercel/node'],
27001
27001
  detectors: {
27002
27002
  every: [
27003
27003
  {
@@ -27023,39 +27023,6 @@ exports.frameworks = [
27023
27023
  },
27024
27024
  dependency: 'remix',
27025
27025
  getOutputDirName: async () => 'public',
27026
- defaultRoutes: [
27027
- {
27028
- src: '^/build/(.*)$',
27029
- headers: { 'cache-control': 'public, max-age=31536000, immutable' },
27030
- continue: true,
27031
- },
27032
- {
27033
- handle: 'filesystem',
27034
- },
27035
- {
27036
- src: '/(.*)',
27037
- dest: '/api',
27038
- },
27039
- ],
27040
- defaultRewrites: [
27041
- {
27042
- source: '/(.*)',
27043
- regex: '/(.*)',
27044
- destination: '/api',
27045
- },
27046
- ],
27047
- defaultHeaders: [
27048
- {
27049
- source: '/build/(.*)',
27050
- regex: '/build/(.*)',
27051
- headers: [
27052
- {
27053
- key: 'cache-control',
27054
- value: 'public, max-age=31536000, immutable',
27055
- },
27056
- ],
27057
- },
27058
- ],
27059
27026
  },
27060
27027
  {
27061
27028
  name: 'Astro',
@@ -27092,7 +27059,6 @@ exports.frameworks = [
27092
27059
  },
27093
27060
  },
27094
27061
  dependency: 'astro',
27095
- getFsOutputDir: async () => 'dist',
27096
27062
  getOutputDirName: async () => 'dist',
27097
27063
  defaultRoutes: [
27098
27064
  {
@@ -27108,18 +27074,6 @@ exports.frameworks = [
27108
27074
  dest: '/index.html',
27109
27075
  },
27110
27076
  ],
27111
- defaultHeaders: [
27112
- {
27113
- source: '^/dist/(.*)$',
27114
- regex: '^/dist/(.*)$',
27115
- headers: [
27116
- {
27117
- key: 'cache-control',
27118
- value: 'public, max-age=31536000, immutable',
27119
- },
27120
- ],
27121
- },
27122
- ],
27123
27077
  },
27124
27078
  {
27125
27079
  name: 'Hexo',
@@ -27240,51 +27194,6 @@ exports.frameworks = [
27240
27194
  }
27241
27195
  return base;
27242
27196
  },
27243
- defaultHeaders: [
27244
- {
27245
- source: '^/[^./]+\\.[0-9a-f]{8}\\.(css|js)$',
27246
- regex: '^/[^./]+\\.[0-9a-f]{8}\\.(css|js)$',
27247
- headers: [
27248
- { key: 'cache-control', value: 'max-age=31536000, immutable' },
27249
- ],
27250
- },
27251
- {
27252
- source: '^/assets/images/[^/]+-[0-9a-f]{32}\\.(ico|svg|jpg|jpeg|png|gif|webp)$',
27253
- regex: '^/assets/images/[^/]+-[0-9a-f]{32}\\.(ico|svg|jpg|jpeg|png|gif|webp)$',
27254
- headers: [
27255
- { key: 'cache-control', value: 'max-age=31536000, immutable' },
27256
- ],
27257
- },
27258
- {
27259
- source: '^/assets/medias/[^/]+-[0-9a-f]{32}\\.(ogv|wav|mp3|m4a|aac|oga|flac)$',
27260
- regex: '^/assets/medias/[^/]+-[0-9a-f]{32}\\.(ogv|wav|mp3|m4a|aac|oga|flac)$',
27261
- headers: [
27262
- { key: 'cache-control', value: 'max-age=31536000, immutable' },
27263
- ],
27264
- },
27265
- {
27266
- source: '^/assets/files/[^/]+-[0-9a-f]{32}\\.(pdf|doc|docx|xls|xlsx|zip|rar)$',
27267
- regex: '^/assets/files/[^/]+-[0-9a-f]{32}\\.(pdf|doc|docx|xls|xlsx|zip|rar)$',
27268
- headers: [
27269
- { key: 'cache-control', value: 'max-age=31536000, immutable' },
27270
- ],
27271
- },
27272
- {
27273
- source: '^/ideal-img/[^/]+\\.[0-9a-f]{7}\\.\\d+\\.(png|jpe?g|gif)$',
27274
- regex: '^/ideal-img/[^/]+\\.[0-9a-f]{7}\\.\\d+\\.(png|jpe?g|gif)$',
27275
- headers: [
27276
- { key: 'cache-control', value: 'max-age=31536000, immutable' },
27277
- ],
27278
- },
27279
- ],
27280
- defaultRedirects: [
27281
- {
27282
- source: '.*',
27283
- regex: '.*',
27284
- statusCode: 404,
27285
- destination: '404.html',
27286
- },
27287
- ],
27288
27197
  defaultRoutes: [
27289
27198
  {
27290
27199
  src: '^/[^./]+\\.[0-9a-f]{8}\\.(css|js)$',
@@ -27413,13 +27322,6 @@ exports.frameworks = [
27413
27322
  dest: '/index.html',
27414
27323
  },
27415
27324
  ],
27416
- defaultRewrites: [
27417
- {
27418
- source: '/(.*)',
27419
- regex: '/(.*)',
27420
- destination: '/index.html',
27421
- },
27422
- ],
27423
27325
  },
27424
27326
  {
27425
27327
  name: 'SolidStart',
@@ -27518,13 +27420,6 @@ exports.frameworks = [
27518
27420
  continue: true,
27519
27421
  },
27520
27422
  ],
27521
- defaultRewrites: [
27522
- {
27523
- source: '/(.*)',
27524
- regex: '/(.*)',
27525
- destination: '/index.html',
27526
- },
27527
- ],
27528
27423
  },
27529
27424
  {
27530
27425
  name: 'Ember.js',
@@ -27569,13 +27464,6 @@ exports.frameworks = [
27569
27464
  dest: '/index.html',
27570
27465
  },
27571
27466
  ],
27572
- defaultRewrites: [
27573
- {
27574
- source: '/(.*)',
27575
- regex: '/(.*)',
27576
- destination: '/index.html',
27577
- },
27578
- ],
27579
27467
  },
27580
27468
  {
27581
27469
  name: 'Vue.js',
@@ -27631,27 +27519,6 @@ exports.frameworks = [
27631
27519
  dest: '/index.html',
27632
27520
  },
27633
27521
  ],
27634
- defaultHeaders: [
27635
- {
27636
- source: '^/[^/]*\\.(js|txt|ico|json)',
27637
- regex: '^/[^/]*\\.(js|txt|ico|json)',
27638
- headers: [{ key: 'cache-control', value: 'max-age=300' }],
27639
- },
27640
- {
27641
- source: '^/(img|js|css|fonts|media)/[^/]+\\.[0-9a-f]{8}\\.*',
27642
- regex: '^/(img|js|css|fonts|media)/[^/]+\\.[0-9a-f]{8}\\.*',
27643
- headers: [
27644
- { key: 'cache-control', value: 'max-age=31536000, immutable' },
27645
- ],
27646
- },
27647
- ],
27648
- defaultRewrites: [
27649
- {
27650
- source: '^.*',
27651
- regex: '^.*',
27652
- destination: '/index.html',
27653
- },
27654
- ],
27655
27522
  },
27656
27523
  {
27657
27524
  name: 'Scully',
@@ -27730,13 +27597,6 @@ exports.frameworks = [
27730
27597
  dest: '/index.html',
27731
27598
  },
27732
27599
  ],
27733
- defaultRewrites: [
27734
- {
27735
- source: '/(.*)',
27736
- regex: '/(.*)',
27737
- destination: '/index.html',
27738
- },
27739
- ],
27740
27600
  },
27741
27601
  {
27742
27602
  name: 'Angular',
@@ -27795,13 +27655,6 @@ exports.frameworks = [
27795
27655
  dest: '/index.html',
27796
27656
  },
27797
27657
  ],
27798
- defaultRewrites: [
27799
- {
27800
- source: '/(.*)',
27801
- regex: '/(.*)',
27802
- destination: '/index.html',
27803
- },
27804
- ],
27805
27658
  },
27806
27659
  {
27807
27660
  name: 'Polymer',
@@ -27858,13 +27711,6 @@ exports.frameworks = [
27858
27711
  dest: '/index.html',
27859
27712
  },
27860
27713
  ],
27861
- defaultRewrites: [
27862
- {
27863
- source: '/(.*)',
27864
- regex: '/(.*)',
27865
- destination: '/index.html',
27866
- },
27867
- ],
27868
27714
  },
27869
27715
  {
27870
27716
  name: 'Svelte',
@@ -27913,13 +27759,6 @@ exports.frameworks = [
27913
27759
  dest: '/index.html',
27914
27760
  },
27915
27761
  ],
27916
- defaultRewrites: [
27917
- {
27918
- source: '/(.*)',
27919
- regex: '/(.*)',
27920
- destination: '/index.html',
27921
- },
27922
- ],
27923
27762
  },
27924
27763
  {
27925
27764
  name: 'SvelteKit',
@@ -28015,45 +27854,6 @@ exports.frameworks = [
28015
27854
  dest: '/index.html',
28016
27855
  },
28017
27856
  ],
28018
- defaultHeaders: [
28019
- {
28020
- source: '/static/(.*)',
28021
- regex: '/static/(.*)',
28022
- headers: [
28023
- { key: 'cache-control', value: 's-maxage=31536000, immutable' },
28024
- ],
28025
- },
28026
- {
28027
- source: '/service-worker.js',
28028
- regex: '/service-worker.js',
28029
- headers: [{ key: 'cache-control', value: 's-maxage=0' }],
28030
- },
28031
- {
28032
- source: '/(.*)',
28033
- regex: '/(.*)',
28034
- headers: [{ key: 'cache-control', value: 's-maxage=0' }],
28035
- },
28036
- ],
28037
- defaultRedirects: [
28038
- {
28039
- source: '/static/(.*)',
28040
- destination: '/404.html',
28041
- statusCode: 404,
28042
- regex: '/static/(.*)',
28043
- },
28044
- ],
28045
- defaultRewrites: [
28046
- {
28047
- source: '/sockjs-node/(.*)',
28048
- destination: '/sockjs-node/$1',
28049
- regex: '/sockjs-node/(.*)',
28050
- },
28051
- {
28052
- source: '/(.*)',
28053
- destination: '/index.html',
28054
- regex: '/(.*)',
28055
- },
28056
- ],
28057
27857
  },
28058
27858
  {
28059
27859
  name: 'Create React App',
@@ -28119,45 +27919,6 @@ exports.frameworks = [
28119
27919
  dest: '/index.html',
28120
27920
  },
28121
27921
  ],
28122
- defaultHeaders: [
28123
- {
28124
- source: '/static/(.*)',
28125
- regex: '/static/(.*)',
28126
- headers: [
28127
- { key: 'cache-control', value: 's-maxage=31536000, immutable' },
28128
- ],
28129
- },
28130
- {
28131
- source: '/service-worker.js',
28132
- regex: '/service-worker.js',
28133
- headers: [{ key: 'cache-control', value: 's-maxage=0' }],
28134
- },
28135
- {
28136
- source: '/(.*)',
28137
- regex: '/(.*)',
28138
- headers: [{ key: 'cache-control', value: 's-maxage=0' }],
28139
- },
28140
- ],
28141
- defaultRedirects: [
28142
- {
28143
- source: '/static/(.*)',
28144
- destination: '/404.html',
28145
- statusCode: 404,
28146
- regex: '/static/(.*)',
28147
- },
28148
- ],
28149
- defaultRewrites: [
28150
- {
28151
- source: '/sockjs-node/(.*)',
28152
- destination: '/sockjs-node/$1',
28153
- regex: '/sockjs-node/(.*)',
28154
- },
28155
- {
28156
- source: '/(.*)',
28157
- destination: '/index.html',
28158
- regex: '/(.*)',
28159
- },
28160
- ],
28161
27922
  },
28162
27923
  {
28163
27924
  name: 'Gridsome',
@@ -28237,13 +27998,6 @@ exports.frameworks = [
28237
27998
  dest: '/index.html',
28238
27999
  },
28239
28000
  ],
28240
- defaultRewrites: [
28241
- {
28242
- source: '/(.*)',
28243
- destination: '/index.html',
28244
- regex: '/(.*)',
28245
- },
28246
- ],
28247
28001
  },
28248
28002
  {
28249
28003
  name: 'Sapper',
@@ -28328,23 +28082,6 @@ exports.frameworks = [
28328
28082
  dest: '404.html',
28329
28083
  },
28330
28084
  ],
28331
- defaultHeaders: [
28332
- {
28333
- source: '/_saber/.*',
28334
- regex: '/_saber/.*',
28335
- headers: [
28336
- { key: 'cache-control', value: 'max-age=31536000, immutable' },
28337
- ],
28338
- },
28339
- ],
28340
- defaultRedirects: [
28341
- {
28342
- source: '.*',
28343
- statusCode: 404,
28344
- destination: '404.html',
28345
- regex: '.*',
28346
- },
28347
- ],
28348
28085
  },
28349
28086
  {
28350
28087
  name: 'Stencil',
@@ -28404,32 +28141,6 @@ exports.frameworks = [
28404
28141
  dest: '/index.html',
28405
28142
  },
28406
28143
  ],
28407
- defaultHeaders: [
28408
- {
28409
- source: '/assets/(.*)',
28410
- regex: '/assets/(.*)',
28411
- headers: [{ key: 'cache-control', value: 'max-age=2592000' }],
28412
- },
28413
- {
28414
- source: '/build/p-.*',
28415
- regex: '/build/p-.*',
28416
- headers: [
28417
- { key: 'cache-control', value: 'max-age=31536000, immutable' },
28418
- ],
28419
- },
28420
- {
28421
- source: '/sw.js',
28422
- regex: '/sw.js',
28423
- headers: [{ key: 'cache-control', value: 'no-cache' }],
28424
- },
28425
- ],
28426
- defaultRewrites: [
28427
- {
28428
- source: '/(.*)',
28429
- destination: '/index.html',
28430
- regex: '/(.*)',
28431
- },
28432
- ],
28433
28144
  },
28434
28145
  {
28435
28146
  name: 'Nuxt.js',
@@ -28790,15 +28501,6 @@ exports.frameworks = [
28790
28501
  handle: 'filesystem',
28791
28502
  },
28792
28503
  ],
28793
- defaultHeaders: [
28794
- {
28795
- source: '^/[^./]+\\.[0-9a-f]{8}\\.(css|js|png|jpg|webp|avif|svg)$',
28796
- regex: '^/[^./]+\\.[0-9a-f]{8}\\.(css|js|png|jpg|webp|avif|svg)$',
28797
- headers: [
28798
- { key: 'cache-control', value: 's-maxage=31536000, immutable' },
28799
- ],
28800
- },
28801
- ],
28802
28504
  },
28803
28505
  {
28804
28506
  name: 'Sanity',
@@ -28864,22 +28566,6 @@ exports.frameworks = [
28864
28566
  placeholder: '`public` if it exists, or `.`',
28865
28567
  },
28866
28568
  },
28867
- getFsOutputDir: async (dirPrefix) => {
28868
- // Public if it exists or `.`
28869
- let base = 'public';
28870
- try {
28871
- const location = path_1.join(dirPrefix, base);
28872
- const content = await readdir(location, { withFileTypes: true });
28873
- // If there is only one file in it that is a dir we'll use it as dist dir
28874
- if (content.length === 1 && content[0].isDirectory()) {
28875
- return path_1.join(base, content[0].name);
28876
- }
28877
- }
28878
- catch (_error) {
28879
- base = '.';
28880
- }
28881
- return base;
28882
- },
28883
28569
  getOutputDirName: async () => 'public',
28884
28570
  },
28885
28571
  ];
@@ -35537,6 +35223,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35537
35223
  };
35538
35224
  Object.defineProperty(exports, "__esModule", ({ value: true }));
35539
35225
  exports.workspaceManagers = exports.isStaticRuntime = exports.isOfficialRuntime = exports.normalizePath = exports.readConfigFile = exports.DetectorFilesystem = exports.detectFramework = exports.detectFileSystemAPI = exports.detectApiExtensions = exports.detectApiDirectory = exports.detectOutputDirectory = exports.detectBuilders = exports.EdgeFunction = exports.getIgnoreFilter = exports.scanParentDirs = exports.getLambdaOptionsFromFunction = exports.isSymbolicLink = exports.debug = exports.streamToBuffer = exports.getPlatformEnv = exports.getSpawnOptions = exports.getDiscontinuedNodeVersions = exports.getLatestNodeVersion = exports.getNodeVersion = exports.getEnvForPackageManager = exports.runCustomInstallCommand = exports.runShellScript = exports.runPipInstall = exports.runBundleInstall = exports.runNpmInstall = exports.getNodeBinPath = exports.walkParentDirs = exports.spawnCommand = exports.execCommand = exports.runPackageJsonScript = exports.installDependencies = exports.getScriptName = exports.spawnAsync = exports.execAsync = exports.rename = exports.glob = exports.getWriteableDirectory = exports.download = exports.Prerender = exports.createLambda = exports.NodejsLambda = exports.Lambda = exports.FileRef = exports.FileFsRef = exports.FileBlob = void 0;
35226
+ exports.monorepoManagers = void 0;
35540
35227
  const file_blob_1 = __importDefault(__webpack_require__(2397));
35541
35228
  exports.FileBlob = file_blob_1.default;
35542
35229
  const file_fs_ref_1 = __importDefault(__webpack_require__(9331));
@@ -35630,6 +35317,8 @@ const isStaticRuntime = (name) => {
35630
35317
  exports.isStaticRuntime = isStaticRuntime;
35631
35318
  var workspace_managers_1 = __webpack_require__(4896);
35632
35319
  Object.defineProperty(exports, "workspaceManagers", ({ enumerable: true, get: function () { return workspace_managers_1.workspaceManagers; } }));
35320
+ var monorepo_managers_1 = __webpack_require__(6418);
35321
+ Object.defineProperty(exports, "monorepoManagers", ({ enumerable: true, get: function () { return monorepo_managers_1.monorepoManagers; } }));
35633
35322
 
35634
35323
 
35635
35324
  /***/ }),
@@ -35769,6 +35458,48 @@ async function getLambdaOptionsFromFunction({ sourceFile, config, }) {
35769
35458
  exports.getLambdaOptionsFromFunction = getLambdaOptionsFromFunction;
35770
35459
 
35771
35460
 
35461
+ /***/ }),
35462
+
35463
+ /***/ 6418:
35464
+ /***/ ((__unused_webpack_module, exports) => {
35465
+
35466
+ "use strict";
35467
+
35468
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
35469
+ exports.monorepoManagers = void 0;
35470
+ /**
35471
+ * The supported list of monorepo managers.
35472
+ *
35473
+ * This list is designed to work with the @see {@link detectFramework} function.
35474
+ *
35475
+ * @example
35476
+ * import { monorepoManagers as frameworkList } from '@vercel/build-utils'
35477
+ * import { detectFramework } from '@vercel/build-utils'
35478
+ *
35479
+ * const fs = new GitDetectorFilesystem(...)
35480
+ * detectFramwork({ fs, frameworkList }) // returns the 'slug' field if detected, otherwise null
35481
+ *
35482
+ */
35483
+ exports.monorepoManagers = [
35484
+ {
35485
+ name: 'Turborepo',
35486
+ slug: 'turbo',
35487
+ detectors: {
35488
+ some: [
35489
+ {
35490
+ path: 'turbo.json',
35491
+ },
35492
+ {
35493
+ path: 'package.json',
35494
+ matchContent: '"turbo":\\s*{[^}]*.+[^}]*}',
35495
+ },
35496
+ ],
35497
+ },
35498
+ },
35499
+ ];
35500
+ exports.default = exports.monorepoManagers;
35501
+
35502
+
35772
35503
  /***/ }),
35773
35504
 
35774
35505
  /***/ 7049:
@@ -35965,13 +35696,12 @@ exports.workspaceManagers = void 0;
35965
35696
  * This list is designed to work with the @see {@link detectFramework} function.
35966
35697
  *
35967
35698
  * @example
35968
- * import { workspaceManagers as frameworkList } from '@vercel/build-utils/workspaces'
35699
+ * import { workspaceManagers as frameworkList } from '@vercel/build-utils'
35969
35700
  * import { detectFramework } from '@vercel/build-utils'
35970
35701
  *
35971
35702
  * const fs = new GitDetectorFilesystem(...)
35972
35703
  * detectFramwork({ fs, frameworkList }) // returns the 'slug' field if detected, otherwise null
35973
35704
  *
35974
- * @todo Will be used by the detect-eligible-projects API endpoint for a given git url.
35975
35705
  */
35976
35706
  exports.workspaceManagers = [
35977
35707
  {
@@ -35988,28 +35718,6 @@ exports.workspaceManagers = [
35988
35718
  },
35989
35719
  ],
35990
35720
  },
35991
- // unused props - needed for typescript
35992
- description: '',
35993
- logo: '',
35994
- settings: {
35995
- buildCommand: {
35996
- value: '',
35997
- placeholder: '',
35998
- },
35999
- devCommand: {
36000
- value: '',
36001
- placeholder: '',
36002
- },
36003
- installCommand: {
36004
- value: '',
36005
- placeholder: '',
36006
- },
36007
- outputDirectory: {
36008
- value: '',
36009
- placeholder: '',
36010
- },
36011
- },
36012
- getOutputDirName: () => Promise.resolve(''),
36013
35721
  },
36014
35722
  {
36015
35723
  name: 'pnpm',
@@ -36021,28 +35729,6 @@ exports.workspaceManagers = [
36021
35729
  },
36022
35730
  ],
36023
35731
  },
36024
- // unused props - needed for typescript
36025
- description: '',
36026
- logo: '',
36027
- settings: {
36028
- buildCommand: {
36029
- value: '',
36030
- placeholder: '',
36031
- },
36032
- devCommand: {
36033
- value: '',
36034
- placeholder: '',
36035
- },
36036
- installCommand: {
36037
- value: '',
36038
- placeholder: '',
36039
- },
36040
- outputDirectory: {
36041
- value: '',
36042
- placeholder: '',
36043
- },
36044
- },
36045
- getOutputDirName: () => Promise.resolve(''),
36046
35732
  },
36047
35733
  {
36048
35734
  name: 'npm',
@@ -36058,28 +35744,6 @@ exports.workspaceManagers = [
36058
35744
  },
36059
35745
  ],
36060
35746
  },
36061
- // unused props - needed for typescript
36062
- description: '',
36063
- logo: '',
36064
- settings: {
36065
- buildCommand: {
36066
- value: '',
36067
- placeholder: '',
36068
- },
36069
- devCommand: {
36070
- value: '',
36071
- placeholder: '',
36072
- },
36073
- installCommand: {
36074
- value: '',
36075
- placeholder: '',
36076
- },
36077
- outputDirectory: {
36078
- value: '',
36079
- placeholder: '',
36080
- },
36081
- },
36082
- getOutputDirName: () => Promise.resolve(''),
36083
35747
  },
36084
35748
  ];
36085
35749
  exports.default = exports.workspaceManagers;
@@ -0,0 +1,16 @@
1
+ import type { Framework } from '@vercel/frameworks';
2
+ /**
3
+ * The supported list of monorepo managers.
4
+ *
5
+ * This list is designed to work with the @see {@link detectFramework} function.
6
+ *
7
+ * @example
8
+ * import { monorepoManagers as frameworkList } from '@vercel/build-utils'
9
+ * import { detectFramework } from '@vercel/build-utils'
10
+ *
11
+ * const fs = new GitDetectorFilesystem(...)
12
+ * detectFramwork({ fs, frameworkList }) // returns the 'slug' field if detected, otherwise null
13
+ *
14
+ */
15
+ export declare const monorepoManagers: Array<Omit<Framework, 'description' | 'logo' | 'settings' | 'getOutputDirName'>>;
16
+ export default monorepoManagers;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.monorepoManagers = void 0;
4
+ /**
5
+ * The supported list of monorepo managers.
6
+ *
7
+ * This list is designed to work with the @see {@link detectFramework} function.
8
+ *
9
+ * @example
10
+ * import { monorepoManagers as frameworkList } from '@vercel/build-utils'
11
+ * import { detectFramework } from '@vercel/build-utils'
12
+ *
13
+ * const fs = new GitDetectorFilesystem(...)
14
+ * detectFramwork({ fs, frameworkList }) // returns the 'slug' field if detected, otherwise null
15
+ *
16
+ */
17
+ exports.monorepoManagers = [
18
+ {
19
+ name: 'Turborepo',
20
+ slug: 'turbo',
21
+ detectors: {
22
+ some: [
23
+ {
24
+ path: 'turbo.json',
25
+ },
26
+ {
27
+ path: 'package.json',
28
+ matchContent: '"turbo":\\s*{[^}]*.+[^}]*}',
29
+ },
30
+ ],
31
+ },
32
+ },
33
+ ];
34
+ exports.default = exports.monorepoManagers;
package/dist/types.d.ts CHANGED
@@ -289,6 +289,7 @@ export interface ProjectSettings {
289
289
  buildCommand?: string | null;
290
290
  outputDirectory?: string | null;
291
291
  rootDirectory?: string | null;
292
+ nodeVersion?: string;
292
293
  createdAt?: number;
293
294
  autoExposeSystemEnvs?: boolean;
294
295
  sourceFilesOutsideRootDirectory?: boolean;
@@ -309,11 +310,37 @@ export interface BuilderV3 {
309
310
  startDevServer?: StartDevServer;
310
311
  }
311
312
  declare type ImageFormat = 'image/avif' | 'image/webp';
313
+ export declare type RemotePattern = {
314
+ /**
315
+ * Must be `http` or `https`.
316
+ */
317
+ protocol?: 'http' | 'https';
318
+ /**
319
+ * Can be literal or wildcard.
320
+ * Single `*` matches a single subdomain.
321
+ * Double `**` matches any number of subdomains.
322
+ */
323
+ hostname: string;
324
+ /**
325
+ * Can be literal port such as `8080` or empty string
326
+ * meaning no port.
327
+ */
328
+ port?: string;
329
+ /**
330
+ * Can be literal or wildcard.
331
+ * Single `*` matches a single path segment.
332
+ * Double `**` matches any number of path segments.
333
+ */
334
+ pathname?: string;
335
+ };
312
336
  export interface Images {
313
337
  domains: string[];
338
+ remotePatterns?: RemotePattern[];
314
339
  sizes: number[];
315
340
  minimumCacheTTL?: number;
316
341
  formats?: ImageFormat[];
342
+ dangerouslyAllowSVG?: boolean;
343
+ contentSecurityPolicy?: string;
317
344
  }
318
345
  /**
319
346
  * If a Builder ends up creating filesystem outputs conforming to
@@ -5,13 +5,12 @@ import type { Framework } from '@vercel/frameworks';
5
5
  * This list is designed to work with the @see {@link detectFramework} function.
6
6
  *
7
7
  * @example
8
- * import { workspaceManagers as frameworkList } from '@vercel/build-utils/workspaces'
8
+ * import { workspaceManagers as frameworkList } from '@vercel/build-utils'
9
9
  * import { detectFramework } from '@vercel/build-utils'
10
10
  *
11
11
  * const fs = new GitDetectorFilesystem(...)
12
12
  * detectFramwork({ fs, frameworkList }) // returns the 'slug' field if detected, otherwise null
13
13
  *
14
- * @todo Will be used by the detect-eligible-projects API endpoint for a given git url.
15
14
  */
16
- export declare const workspaceManagers: Array<Framework>;
15
+ export declare const workspaceManagers: Array<Omit<Framework, 'description' | 'logo' | 'settings' | 'getOutputDirName'>>;
17
16
  export default workspaceManagers;
@@ -7,13 +7,12 @@ exports.workspaceManagers = void 0;
7
7
  * This list is designed to work with the @see {@link detectFramework} function.
8
8
  *
9
9
  * @example
10
- * import { workspaceManagers as frameworkList } from '@vercel/build-utils/workspaces'
10
+ * import { workspaceManagers as frameworkList } from '@vercel/build-utils'
11
11
  * import { detectFramework } from '@vercel/build-utils'
12
12
  *
13
13
  * const fs = new GitDetectorFilesystem(...)
14
14
  * detectFramwork({ fs, frameworkList }) // returns the 'slug' field if detected, otherwise null
15
15
  *
16
- * @todo Will be used by the detect-eligible-projects API endpoint for a given git url.
17
16
  */
18
17
  exports.workspaceManagers = [
19
18
  {
@@ -30,28 +29,6 @@ exports.workspaceManagers = [
30
29
  },
31
30
  ],
32
31
  },
33
- // unused props - needed for typescript
34
- description: '',
35
- logo: '',
36
- settings: {
37
- buildCommand: {
38
- value: '',
39
- placeholder: '',
40
- },
41
- devCommand: {
42
- value: '',
43
- placeholder: '',
44
- },
45
- installCommand: {
46
- value: '',
47
- placeholder: '',
48
- },
49
- outputDirectory: {
50
- value: '',
51
- placeholder: '',
52
- },
53
- },
54
- getOutputDirName: () => Promise.resolve(''),
55
32
  },
56
33
  {
57
34
  name: 'pnpm',
@@ -63,28 +40,6 @@ exports.workspaceManagers = [
63
40
  },
64
41
  ],
65
42
  },
66
- // unused props - needed for typescript
67
- description: '',
68
- logo: '',
69
- settings: {
70
- buildCommand: {
71
- value: '',
72
- placeholder: '',
73
- },
74
- devCommand: {
75
- value: '',
76
- placeholder: '',
77
- },
78
- installCommand: {
79
- value: '',
80
- placeholder: '',
81
- },
82
- outputDirectory: {
83
- value: '',
84
- placeholder: '',
85
- },
86
- },
87
- getOutputDirName: () => Promise.resolve(''),
88
43
  },
89
44
  {
90
45
  name: 'npm',
@@ -100,28 +55,6 @@ exports.workspaceManagers = [
100
55
  },
101
56
  ],
102
57
  },
103
- // unused props - needed for typescript
104
- description: '',
105
- logo: '',
106
- settings: {
107
- buildCommand: {
108
- value: '',
109
- placeholder: '',
110
- },
111
- devCommand: {
112
- value: '',
113
- placeholder: '',
114
- },
115
- installCommand: {
116
- value: '',
117
- placeholder: '',
118
- },
119
- outputDirectory: {
120
- value: '',
121
- placeholder: '',
122
- },
123
- },
124
- getOutputDirName: () => Promise.resolve(''),
125
58
  },
126
59
  ];
127
60
  exports.default = exports.workspaceManagers;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "3.0.2-canary.0",
3
+ "version": "3.1.1-canary.1",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -31,7 +31,7 @@
31
31
  "@types/node-fetch": "^2.1.6",
32
32
  "@types/semver": "6.0.0",
33
33
  "@types/yazl": "2.4.2",
34
- "@vercel/frameworks": "0.9.1-canary.0",
34
+ "@vercel/frameworks": "0.9.2-canary.0",
35
35
  "@vercel/ncc": "0.24.0",
36
36
  "aggregate-error": "3.0.1",
37
37
  "async-retry": "1.2.3",
@@ -50,5 +50,5 @@
50
50
  "typescript": "4.3.4",
51
51
  "yazl": "2.5.1"
52
52
  },
53
- "gitHead": "f26858b735ad5d54e01afa67133b9f9456fbe72f"
53
+ "gitHead": "08b04d0bda5e50b0dbce6f2595207e96271fc11e"
54
54
  }