Skip to content

Commit 311f8e1

Browse files
authored
fix: prepare changes for ESM use verbatimSyntax (#1896)
* fix: prepare changes for ESM use verbatimSyntax * chore: fix style
1 parent ea4ea9f commit 311f8e1

402 files changed

Lines changed: 882 additions & 821 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.prettierrc.cjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
trailingComma: 'all',
3+
tabWidth: 2,
4+
semi: true,
5+
singleQuote: true,
6+
importOrder: ['^@?fastify', '^@?graasp', '^[./]'],
7+
importOrderSeparation: true,
8+
importOrderParserPlugins: ['typescript', 'decorators-legacy'],
9+
importOrderSortSpecifiers: true,
10+
plugins: ['@trivago/prettier-plugin-sort-imports'],
11+
};

.prettierrc.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

.vscode/launch.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
// Use IntelliSense to learn about possible Node.js debug attributes.
3-
// Hover to view descriptions of existing attributes.
4-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5-
"version": "0.2.0",
6-
"configurations": [
7-
{
8-
"type": "node",
9-
"request": "attach",
10-
"name": "Attach by Process ID",
11-
"processId": "${command:PickProcess}",
12-
"protocol": "inspector"
13-
}
14-
]
15-
}
2+
// Use IntelliSense to learn about possible Node.js debug attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "attach",
10+
"name": "Attach by Process ID",
11+
"processId": "${command:PickProcess}",
12+
"protocol": "inspector"
13+
}
14+
]
15+
}

.vscode/settings.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
"**/coverage": true
2626
},
2727
"typescript.referencesCodeLens.enabled": false,
28-
"appService.zipIgnorePattern": [
29-
".vscode{,/**}"
30-
],
31-
"appService.deploySubpath": "",
3228
"jest.runMode": "on-demand",
3329
"sqltools.connections": [
3430
{

.vscode/tasks.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
// See https://go.microsoft.com/fwlink/?LinkId=733558
3-
// for the documentation about the tasks.json format
4-
"version": "2.0.0",
5-
"tasks": [
6-
{
7-
"type": "npm",
8-
"script": "build",
9-
"group": {
10-
"kind": "build",
11-
"isDefault": true
12-
}
13-
}
14-
]
15-
}
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"type": "npm",
8+
"script": "build",
9+
"group": {
10+
"kind": "build",
11+
"isDefault": true
12+
}
13+
}
14+
]
15+
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"license": "AGPL-3.0-only",
1313
"author": "Graasp",
14+
"type": "commonjs",
1415
"scripts": {
1516
"start": "yarn serve",
1617
"build": "yarn lint && yarn build-ts",

src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// should not be reimported in any other files !
33
import 'reflect-metadata';
44

5-
import { FastifyInstance } from 'fastify';
5+
import type { FastifyInstance } from 'fastify';
66
import fp from 'fastify-plugin';
77

88
import { registerDependencies } from './di/container';

src/di/container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Redis } from 'ioredis';
22
import { MeiliSearch } from 'meilisearch';
33

4-
import { FastifyInstance } from 'fastify';
4+
import type { FastifyInstance } from 'fastify';
55

66
import Etherpad from '@graasp/etherpad-api';
77

src/di/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { InjectionToken, container } from 'tsyringe';
1+
import { type InjectionToken, container } from 'tsyringe';
22

33
export const resolveDependency = <T>(injectionToken: InjectionToken<T> | string) => {
44
return container.resolve<T>(injectionToken);

src/drizzle/schema.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { and, getTableColumns, isNotNull, sql } from 'drizzle-orm';
22
import {
3-
AnyPgColumn,
3+
type AnyPgColumn,
44
boolean,
55
check,
66
doublePrecision,
@@ -20,15 +20,20 @@ import {
2020
import { eq, isNull } from 'drizzle-orm/sql';
2121
import geoip from 'geoip-lite';
2222

23-
import { AccountType, CompleteMember, ItemSettings, ItemTypeUnion } from '@graasp/sdk';
23+
import {
24+
AccountType,
25+
type CompleteMember,
26+
type ItemSettings,
27+
type ItemTypeUnion,
28+
} from '@graasp/sdk';
2429

2530
import { customNumeric, ltree } from './customTypes';
2631

2732
export const actionViewEnum = pgEnum('action_view_enum', [
2833
'builder',
2934
'player',
3035
'library',
31-
'explorer',
36+
'explorer', // TODO: remove this value from the data and migrate to library
3237
'account',
3338
'auth',
3439
'unknown',

0 commit comments

Comments
 (0)