Skip to content

Commit 104d694

Browse files
committed
chore(bin): update imports to use node: protocol and improve typings
Update native module imports to use the explicit `node:` protocol for clarity and compliance with current Node.js standards. chore(scripts): silence unused error variable warning Rename unused error variable to underscore-prefixed to avoid linter warnings while maintaining silent failure behavior on chmod errors. chore(tsconfig): exclude fixtures and test files from the build Exclude test and fixture files from TypeScript compilation to streamline type checking and improve build performance.
1 parent be4b924 commit 104d694

11 files changed

Lines changed: 190 additions & 189 deletions

File tree

bin/lokalise-mcp.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* globally, locally, or via npx.
88
*/
99

10-
import { spawn } from "child_process";
11-
import { fileURLToPath } from "url";
12-
import { dirname, join } from "path";
10+
import { spawn } from "node:child_process";
11+
import { fileURLToPath } from "node:url";
12+
import { dirname, join } from "node:path";
1313

1414
const __filename = fileURLToPath(import.meta.url);
1515
const __dirname = dirname(__filename);

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
"release:sign": "node scripts/sign-dxt.js",
4343
"scaffold:domain": "node scripts/scaffold-domain.js",
4444
"scaffold:domain:cli": "node scripts/scaffold-domain-cli.js",
45-
"test": "NODE_OPTIONS='--experimental-vm-modules' jest",
46-
"test:coverage": "NODE_OPTIONS='--experimental-vm-modules' jest --coverage",
45+
"test": "TZ=UTC NODE_OPTIONS='--experimental-vm-modules' jest",
46+
"test:coverage": "TZ=UTC NODE_OPTIONS='--experimental-vm-modules' jest --coverage",
4747
"update:deps": "npx npm-check-updates -u && npm install --legacy-peer-deps",
4848
"validate:manifest": "node scripts/generate-manifest.js --validate"
4949
},

scripts/ensure-executable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ try {
1515
if (fs.existsSync(binScript)) {
1616
try {
1717
fs.chmodSync(binScript, 0o755);
18-
} catch (err) {
18+
} catch (_err) {
1919
// Silently fail if chmod is not available (Windows, some containers)
2020
}
2121
}

src/domains/keys/__fixtures__/keys.fixtures.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const createBaseKeyWithTranslations = (overrides: Partial<Key> = {}): Key => ({
6262
export const keysListFixture: Key[] = [
6363
createBaseKey({
6464
key_id: 15519786,
65-
created_at: "2018-12-09 18:39:20 (Etc/UTC)",
65+
created_at: "2018-12-09T18:39:20.000Z",
6666
created_at_timestamp: 1544380760,
6767
key_name: {
6868
ios: "another_k",
@@ -90,7 +90,7 @@ export const keysListFixture: Key[] = [
9090
}),
9191
createBaseKey({
9292
key_id: 15571975,
93-
created_at: "2018-12-10 17:35:34 (Etc/UTC)",
93+
created_at: "2018-12-10T17:35:34.000Z",
9494
created_at_timestamp: 1544463334,
9595
key_name: {
9696
ios: "rspec k",
@@ -122,7 +122,7 @@ export const keysListFixture: Key[] = [
122122
export const keysCursorPaginationFixture: Key[] = [
123123
createBaseKey({
124124
key_id: 15519786,
125-
created_at: "2018-12-09 18:39:20 (Etc/UTC)",
125+
created_at: "2018-12-09T18:39:20.000Z",
126126
created_at_timestamp: 1544380760,
127127
key_name: {
128128
ios: "another_k",
@@ -150,7 +150,7 @@ export const keysCursorPaginationFixture: Key[] = [
150150
}),
151151
createBaseKey({
152152
key_id: 15571975,
153-
created_at: "2018-12-10 17:35:34 (Etc/UTC)",
153+
created_at: "2018-12-10T17:35:34.000Z",
154154
created_at_timestamp: 1544463334,
155155
key_name: {
156156
ios: "rspec k",
@@ -181,7 +181,7 @@ export const keysCursorPaginationFixture: Key[] = [
181181
// Retrieve fixture - single key with full details (from retrieve.json)
182182
export const keyRetrieveFixture: Key = createBaseKeyWithTranslations({
183183
key_id: 74189435,
184-
created_at: "2021-01-29 17:34:16 (Etc/UTC)",
184+
created_at: "2021-01-29T17:34:16.000Z",
185185
created_at_timestamp: 1611941656,
186186
key_name: {
187187
ios: "callback",
@@ -205,7 +205,7 @@ export const keyRetrieveFixture: Key = createBaseKeyWithTranslations({
205205
comment: "Single",
206206
added_by: 20181,
207207
added_by_email: "bodrovis@protonmail.com",
208-
added_at: "2023-09-19 13:26:15 (Etc/UTC)",
208+
added_at: "2023-09-19T13:26:15.000Z",
209209
added_at_timestamp: 1695129975,
210210
},
211211
],
@@ -219,7 +219,7 @@ export const keyRetrieveFixture: Key = createBaseKeyWithTranslations({
219219
translation: "",
220220
modified_by: 20181,
221221
modified_by_email: "bodrovis@protonmail.com",
222-
modified_at: "2021-01-29 17:34:16 (Etc/UTC)",
222+
modified_at: "2021-01-29T17:34:16.000Z",
223223
modified_at_timestamp: 1611941656,
224224
is_reviewed: false,
225225
reviewed_by: 0,
@@ -238,9 +238,9 @@ export const keyRetrieveFixture: Key = createBaseKeyWithTranslations({
238238
base_words: 5,
239239
char_limit: 0,
240240
custom_attributes: "",
241-
modified_at: "2023-09-19 13:26:15 (Etc/UTC)",
241+
modified_at: "2023-09-19T13:26:15.000Z",
242242
modified_at_timestamp: 1695129975,
243-
translations_modified_at: "2021-07-27 10:42:09 (Etc/UTC)",
243+
translations_modified_at: "2021-07-27T10:42:09.000Z",
244244
translations_modified_at_timestamp: 1627382529,
245245
});
246246

@@ -249,7 +249,7 @@ export const keyCreateFixture: BulkResult<Key> = {
249249
items: [
250250
createBaseKeyWithTranslations({
251251
key_id: 378217831,
252-
created_at: "2023-09-21 12:18:47 (Etc/UTC)",
252+
created_at: "2023-09-21T12:18:47.000Z",
253253
created_at_timestamp: 1695298727,
254254
key_name: {
255255
ios: "welcome_web_new",
@@ -277,7 +277,7 @@ export const keyCreateFixture: BulkResult<Key> = {
277277
translation: "Welcome",
278278
modified_by: 20181,
279279
modified_by_email: "bodrovis@protonmail.com",
280-
modified_at: "2023-09-21 12:18:47 (Etc/UTC)",
280+
modified_at: "2023-09-21T12:18:47.000Z",
281281
modified_at_timestamp: 1695298727,
282282
is_reviewed: false,
283283
reviewed_by: 0,
@@ -295,7 +295,7 @@ export const keyCreateFixture: BulkResult<Key> = {
295295
translation: "",
296296
modified_by: 20181,
297297
modified_by_email: "bodrovis@protonmail.com",
298-
modified_at: "2023-09-21 12:18:47 (Etc/UTC)",
298+
modified_at: "2023-09-21T12:18:47.000Z",
299299
modified_at_timestamp: 1695298727,
300300
is_reviewed: false,
301301
reviewed_by: 0,
@@ -313,7 +313,7 @@ export const keyCreateFixture: BulkResult<Key> = {
313313
translation: "",
314314
modified_by: 20181,
315315
modified_by_email: "bodrovis@protonmail.com",
316-
modified_at: "2023-09-21 12:18:47 (Etc/UTC)",
316+
modified_at: "2023-09-21T12:18:47.000Z",
317317
modified_at_timestamp: 1695298727,
318318
is_reviewed: false,
319319
reviewed_by: 0,
@@ -332,14 +332,14 @@ export const keyCreateFixture: BulkResult<Key> = {
332332
base_words: 1,
333333
char_limit: 0,
334334
custom_attributes: "",
335-
modified_at: "2023-09-21 12:18:47 (Etc/UTC)",
335+
modified_at: "2023-09-21T12:18:47.000Z",
336336
modified_at_timestamp: 1695298727,
337-
translations_modified_at: "2023-09-21 12:18:47 (Etc/UTC)",
337+
translations_modified_at: "2023-09-21T12:18:47.000Z",
338338
translations_modified_at_timestamp: 1695298727,
339339
}),
340340
createBaseKeyWithTranslations({
341341
key_id: 378217832,
342-
created_at: "2023-09-21 12:18:47 (Etc/UTC)",
342+
created_at: "2023-09-21T12:18:47.000Z",
343343
created_at_timestamp: 1695298727,
344344
key_name: {
345345
ios: "welcome_ios_new",
@@ -368,7 +368,7 @@ export const keyCreateFixture: BulkResult<Key> = {
368368
'{"one":"I have one apple","other":"I have a lot of apples"}',
369369
modified_by: 20181,
370370
modified_by_email: "bodrovis@protonmail.com",
371-
modified_at: "2023-09-21 12:18:47 (Etc/UTC)",
371+
modified_at: "2023-09-21T12:18:47.000Z",
372372
modified_at_timestamp: 1695298727,
373373
is_reviewed: false,
374374
reviewed_by: 0,
@@ -387,7 +387,7 @@ export const keyCreateFixture: BulkResult<Key> = {
387387
'{"zero":"","one":"","two":"","few":"","many":"","other":""}',
388388
modified_by: 20181,
389389
modified_by_email: "bodrovis@protonmail.com",
390-
modified_at: "2023-09-21 12:18:47 (Etc/UTC)",
390+
modified_at: "2023-09-21T12:18:47.000Z",
391391
modified_at_timestamp: 1695298727,
392392
is_reviewed: false,
393393
reviewed_by: 0,
@@ -405,7 +405,7 @@ export const keyCreateFixture: BulkResult<Key> = {
405405
translation: '{"one":"","other":""}',
406406
modified_by: 20181,
407407
modified_by_email: "bodrovis@protonmail.com",
408-
modified_at: "2023-09-21 12:18:47 (Etc/UTC)",
408+
modified_at: "2023-09-21T12:18:47.000Z",
409409
modified_at_timestamp: 1695298727,
410410
is_reviewed: false,
411411
reviewed_by: 0,
@@ -424,9 +424,9 @@ export const keyCreateFixture: BulkResult<Key> = {
424424
base_words: 10,
425425
char_limit: 0,
426426
custom_attributes: "",
427-
modified_at: "2023-09-21 12:18:47 (Etc/UTC)",
427+
modified_at: "2023-09-21T12:18:47.000Z",
428428
modified_at_timestamp: 1695298727,
429-
translations_modified_at: "2023-09-21 12:18:47 (Etc/UTC)",
429+
translations_modified_at: "2023-09-21T12:18:47.000Z",
430430
translations_modified_at_timestamp: 1695298727,
431431
}),
432432
],
@@ -436,7 +436,7 @@ export const keyCreateFixture: BulkResult<Key> = {
436436
// Update fixture - single key for update operations
437437
export const keyUpdateFixture: Key = createBaseKey({
438438
key_id: 378217831,
439-
created_at: "2023-09-21 12:18:47 (Etc/UTC)",
439+
created_at: "2023-09-21T12:18:47.000Z",
440440
created_at_timestamp: 1695298727,
441441
key_name: {
442442
ios: "welcome_web_updated",
@@ -481,7 +481,7 @@ export const keysBulkUpdateFixture: BulkResult<Key> = {
481481
items: [
482482
createBaseKey({
483483
key_id: 378217831,
484-
created_at: "2023-09-21 12:18:47 (Etc/UTC)",
484+
created_at: "2023-09-21T12:18:47.000Z",
485485
created_at_timestamp: 1695298727,
486486
key_name: {
487487
ios: "welcome_web_bulk_updated",
@@ -509,7 +509,7 @@ export const keysBulkUpdateFixture: BulkResult<Key> = {
509509
}),
510510
createBaseKey({
511511
key_id: 378217832,
512-
created_at: "2023-09-21 12:18:47 (Etc/UTC)",
512+
created_at: "2023-09-21T12:18:47.000Z",
513513
created_at_timestamp: 1695298727,
514514
key_name: {
515515
ios: "welcome_ios_bulk_updated",

src/domains/keys/__snapshots__/keys.formatter.test.ts.snap

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ No platform-specific values set
3636
- **Archive Status**: ✅ Active
3737
3838
## Timeline Information
39-
- **Created**: 2018-12-09 18:39:20 (Etc/UTC) (12/9/2018)
39+
- **Created**: Invalid date
4040
- **Last Modified**: undefined (Invalid Date)
4141
- **Translations Last Modified**: undefined (Invalid Date)
4242
@@ -105,9 +105,9 @@ No platform-specific values set
105105
- **Archive Status**: ✅ Active
106106
107107
## Timeline Information
108-
- **Created**: 2021-01-29 17:34:16 (Etc/UTC) (1/29/2021)
109-
- **Last Modified**: 2023-09-19 13:26:15 (Etc/UTC) (9/19/2023)
110-
- **Translations Last Modified**: 2021-07-27 10:42:09 (Etc/UTC) (7/27/2021)
108+
- **Created**: Invalid date
109+
- **Last Modified**: Invalid date
110+
- **Translations Last Modified**: Invalid date
111111
112112
## Translation Status
113113
@@ -442,9 +442,9 @@ No platform-specific values set
442442
- **Archive Status**: ✅ Active
443443
444444
## Timeline Information
445-
- **Created**: 2021-01-29 17:34:16 (Etc/UTC) (1/29/2021)
446-
- **Last Modified**: 2023-09-19 13:26:15 (Etc/UTC) (9/19/2023)
447-
- **Translations Last Modified**: 2021-07-27 10:42:09 (Etc/UTC) (7/27/2021)
445+
- **Created**: Invalid date
446+
- **Last Modified**: Invalid date
447+
- **Translations Last Modified**: Invalid date
448448
449449
## Translation Status
450450
@@ -526,9 +526,9 @@ No platform-specific values set
526526
- **Archive Status**: ✅ Active
527527
528528
## Timeline Information
529-
- **Created**: 2021-01-29 17:34:16 (Etc/UTC) (1/29/2021)
530-
- **Last Modified**: 2023-09-19 13:26:15 (Etc/UTC) (9/19/2023)
531-
- **Translations Last Modified**: 2021-07-27 10:42:09 (Etc/UTC) (7/27/2021)
529+
- **Created**: Invalid date
530+
- **Last Modified**: Invalid date
531+
- **Translations Last Modified**: Invalid date
532532
533533
## Translation Status
534534
@@ -610,9 +610,9 @@ No platform-specific values set
610610
- **Archive Status**: ✅ Active
611611
612612
## Timeline Information
613-
- **Created**: 2021-01-29 17:34:16 (Etc/UTC) (1/29/2021)
614-
- **Last Modified**: 2023-09-19 13:26:15 (Etc/UTC) (9/19/2023)
615-
- **Translations Last Modified**: 2021-07-27 10:42:09 (Etc/UTC) (7/27/2021)
613+
- **Created**: Invalid date
614+
- **Last Modified**: Invalid date
615+
- **Translations Last Modified**: Invalid date
616616
617617
## Translation Status
618618
@@ -694,9 +694,9 @@ No platform-specific values set
694694
- **Archive Status**: ✅ Active
695695
696696
## Timeline Information
697-
- **Created**: 2021-01-29 17:34:16 (Etc/UTC) (1/29/2021)
698-
- **Last Modified**: 2023-09-19 13:26:15 (Etc/UTC) (9/19/2023)
699-
- **Translations Last Modified**: 2021-07-27 10:42:09 (Etc/UTC) (7/27/2021)
697+
- **Created**: Invalid date
698+
- **Last Modified**: Invalid date
699+
- **Translations Last Modified**: Invalid date
700700
701701
## Translation Status
702702

src/domains/projects/__fixtures__/projects.fixtures.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const projectsListFixture: Project[] = [
7272
project_type: "localization_files",
7373
name: "Angular",
7474
description: "",
75-
created_at: "2021-06-10 09:58:31 (Etc/UTC)",
75+
created_at: "2021-06-10T09:58:31.000Z",
7676
created_at_timestamp: 1623319111,
7777
created_by: 20181,
7878
created_by_email: "bodrovis@protonmail.com",
@@ -148,7 +148,7 @@ export const projectsListFixture: Project[] = [
148148
project_type: "localization_files",
149149
name: "Blog",
150150
description: "",
151-
created_at: "2021-07-29 19:38:16 (Etc/UTC)",
151+
created_at: "2021-07-29T19:38:16.000Z",
152152
created_at_timestamp: 1627587496,
153153
created_by: 20181,
154154
created_by_email: "bodrovis@protonmail.com",
@@ -209,7 +209,7 @@ export const projectPaginationFixture: Project = createBaseProject({
209209
project_type: "localization_files",
210210
name: "Blog",
211211
description: "",
212-
created_at: "2021-07-29 19:38:16 (Etc/UTC)",
212+
created_at: "2021-07-29T19:38:16.000Z",
213213
created_at_timestamp: 1627587496,
214214
created_by: 20181,
215215
created_by_email: "bodrovis@protonmail.com",
@@ -269,7 +269,7 @@ export const projectRetrieveFixture: Project = createBaseProject({
269269
project_type: "localization_files",
270270
name: "Demo Phoenix",
271271
description: "Description Phoenix",
272-
created_at: "2018-09-24 16:05:22 (Etc/UTC)",
272+
created_at: "2018-09-24T16:05:22.000Z",
273273
created_at_timestamp: 1537805122,
274274
created_by: 20181,
275275
created_by_email: "bodrovis@protonmail.com",
@@ -343,7 +343,7 @@ export const projectCreateFixture: Project = createBaseProject({
343343
project_type: "localization_files",
344344
name: "Node.js test",
345345
description: "Test description",
346-
created_at: "2023-09-21 14:42:14 (Etc/UTC)",
346+
created_at: "2023-09-21T14:42:14.000Z",
347347
created_at_timestamp: 1695307334,
348348
created_by: 20181,
349349
created_by_email: "bodrovis@protonmail.com",
@@ -404,7 +404,7 @@ export const projectUpdateFixture: Project = createBaseProject({
404404
project_type: "localization_files",
405405
name: "Node.js test - Updated",
406406
description: "Updated test description",
407-
created_at: "2023-09-21 14:42:14 (Etc/UTC)",
407+
created_at: "2023-09-21T14:42:14.000Z",
408408
created_at_timestamp: 1695307334,
409409
created_by: 20181,
410410
created_by_email: "bodrovis@protonmail.com",

0 commit comments

Comments
 (0)