Skip to content

Commit 9f64f6e

Browse files
committed
refact: use @/ to import from src/
1 parent ce78ca4 commit 9f64f6e

Some content is hidden

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

72 files changed

+164
-220
lines changed

.prettierrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
...require('@code-expert/prettier-config'),
3-
importOrder: ['<THIRD_PARTY_MODULES>', '^prelude/(.*)$', '^(/|.{0,2}/)', '^.$'],
4-
importOrderSeparation: true,
3+
importOrder: ['<THIRD_PARTY_MODULES>', '^@code-expert/prelude$', '^@/', '^(/|.{0,2}/)', '^.$'],
4+
importOrderSeparation: false,
55
importOrderSortSpecifiers: true,
66
};

src/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const noRestrictedImportsBase = [
2525
},
2626
{
2727
group: ['@fortawesome/**'],
28-
message: "Only import from 'import { Icon } from '/imports/ui/foundation/Icons'",
28+
message: "Only import from 'import { Icon } from '@/ui/foundation/Icons'",
2929
},
3030
];
3131

src/App.stories.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
32
import App from './App';
43

54
export default {

src/App.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { boolean, pipe } from '@code-expert/prelude';
21
import { Result } from 'antd';
32
import React from 'react';
4-
5-
import { GlobalContextProvider } from './ui/GlobalContext';
6-
import Routes from './ui/Routes';
7-
import useNetworkState from './ui/hooks/useNetwork';
8-
import { AppLayout } from './ui/layout';
3+
import { boolean, pipe } from '@code-expert/prelude';
4+
import { GlobalContextProvider } from '@/ui/GlobalContext';
5+
import Routes from '@/ui/Routes';
6+
import useNetworkState from '@/ui/hooks/useNetwork';
7+
import { AppLayout } from '@/ui/layout';
98

109
function App() {
1110
const { online } = useNetworkState();

src/api/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { flow, iots, json, option, pipe, task, taskEither, taskOption } from '@code-expert/prelude';
21
import { invoke } from '@tauri-apps/api';
32
import { getVersion } from '@tauri-apps/api/app';
43
import {
@@ -11,8 +10,8 @@ import {
1110
} from '@tauri-apps/api/fs';
1211
import { dirname } from '@tauri-apps/api/path';
1312
import { Store as TauriStore } from 'tauri-plugin-store-api';
14-
15-
import { Exception, fromError } from '../domain/exception';
13+
import { flow, iots, json, option, pipe, task, taskEither, taskOption } from '@code-expert/prelude';
14+
import { Exception, fromError } from '@/domain/exception';
1615

1716
const store = new TauriStore('settings.json');
1817

src/api/oauth/getAccess.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { iots } from '@code-expert/prelude';
2-
3-
import { ClientId } from '../../domain/ClientId';
4-
import { createAPIRequest } from '../../domain/createAPIRequest';
2+
import { ClientId } from '@/domain/ClientId';
3+
import { createAPIRequest } from '@/domain/createAPIRequest';
54

65
const responseCodec = iots.strict({});
76
export const getAccess = (

src/domain/AuthState.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { pipe, tagged, task, taskEither } from '@code-expert/prelude';
21
import { api } from 'api';
32
import React from 'react';
4-
5-
import { getAccess } from '../api/oauth/getAccess';
6-
import useTimeout from '../ui/hooks/useTimeout';
7-
import { pkceChallenge } from '../utils/crypto';
3+
import { pipe, tagged, task, taskEither } from '@code-expert/prelude';
4+
import { getAccess } from '@/api/oauth/getAccess';
5+
import useTimeout from '@/ui/hooks/useTimeout';
6+
import { pkceChallenge } from '@/utils/crypto';
87
import { ClientId } from './ClientId';
98

109
export type GlobalAuthState = tagged.Tagged<'notAuthorized'> | tagged.Tagged<'authorized'>;

src/domain/AuthToken.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { iots } from '@code-expert/prelude';
2-
3-
import { Base64Url } from '../utils/base64url';
2+
import { Base64Url } from '@/utils/base64url';
43

54
export interface AccessTokenBrand {
65
readonly AccessToken: unique symbol;

src/domain/ClientId.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { iots } from '@code-expert/prelude';
2-
3-
import { Base64Url } from '../utils/base64url';
2+
import { Base64Url } from '@/utils/base64url';
43

54
export interface ClientIdBrand {
65
readonly ClientId: unique symbol;

src/domain/Project.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { iots, tagged } from '@code-expert/prelude';
2-
3-
import { mkEntityIdCodec } from '../utils/identity';
2+
import { mkEntityIdCodec } from '@/utils/identity';
43

54
export const ProjectIdBrand = Symbol('ProjectId');
65
export const ProjectId = mkEntityIdCodec(ProjectIdBrand);

0 commit comments

Comments
 (0)