Skip to content

Commit 5d742a3

Browse files
authored
Merge pull request #9055 from marmelab/create-react-admin-lint
Add eslint, prettier and default vite gitignore to create-react-admin
2 parents 50c1322 + bc2d269 commit 5d742a3

21 files changed

Lines changed: 151 additions & 35 deletions

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ build
33
lib
44
esm
55
prism.js
6+
packages/create-react-admin/templates/**

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*.md
2+
packages/create-react-admin/templates/**

packages/create-react-admin/src/ProjectState.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export type ProjectConfiguration = {
1212
dataProvider: string;
1313
authProvider: string;
1414
resources: string[];
15+
messages: string[];
1516
installer: string;
1617
};
1718

@@ -21,5 +22,6 @@ export const InitialProjectConfiguration: ProjectConfiguration = {
2122
dataProvider: '',
2223
authProvider: '',
2324
resources: [],
25+
messages: [],
2426
installer: '',
2527
};

packages/create-react-admin/src/SelectInputChoice.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { Text } from 'ink';
3-
import { Stack } from './Stack.js';
3+
import { Stack } from './Stack';
44

55
export type ChoiceType = {
66
label: string;

packages/create-react-admin/src/StepAuthProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as React from 'react';
22
import { Text } from 'ink';
33
import SelectInput from 'ink-select-input';
4-
import { ChoiceType, SelectInputChoice } from './SelectInputChoice.js';
5-
import { Stack } from './Stack.js';
4+
import { ChoiceType, SelectInputChoice } from './SelectInputChoice';
5+
import { Stack } from './Stack';
66

77
const SupportedAuthProviders: ChoiceType[] = [
88
{

packages/create-react-admin/src/StepDataProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as React from 'react';
22
import { Text } from 'ink';
33
import SelectInput from 'ink-select-input';
4-
import { ChoiceType, SelectInputChoice } from './SelectInputChoice.js';
5-
import { Stack } from './Stack.js';
4+
import { ChoiceType, SelectInputChoice } from './SelectInputChoice';
5+
import { Stack } from './Stack';
66

77
const SupportedDataProviders: ChoiceType[] = [
88
{
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React, { useEffect } from 'react';
2+
import { Text } from 'ink';
3+
import { generateProject } from './generateProject';
4+
import { ProjectConfiguration } from './ProjectState';
5+
6+
export const StepGenerate = ({
7+
config,
8+
onCompleted,
9+
}: {
10+
config: ProjectConfiguration;
11+
onCompleted: (value: any) => void;
12+
}) => {
13+
useEffect(() => {
14+
generateProject(config).then(messages => onCompleted({ messages }));
15+
// Disabled as we want to run this only once
16+
// eslint-disable-next-line react-hooks/exhaustive-deps
17+
}, []);
18+
19+
return <Text>Generating your application...</Text>;
20+
};

packages/create-react-admin/src/StepInstall.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as React from 'react';
2-
import SelectInput from 'ink-select-input';
3-
import { ChoiceType, SelectInputChoice } from './SelectInputChoice.js';
42
import { Text } from 'ink';
5-
import { Stack } from './Stack.js';
3+
import SelectInput from 'ink-select-input';
4+
import { ChoiceType, SelectInputChoice } from './SelectInputChoice';
5+
import { Stack } from './Stack';
66

77
const choices: ChoiceType[] = [
88
{

packages/create-react-admin/src/StepName.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import { useState } from 'react';
33
import TextInput from 'ink-text-input';
44
import { Text } from 'ink';
5-
import { Stack } from './Stack.js';
5+
import { Stack } from './Stack';
66

77
export const StepName = ({
88
onSubmit,

packages/create-react-admin/src/StepResources.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import { useState } from 'react';
33
import TextInput from 'ink-text-input';
44
import { Text } from 'ink';
5-
import { Stack } from './Stack.js';
5+
import { Stack } from './Stack';
66

77
export const StepResources = ({
88
onSubmit,

0 commit comments

Comments
 (0)