Skip to content

Commit de42d2d

Browse files
committed
run linter for entire project, removed step for version check in workflow
1 parent 4f8b21e commit de42d2d

28 files changed

+169
-1583
lines changed

.github/workflows/publish.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,7 @@ jobs:
2525
- name: Run build
2626
run: npm run build
2727

28-
- name: Check if version already exists on npm
29-
id: check
30-
run: |
31-
VERSION=$(node -p "require('./package.json').version")
32-
NAME=$(node -p "require('./package.json').name")
33-
34-
if npm view $NAME@$VERSION > /dev/null 2>&1; then
35-
echo "exists=true" >> $GITHUB_OUTPUT
36-
else
37-
echo "exists=false" >> $GITHUB_OUTPUT
38-
fi
39-
4028
- name: Publish to npm
41-
if: steps.check.outputs.exists == 'false'
4229
run: npm publish --access public
4330
env:
4431
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

bun.lock

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

package.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "directus-helper",
3-
"version": "0.0.0",
3+
"version": "1.0.0",
44
"license": "MIT",
55
"bin": "dist/cli.js",
66
"type": "module",
@@ -12,11 +12,10 @@
1212
"build": "tsc",
1313
"dev": "tsc --watch",
1414
"test": "prettier --check . && xo && ava",
15-
"test:w": "ava --watch"
15+
"test:w": "ava --watch",
16+
"format": "npx @biomejs/biome format --write"
1617
},
17-
"files": [
18-
"dist"
19-
],
18+
"files": ["dist"],
2019
"dependencies": {
2120
"chokidar": "^3.6.0",
2221
"clipboardy": "^4.0.0",
@@ -57,9 +56,7 @@
5756
"extensions": {
5857
"ts": "module"
5958
},
60-
"nodeArguments": [
61-
"--import=tsimp"
62-
]
59+
"nodeArguments": ["--import=tsimp"]
6360
},
6461
"xo": {
6562
"extends": "xo-react",

source/components/ActionsSelect.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ export const ActionsSelect: React.FC<Props> = (props) => {
2222
!hasProject && { value: Actions.CreateProject, label: "Create project" },
2323
hasProject && { value: Actions.StartDev, label: "Start dev server" },
2424
hasProject &&
25-
hasProductionTargets && {
26-
value: Actions.BuildExtensions,
27-
label: "Build extensions",
28-
},
25+
hasProductionTargets && {
26+
value: Actions.BuildExtensions,
27+
label: "Build extensions",
28+
},
2929
hasProject && { value: Actions.ProjectSettings, label: "Project Settings" },
3030
{ value: Actions.Exit, label: "Exit" },
3131
].filter(Boolean) as Item[];

source/components/DevServerDashboard/DashboardBudge.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import React from 'react';
2-
import {Box, Text, TextProps} from 'ink';
1+
import React from "react";
2+
import { Box, Text, TextProps } from "ink";
33

44
interface Props extends TextProps {
55
content?: string;
66
}
77

8-
export const DashboardBudge: React.FC<Props> = props => {
9-
const {content, children, ...rest} = props;
8+
export const DashboardBudge: React.FC<Props> = (props) => {
9+
const { content, children, ...rest } = props;
1010

1111
return (
1212
<Box width="100%" justifyContent="flex-end">
@@ -18,7 +18,7 @@ export const DashboardBudge: React.FC<Props> = props => {
1818
borderRight
1919
borderBottom
2020
borderStyle="round"
21-
borderColor={rest.color || 'blue'}
21+
borderColor={rest.color || "blue"}
2222
>
2323
{content ? <Text {...rest}>{content}</Text> : null}
2424
{children}
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import React from 'react';
2-
import {Box, Text} from 'ink';
1+
import React from "react";
2+
import { Box, Text } from "ink";
33
import {
44
DevServerTaskStatus,
55
StatusChangePayload,
6-
} from '../../utils/devServer/interfaces.js';
7-
import {ForegroundColorName} from 'chalk';
8-
import Spinner from 'ink-spinner';
6+
} from "../../utils/devServer/interfaces.js";
7+
import { ForegroundColorName } from "chalk";
8+
import Spinner from "ink-spinner";
99

1010
interface Props {
1111
name: string;
1212
payload: StatusChangePayload;
1313
}
1414

15-
export const DashboardTask: React.FC<Props> = props => {
16-
const {name, payload} = props;
15+
export const DashboardTask: React.FC<Props> = (props) => {
16+
const { name, payload } = props;
1717
const status = statusMessage[payload.status];
1818

1919
return (
@@ -30,22 +30,22 @@ export const DashboardTask: React.FC<Props> = props => {
3030

3131
const statusMessage: Record<
3232
DevServerTaskStatus,
33-
{title: string; color: ForegroundColorName}
33+
{ title: string; color: ForegroundColorName }
3434
> = {
3535
[DevServerTaskStatus.Building]: {
36-
title: 'Building',
37-
color: 'grey',
36+
title: "Building",
37+
color: "grey",
3838
},
3939
[DevServerTaskStatus.Error]: {
40-
title: 'Error occured while build',
41-
color: 'red',
40+
title: "Error occured while build",
41+
color: "red",
4242
},
4343
[DevServerTaskStatus.Done]: {
44-
title: 'Build done',
45-
color: 'green',
44+
title: "Build done",
45+
color: "green",
4646
},
4747
[DevServerTaskStatus.InstallingPackages]: {
48-
title: 'Installing packgaes',
49-
color: 'yellow'
50-
}
48+
title: "Installing packgaes",
49+
color: "yellow",
50+
},
5151
};

source/components/LoadingIndicator.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import React from 'react';
2-
import {Text} from 'ink';
3-
import Spinner from 'ink-spinner';
1+
import React from "react";
2+
import { Text } from "ink";
3+
import Spinner from "ink-spinner";
44

55
interface Props {
66
label: string;
77
}
88

9-
export const LoadingIndicator: React.FC<Props> = props => {
9+
export const LoadingIndicator: React.FC<Props> = (props) => {
1010
return (
1111
<Text>
1212
<Text color="green">

source/components/MigratorDashboard/EnvironmentCreationForm.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import React, {useState} from 'react';
2-
import zod from 'zod';
3-
import {Box, Text} from 'ink';
4-
import {EnvironmentConfiguration} from '../../utils/settingsUtils/interface.js';
5-
import {InputWithLabel} from '../InputWithLabel.js';
6-
import {useBoolean} from '../../hooks/useBoolean.js';
1+
import React, { useState } from "react";
2+
import zod from "zod";
3+
import { Box, Text } from "ink";
4+
import { EnvironmentConfiguration } from "../../utils/settingsUtils/interface.js";
5+
import { InputWithLabel } from "../InputWithLabel.js";
6+
import { useBoolean } from "../../hooks/useBoolean.js";
77

88
interface Props {
99
onCreate: (name: string, configuration: EnvironmentConfiguration) => void;
1010
}
1111

12-
export const EnvironmentCreationForm: React.FC<Props> = props => {
13-
const [name, setName] = useState('');
14-
const [link, setLink] = useState('');
15-
const [token, setToken] = useState('');
12+
export const EnvironmentCreationForm: React.FC<Props> = (props) => {
13+
const [name, setName] = useState("");
14+
const [link, setLink] = useState("");
15+
const [token, setToken] = useState("");
1616

1717
const [linkError, setLinkError] = useState<string>();
1818

@@ -36,7 +36,7 @@ export const EnvironmentCreationForm: React.FC<Props> = props => {
3636
return;
3737
}
3838

39-
setLinkError('Invalid format');
39+
setLinkError("Invalid format");
4040
};
4141

4242
const onTokenDone = () => {

source/hooks/useBoolean.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {useCallback, useState} from 'react';
1+
import { useCallback, useState } from "react";
22

33
export function useBoolean(defaultValue?: boolean) {
44
const [value, setValue] = useState(!!defaultValue);
@@ -12,8 +12,8 @@ export function useBoolean(defaultValue?: boolean) {
1212
}, []);
1313

1414
const toggle = useCallback(() => {
15-
setValue(x => !x);
15+
setValue((x) => !x);
1616
}, []);
1717

18-
return {value, setValue, setTrue, setFalse, toggle};
18+
return { value, setValue, setTrue, setFalse, toggle };
1919
}

source/hooks/usePromise.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {useCallback} from 'react';
2-
import {useBoolean} from './useBoolean.js';
1+
import { useCallback } from "react";
2+
import { useBoolean } from "./useBoolean.js";
33

44
export const usePromise = (): [
55
boolean,

0 commit comments

Comments
 (0)