Skip to content

Commit bb39835

Browse files
Copilothotlong
andcommitted
Fix Vercel deployment: pin Node 20.x, build all packages, fix TS2742 errors
- Pin engines.node to "20.x" (matches .node-version) to ensure Vercel uses Node 20 LTS with prebuilt better-sqlite3 binaries instead of Node 24 - Update build:vercel to build all packages except site (API function needs workspace packages compiled to dist/) - Sync pnpm-workspace.yaml onlyBuiltDependencies with package.json - Fix TS2742 declaration emit errors in @objectos/permissions by adding explicit ServiceObject type annotations - Remove unused ACCESS_LEVELS constant Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 72c8181 commit bb39835

File tree

10 files changed

+42
-31
lines changed

10 files changed

+42
-31
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "AGPL-3.0",
55
"packageManager": "pnpm@10.28.2",
66
"engines": {
7-
"node": ">=20.0.0"
7+
"node": "20.x"
88
},
99
"pnpm": {
1010
"onlyBuiltDependencies": [
@@ -23,7 +23,7 @@
2323
"dev:all": "concurrently -n api,web,site -c blue,green,yellow \"pnpm objectstack:serve\" \"pnpm web:dev\" \"pnpm site:dev\"",
2424
"start": "pnpm objectstack:serve",
2525
"build": "turbo run build",
26-
"build:vercel": "turbo run build --filter=@objectos/web...",
26+
"build:vercel": "turbo run build --filter='!@objectos/site'",
2727
"test": "turbo run test --concurrency=3",
2828
"test:coverage": "turbo run test:coverage --concurrency=3",
2929
"lint": "turbo run lint",

packages/permissions/src/objects/field_permission.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515
* @see https://protocol.objectstack.ai/docs/guides/security#field-level-security
1616
*/
1717
import { ObjectSchema, Field } from '@objectstack/spec/data';
18+
import type { ServiceObject } from '@objectstack/spec/data';
1819

19-
export const FieldPermissionObject = ObjectSchema.create({
20+
export const FieldPermissionObject: ServiceObject = ObjectSchema.create({
2021
name: 'field_permission',
2122
label: 'Field Permission',
2223
pluralLabel: 'Field Permissions',
2324
icon: 'columns',
24-
description: 'Controls visibility and editability of specific fields, scoped to a permission set.',
25+
description:
26+
'Controls visibility and editability of specific fields, scoped to a permission set.',
2527
isSystem: true,
2628

2729
fields: {

packages/permissions/src/objects/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export { SharingRuleObject } from './sharing_rule.js';
3434

3535
// ── Convenience aggregate ──────────────────────────────────────────────────────
3636

37+
import type { ServiceObject } from '@objectstack/spec/data';
3738
import { PermissionSetObject } from './permission_set.js';
3839
import { PermissionSetAssignmentObject } from './permission_set_assignment.js';
3940
import { ObjectPermissionObject } from './object_permission.js';
@@ -52,7 +53,7 @@ import { SharingRuleObject } from './sharing_rule.js';
5253
* config.objects = PermissionObjects;
5354
* ```
5455
*/
55-
export const PermissionObjects = [
56+
export const PermissionObjects: readonly ServiceObject[] = [
5657
PermissionSetObject,
5758
PermissionSetAssignmentObject,
5859
ObjectPermissionObject,

packages/permissions/src/objects/object_permission.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
* @see https://protocol.objectstack.ai/docs/guides/security#profiles
1313
*/
1414
import { ObjectSchema, Field } from '@objectstack/spec/data';
15+
import type { ServiceObject } from '@objectstack/spec/data';
1516

16-
export const ObjectPermissionObject = ObjectSchema.create({
17+
export const ObjectPermissionObject: ServiceObject = ObjectSchema.create({
1718
name: 'object_permission',
1819
label: 'Object Permission',
1920
pluralLabel: 'Object Permissions',
2021
icon: 'lock',
21-
description: 'Defines CRUD + lifecycle + viewAll/modifyAll permissions for an object, scoped to a permission set.',
22+
description:
23+
'Defines CRUD + lifecycle + viewAll/modifyAll permissions for an object, scoped to a permission set.',
2224
isSystem: true,
2325

2426
fields: {

packages/permissions/src/objects/organization_default.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,9 @@
1313
* @see https://protocol.objectstack.ai/docs/guides/security#sharing-rules
1414
*/
1515
import { ObjectSchema, Field } from '@objectstack/spec/data';
16+
import type { ServiceObject } from '@objectstack/spec/data';
1617

17-
const ACCESS_LEVELS = [
18-
{ label: 'Private', value: 'private' },
19-
{ label: 'Public Read Only', value: 'public_read_only' },
20-
{ label: 'Public Read/Write', value: 'public_read_write' },
21-
{ label: 'Controlled By Parent', value: 'controlled_by_parent' },
22-
] as const;
23-
24-
export const OrganizationDefaultObject = ObjectSchema.create({
18+
export const OrganizationDefaultObject: ServiceObject = ObjectSchema.create({
2519
name: 'organization_default',
2620
label: 'Organization-Wide Default',
2721
pluralLabel: 'Organization-Wide Defaults',
@@ -70,13 +64,12 @@ export const OrganizationDefaultObject = ObjectSchema.create({
7064
grant_access_using_hierarchy: Field.boolean({
7165
label: 'Grant Access Using Role Hierarchy',
7266
defaultValue: true,
73-
description: 'When true, users higher in the role hierarchy inherit access to subordinates\' records',
67+
description:
68+
"When true, users higher in the role hierarchy inherit access to subordinates' records",
7469
}),
7570
},
7671

77-
indexes: [
78-
{ fields: ['object_name'], unique: true },
79-
],
72+
indexes: [{ fields: ['object_name'], unique: true }],
8073

8174
enable: {
8275
trackHistory: true,

packages/permissions/src/objects/permission_set.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@
1818
* @see https://protocol.objectstack.ai/docs/guides/security#permission-sets
1919
*/
2020
import { ObjectSchema, Field } from '@objectstack/spec/data';
21+
import type { ServiceObject } from '@objectstack/spec/data';
2122

22-
export const PermissionSetObject = ObjectSchema.create({
23+
export const PermissionSetObject: ServiceObject = ObjectSchema.create({
2324
name: 'permission_set',
2425
label: 'Permission Set',
2526
pluralLabel: 'Permission Sets',
2627
icon: 'key',
27-
description: 'Unified permission container. Profiles (is_profile=true) and add-on sets (is_profile=false).',
28+
description:
29+
'Unified permission container. Profiles (is_profile=true) and add-on sets (is_profile=false).',
2830
isSystem: true,
2931

3032
fields: {
@@ -71,14 +73,16 @@ export const PermissionSetObject = ObjectSchema.create({
7173
system_permissions: {
7274
type: 'json' as const,
7375
label: 'System Permissions',
74-
description: 'Array of system permission keys, e.g. ["manage_users", "export_reports", "bulk_api_enabled"]',
76+
description:
77+
'Array of system permission keys, e.g. ["manage_users", "export_reports", "bulk_api_enabled"]',
7578
},
7679

7780
// ── Row-Level Security (spec: rowLevelSecurity) ─────────────────────────
7881
row_level_security: {
7982
type: 'json' as const,
8083
label: 'Row-Level Security',
81-
description: 'Array of RLS policies: [{ name, object, operation, using, check, roles, enabled, priority }]',
84+
description:
85+
'Array of RLS policies: [{ name, object, operation, using, check, roles, enabled, priority }]',
8286
},
8387

8488
// ── ObjectOS extensions (not in spec) ───────────────────────────────────

packages/permissions/src/objects/permission_set_assignment.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
* @see https://protocol.objectstack.ai/docs/guides/security#permission-sets
77
*/
88
import { ObjectSchema, Field } from '@objectstack/spec/data';
9+
import type { ServiceObject } from '@objectstack/spec/data';
910

10-
export const PermissionSetAssignmentObject = ObjectSchema.create({
11+
export const PermissionSetAssignmentObject: ServiceObject = ObjectSchema.create({
1112
name: 'permission_set_assignment',
1213
label: 'Permission Set Assignment',
1314
pluralLabel: 'Permission Set Assignments',
1415
icon: 'user-check',
15-
description: 'Links permission sets to users or groups. A user can have multiple permission sets.',
16+
description:
17+
'Links permission sets to users or groups. A user can have multiple permission sets.',
1618
isSystem: true,
1719

1820
fields: {

packages/permissions/src/objects/role.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@
1010
* @see https://protocol.objectstack.ai/docs/guides/security#role-hierarchy
1111
*/
1212
import { ObjectSchema, Field } from '@objectstack/spec/data';
13+
import type { ServiceObject } from '@objectstack/spec/data';
1314

14-
export const RoleObject = ObjectSchema.create({
15+
export const RoleObject: ServiceObject = ObjectSchema.create({
1516
name: 'role',
1617
label: 'Role',
1718
pluralLabel: 'Roles',
1819
icon: 'sitemap',
19-
description: 'Roles control record-level access through a hierarchy. Users higher in the hierarchy can see records owned by subordinates.',
20+
description:
21+
'Roles control record-level access through a hierarchy. Users higher in the hierarchy can see records owned by subordinates.',
2022
isSystem: true,
2123

2224
titleFormat: '{label}',
@@ -54,7 +56,8 @@ export const RoleObject = ObjectSchema.create({
5456
hierarchy_path: Field.text({
5557
label: 'Hierarchy Path',
5658
readonly: true,
57-
description: "Auto-computed materialized path, e.g. '/executive/sales_director/sales_manager'",
59+
description:
60+
"Auto-computed materialized path, e.g. '/executive/sales_director/sales_manager'",
5861
}),
5962

6063
hierarchy_level: Field.number({

packages/permissions/src/objects/sharing_rule.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
* @see https://protocol.objectstack.ai/docs/guides/security#sharing-rules
1717
*/
1818
import { ObjectSchema, Field } from '@objectstack/spec/data';
19+
import type { ServiceObject } from '@objectstack/spec/data';
1920

20-
export const SharingRuleObject = ObjectSchema.create({
21+
export const SharingRuleObject: ServiceObject = ObjectSchema.create({
2122
name: 'sharing_rule',
2223
label: 'Sharing Rule',
2324
pluralLabel: 'Sharing Rules',
2425
icon: 'share-2',
25-
description: 'Sharing rules extend access beyond the role hierarchy based on ownership or criteria.',
26+
description:
27+
'Sharing rules extend access beyond the role hierarchy based on ownership or criteria.',
2628
isSystem: true,
2729

2830
titleFormat: '{label}',
@@ -98,7 +100,8 @@ export const SharingRuleObject = ObjectSchema.create({
98100
// ── Criteria-Based: condition expression (spec: condition) ───────────────
99101
condition: Field.text({
100102
label: 'Condition',
101-
description: "Expression for criteria-based rules, e.g. \"type = 'customer' AND is_active = true\"",
103+
description:
104+
'Expression for criteria-based rules, e.g. "type = \'customer\' AND is_active = true"',
102105
}),
103106

104107
// ── Shared With (spec: sharedWith: { type, value }) ─────────────────────

pnpm-workspace.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ packages:
55

66
onlyBuiltDependencies:
77
- '@nestjs/core'
8+
- better-sqlite3
89
- esbuild
910
- sqlite3
1011
- unrs-resolver

0 commit comments

Comments
 (0)