Skip to content

Commit b15ff50

Browse files
committed
fix: update dev scripts, add new fields to schema, enhance package mapping logic
1 parent 97b32e3 commit b15ff50

File tree

6 files changed

+120
-20
lines changed

6 files changed

+120
-20
lines changed

extensions/tsed-flow-packages-importer/src/api.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ function mapMaintainer(input: string | WarehousePluginMaintainer): Pick<Maintain
3030
}
3131

3232
function mapPackage(plugin: WarehousePluginItem): Partial<Package> & Pick<Package, "name" | "type"> {
33-
const type = (plugin.type || "3rd-party") as Package["type"]; // default to 3rd-party if missing
33+
const type = (plugin.type ||
34+
(plugin.name.startsWith("@tsed/") ? "official" : plugin.name.startsWith("@tsedio/") ? "premium" : "3rd-party")) as Package["type"];
3435

3536
return {
3637
name: plugin.name,

extensions/tsed-flow-packages/src/api.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ export type Options = {
1313
};
1414

1515
function mapNpmPackage(pkg: any): Partial<Package> & Pick<Package, "name" | "type"> {
16+
const type =
17+
pkg.type ||
18+
((pkg.name.startsWith("@tsed/") ? "official" : pkg.name.startsWith("@tsedio/") ? "premium" : "3rd-party") as Package["type"]);
19+
1620
return {
1721
name: pkg.name,
18-
type: "3rd-party",
22+
type,
1923
description: pkg.description ?? null,
2024
homepage: pkg.homepage ?? null,
2125
downloads: pkg.downloads ?? null,

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
"import:data:heroku": "yarn env:heroku -- node --import @swc-node/register/esm-register ./packages/scripts/import-data.ts",
3939
"import:single:heroku": "yarn env:heroku -- node --import @swc-node/register/esm-register ./packages/scripts/import-single.ts",
4040
"import:single:dev": "yarn env:dev -- node --import @swc-node/register/esm-register ./packages/scripts/import-single.ts",
41-
"start:dev": "yarn migrate:dev && concurrently \"yarn watch:dev\" \"yarn env:dev -- directus start\" --names watch,cms -c red,blue",
42-
"watch:dev": "nodemon --config nodemon.json --exec 'yarn build:dev:affected'",
41+
"start:dev": "yarn migrate:dev && yarn env:dev -- directus start",
42+
"watch:dev": "nodemon --config nodemon.json --exec 'nx run-many --target=build --all --parallel'",
4343
"test": "yarn vitest run",
4444
"test:watch": "yarn vitest",
4545
"test:ci": "yarn vitest run --reporter=junit --outputFile=./reports/vitest/test-results.xml",

packages/infra/directus/interfaces/DirectusSchema.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ export interface DirectusPreset {
278278
filter?: "json" | null;
279279
icon?: string | null;
280280
color?: string | null;
281+
uuid?: string | null;
281282
}
282283

283284
export interface DirectusRelation {
@@ -408,7 +409,7 @@ export interface DirectusUser {
408409
token?: string | null;
409410
last_access?: string | null;
410411
last_page?: string | null;
411-
provider?: string;
412+
provider?: "github";
412413
external_identifier?: string | null;
413414
auth_data?: "json" | null;
414415
email_notifications?: boolean | null;

packages/usecases/packages/PackagesService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class PackagesService extends DirectusItemsRepository<Package> {
5454
});
5555
}
5656

57-
async updateMetadata(id: Package["id"], data: Partial<Pick<Package, "description" | "stars">>) {
57+
async updateMetadata(id: Package["id"], data: Partial<Pick<Package, "description" | "stars" | "version">>) {
5858
const service = await this.getCollection();
5959
const updatedId = await service.updateOne(id as unknown as Item["id"], data as Partial<Package>);
6060

snapshots/snapshot-latest.yaml

Lines changed: 108 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,46 @@ collections:
193193
unarchive_value: null
194194
versioning: false
195195
fields:
196+
- collection: directus_presets
197+
field: uuid
198+
type: uuid
199+
meta:
200+
collection: directus_presets
201+
conditions: null
202+
display: null
203+
display_options: null
204+
field: uuid
205+
group: null
206+
hidden: true
207+
interface: input
208+
note: null
209+
options: null
210+
readonly: true
211+
required: false
212+
sort: 1
213+
special:
214+
- uuid
215+
translations: null
216+
validation: null
217+
validation_message: null
218+
width: full
219+
schema:
220+
name: uuid
221+
table: directus_presets
222+
data_type: uuid
223+
default_value: null
224+
max_length: null
225+
numeric_precision: null
226+
numeric_scale: null
227+
is_nullable: true
228+
is_unique: false
229+
is_indexed: false
230+
is_primary_key: false
231+
is_generated: false
232+
generation_expression: null
233+
has_auto_increment: false
234+
foreign_key_table: null
235+
foreign_key_column: null
196236
- collection: maintainers
197237
field: id
198238
type: uuid
@@ -1068,8 +1108,9 @@ fields:
10681108
meta:
10691109
collection: packages
10701110
conditions: null
1071-
display: null
1072-
display_options: null
1111+
display: labels
1112+
display_options:
1113+
format: false
10731114
field: tags
10741115
group: null
10751116
hidden: false
@@ -1402,8 +1443,22 @@ fields:
14021443
meta:
14031444
collection: packages
14041445
conditions: null
1405-
display: null
1406-
display_options: null
1446+
display: labels
1447+
display_options:
1448+
choices:
1449+
- color: '#3399FF'
1450+
icon: mode_standby
1451+
text: Official
1452+
value: official
1453+
- color: '#FFC23B'
1454+
icon: workspace_premium
1455+
text: Premium
1456+
value: premium
1457+
- color: '#2ECDA7'
1458+
icon: communities
1459+
text: Community
1460+
value: 3rd-party
1461+
format: false
14071462
field: type
14081463
group: null
14091464
hidden: false
@@ -2653,7 +2708,7 @@ fields:
26532708
value: Custom
26542709
readonly: false
26552710
required: false
2656-
sort: 11
2711+
sort: 12
26572712
special: null
26582713
translations: null
26592714
validation: null
@@ -2691,8 +2746,8 @@ fields:
26912746
note: null
26922747
options: null
26932748
readonly: false
2694-
required: true
2695-
sort: 9
2749+
required: false
2750+
sort: 10
26962751
special: null
26972752
translations: null
26982753
validation: null
@@ -2706,7 +2761,7 @@ fields:
27062761
max_length: 255
27072762
numeric_precision: null
27082763
numeric_scale: null
2709-
is_nullable: true
2764+
is_nullable: false
27102765
is_unique: false
27112766
is_indexed: false
27122767
is_primary_key: false
@@ -2736,7 +2791,7 @@ fields:
27362791
value: organization
27372792
readonly: false
27382793
required: false
2739-
sort: 12
2794+
sort: 13
27402795
special: null
27412796
translations: null
27422797
validation: null
@@ -2775,7 +2830,7 @@ fields:
27752830
options: null
27762831
readonly: false
27772832
required: false
2778-
sort: 13
2833+
sort: 14
27792834
special: null
27802835
translations: null
27812836
validation: null
@@ -2814,7 +2869,7 @@ fields:
28142869
options: null
28152870
readonly: false
28162871
required: false
2817-
sort: 14
2872+
sort: 15
28182873
special: null
28192874
translations: null
28202875
validation: null
@@ -3087,7 +3142,7 @@ fields:
30873142
options: null
30883143
readonly: false
30893144
required: false
3090-
sort: 16
3145+
sort: 17
30913146
special:
30923147
- alias
30933148
- no-data
@@ -3112,7 +3167,7 @@ fields:
31123167
options: null
31133168
readonly: false
31143169
required: false
3115-
sort: 15
3170+
sort: 16
31163171
special:
31173172
- alias
31183173
- no-data
@@ -3389,7 +3444,7 @@ fields:
33893444
value: platinum
33903445
readonly: false
33913446
required: false
3392-
sort: 10
3447+
sort: 11
33933448
special: null
33943449
translations: null
33953450
validation: null
@@ -3451,6 +3506,45 @@ fields:
34513506
has_auto_increment: false
34523507
foreign_key_table: null
34533508
foreign_key_column: null
3509+
- collection: sponsors
3510+
field: login
3511+
type: string
3512+
meta:
3513+
collection: sponsors
3514+
conditions: null
3515+
display: null
3516+
display_options: null
3517+
field: login
3518+
group: null
3519+
hidden: false
3520+
interface: input
3521+
note: null
3522+
options: null
3523+
readonly: false
3524+
required: true
3525+
sort: 9
3526+
special: null
3527+
translations: null
3528+
validation: null
3529+
validation_message: null
3530+
width: full
3531+
schema:
3532+
name: login
3533+
table: sponsors
3534+
data_type: character varying
3535+
default_value: null
3536+
max_length: 255
3537+
numeric_precision: null
3538+
numeric_scale: null
3539+
is_nullable: true
3540+
is_unique: false
3541+
is_indexed: false
3542+
is_primary_key: false
3543+
is_generated: false
3544+
generation_expression: null
3545+
has_auto_increment: false
3546+
foreign_key_table: null
3547+
foreign_key_column: null
34543548
relations:
34553549
- collection: maintainers
34563550
field: user_updated

0 commit comments

Comments
 (0)