@netlify/build 35.8.9 → 35.9.0

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,4 +1,4 @@
1
- export const MIGRATION_DIR_PATTERN = /^\d{10}_[a-z0-9-]+$/;
1
+ export const MIGRATION_DIR_PATTERN = /^\d+_[a-z0-9-]+$/;
2
2
  export const validateMigrationDirs = (dirNames, existingSqlFiles) => {
3
3
  const errors = [];
4
4
  for (const dirName of dirNames) {
@@ -19,7 +19,7 @@ export const validateMigrationDirs = (dirNames, existingSqlFiles) => {
19
19
  export const formatValidationErrors = (errors) => {
20
20
  const lines = errors.map((error) => {
21
21
  if (error.type === 'invalid_dir_name') {
22
- return ` - "${error.dirName}" does not match the required pattern "<Unix-timestamp>_<slug>" (e.g. "1700000000_create-users"). Slugs must be lowercase alphanumeric with hyphens.`;
22
+ return ` - "${error.dirName}" does not match the required pattern "<number>_<slug>" (e.g. "1700000000_create-users" or "001_create-users"). Slugs must be lowercase alphanumeric with hyphens.`;
23
23
  }
24
24
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
25
25
  if (error.type === 'missing_sql_file') {
@@ -8,19 +8,21 @@ describe('MIGRATION_DIR_PATTERN', () => {
8
8
  '9999999999_z',
9
9
  '1700000000_a',
10
10
  '1700000000_abc-def-123',
11
+ '001_create-users',
12
+ '1_init',
13
+ '0001_add-posts',
14
+ '42_z',
11
15
  ];
12
16
  test.each(validNames)('matches valid name: %s', (name) => {
13
17
  expect(MIGRATION_DIR_PATTERN.test(name)).toBe(true);
14
18
  });
15
19
  const invalidNames = [
16
- { name: '170000000_short-ts', reason: '9-digit timestamp' },
17
- { name: '17000000000_long-ts', reason: '11-digit timestamp' },
18
20
  { name: '1700000000_CAPS', reason: 'uppercase letters' },
19
21
  { name: '1700000000_under_score', reason: 'underscores in slug' },
20
- { name: 'no-timestamp', reason: 'no timestamp prefix' },
22
+ { name: 'no-timestamp', reason: 'no numeric prefix' },
21
23
  { name: '1700000000_', reason: 'empty slug' },
22
24
  { name: '1700000000', reason: 'missing underscore and slug' },
23
- { name: '_create-users', reason: 'missing timestamp' },
25
+ { name: '_create-users', reason: 'missing number prefix' },
24
26
  { name: '1700000000_hello world', reason: 'spaces in slug' },
25
27
  { name: '1700000000_special!char', reason: 'special characters in slug' },
26
28
  ];
@@ -80,7 +82,7 @@ describe('formatValidationErrors', () => {
80
82
  const message = formatValidationErrors([{ type: 'invalid_dir_name', dirName: 'bad-name' }]);
81
83
  expect(message).toContain('Database migration validation failed');
82
84
  expect(message).toContain('"bad-name"');
83
- expect(message).toContain('<Unix-timestamp>_<slug>');
85
+ expect(message).toContain('<number>_<slug>');
84
86
  });
85
87
  test('formats missing_sql_file errors', () => {
86
88
  const message = formatValidationErrors([{ type: 'missing_sql_file', dirName: '1700000000_create-users' }]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "35.8.9",
3
+ "version": "35.9.0",
4
4
  "description": "Netlify build module",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -70,7 +70,7 @@
70
70
  "@netlify/blobs": "^10.4.4",
71
71
  "@netlify/cache-utils": "^6.0.5",
72
72
  "@netlify/config": "^24.4.3",
73
- "@netlify/edge-bundler": "14.9.15",
73
+ "@netlify/edge-bundler": "14.9.16",
74
74
  "@netlify/functions-utils": "^6.2.26",
75
75
  "@netlify/git-utils": "^6.0.4",
76
76
  "@netlify/opentelemetry-utils": "^2.0.2",
@@ -152,5 +152,5 @@
152
152
  "engines": {
153
153
  "node": ">=18.14.0"
154
154
  },
155
- "gitHead": "5163296011af5d699885acf2c8bca82a4458ab31"
155
+ "gitHead": "6588f01d80a48a02ecdf660eead20ae0d728e075"
156
156
  }