Skip to content

Commit 85daefd

Browse files
committed
Remove create react app
1 parent deae493 commit 85daefd

File tree

6 files changed

+1
-264
lines changed

6 files changed

+1
-264
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# jessup
22

3-
> ***"You can't HANDLE the project setup!"*** - `jessup`
3+
> **_"You can't HANDLE the project setup!"_** - `jessup`
44
55
A JavaScript and React project initializer. Supports the following project types:
66

77
- [Node](https://nodejs.org/en/), optionally including [Babel](https://babeljs.io/)
8-
- [Create React App](https://create-react-app.dev/)
98
- React with [Vite](https://vitejs.dev/)
109
- [Docusaurus](https://docusaurus.io/)
1110
- React Native, either via [Expo](https://expo.dev/) or React Native CLI (for info, see the [React Native Environment Setup docs](https://reactnative.dev/docs/environment-setup) and click "React Native CLI Quickstart")

__snapshots__/gitHubActions.spec.js.snap

-84
Original file line numberDiff line numberDiff line change
@@ -104,90 +104,6 @@ jobs:
104104
"
105105
`;
106106

107-
exports[`gitHubActions module getGitHubActionsConfig cra can generate a config with cypress 1`] = `
108-
"name: Test
109-
on:
110-
push:
111-
branches:
112-
- main
113-
pull_request:
114-
types: [opened, synchronize, reopened]
115-
116-
jobs:
117-
test:
118-
name: Test
119-
runs-on: ubuntu-22.04
120-
steps:
121-
- uses: actions/checkout@v3
122-
123-
- name: Get yarn cache directory path
124-
id: yarn-cache-dir-path
125-
run: echo \\"::set-output name=dir::$(yarn cache dir)\\"
126-
127-
- uses: actions/cache@v3
128-
id: yarn-cache
129-
with:
130-
path: \${{ steps.yarn-cache-dir-path.outputs.dir }}
131-
key: \${{ runner.os }}-yarn-\${{ hashFiles('**/yarn.lock') }}
132-
restore-keys: |
133-
\${{ runner.os }}-yarn-
134-
135-
- name: Install Dependencies
136-
run: yarn install --frozen-lockfile
137-
138-
- name: Unit Tests
139-
run: yarn test --watchAll=false
140-
141-
- name: ESLint
142-
run: yarn lint
143-
144-
- name: Cypress Tests
145-
uses: cypress-io/github-action@v4
146-
with:
147-
start: yarn start
148-
wait-on: 'http://localhost:3000'
149-
"
150-
`;
151-
152-
exports[`gitHubActions module getGitHubActionsConfig cra can generate a config without cypress 1`] = `
153-
"name: Test
154-
on:
155-
push:
156-
branches:
157-
- main
158-
pull_request:
159-
types: [opened, synchronize, reopened]
160-
161-
jobs:
162-
test:
163-
name: Test
164-
runs-on: ubuntu-22.04
165-
steps:
166-
- uses: actions/checkout@v3
167-
168-
- name: Get yarn cache directory path
169-
id: yarn-cache-dir-path
170-
run: echo \\"::set-output name=dir::$(yarn cache dir)\\"
171-
172-
- uses: actions/cache@v3
173-
id: yarn-cache
174-
with:
175-
path: \${{ steps.yarn-cache-dir-path.outputs.dir }}
176-
key: \${{ runner.os }}-yarn-\${{ hashFiles('**/yarn.lock') }}
177-
restore-keys: |
178-
\${{ runner.os }}-yarn-
179-
180-
- name: Install Dependencies
181-
run: yarn install --frozen-lockfile
182-
183-
- name: Unit Tests
184-
run: yarn test --watchAll=false
185-
186-
- name: ESLint
187-
run: yarn lint
188-
"
189-
`;
190-
191107
exports[`gitHubActions module getGitHubActionsConfig docusaurus can generate a config with cypress 1`] = `
192108
"name: Test
193109
on:

__snapshots__/readme.spec.js.snap

-59
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,5 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`getReadmeContents cra allows returning a readme with cypress 1`] = `
4-
"# My Project
5-
6-
Describe your project here.
7-
8-
## Requirements
9-
10-
- [Node](https://nodejs.org)
11-
- [Yarn 1.x](https://classic.yarnpkg.com/lang/en/)
12-
13-
## Installation
14-
15-
- Clone the repo
16-
- Run \`yarn install\`
17-
18-
Dependencies are locked with \`yarn.lock\`; please use \`yarn\` rather than \`npm\` for installing.
19-
20-
## Running
21-
22-
- Run \`yarn start\`
23-
24-
## Unit Tests
25-
26-
- Run \`yarn test\`
27-
28-
## E2E Tests
29-
30-
- Run the app
31-
- In another terminal, run \`yarn cypress\`
32-
"
33-
`;
34-
35-
exports[`getReadmeContents cra allows returning a readme without cypress 1`] = `
36-
"# My Project
37-
38-
Describe your project here.
39-
40-
## Requirements
41-
42-
- [Node](https://nodejs.org)
43-
- [Yarn 1.x](https://classic.yarnpkg.com/lang/en/)
44-
45-
## Installation
46-
47-
- Clone the repo
48-
- Run \`yarn install\`
49-
50-
Dependencies are locked with \`yarn.lock\`; please use \`yarn\` rather than \`npm\` for installing.
51-
52-
## Running
53-
54-
- Run \`yarn start\`
55-
56-
## Unit Tests
57-
58-
- Run \`yarn test\`
59-
"
60-
`;
61-
623
exports[`getReadmeContents docusaurus allows returning a readme with cypress 1`] = `
634
"# My Project
645

gitHubActions.spec.js

-16
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,6 @@ describe('gitHubActions module', () => {
1010
return FRAMEWORKS.find(f => f.value === value);
1111
}
1212

13-
describe('cra', () => {
14-
const framework = getFramework('cra');
15-
16-
it('can generate a config without cypress', () => {
17-
expect(
18-
getGitHubActionsConfig({framework: 'cra', cypress: false}, framework)
19-
).toMatchSnapshot();
20-
});
21-
22-
it('can generate a config with cypress', () => {
23-
expect(
24-
getGitHubActionsConfig({framework: 'cra', cypress: true}, framework)
25-
).toMatchSnapshot();
26-
});
27-
});
28-
2913
describe('docusaurus', () => {
3014
const framework = getFramework('doc');
3115

readme.spec.js

-16
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,6 @@ describe('getReadmeContents', () => {
66
return FRAMEWORKS.find(f => f.value === value);
77
}
88

9-
describe('cra', () => {
10-
const framework = getFramework('cra');
11-
12-
it('allows returning a readme without cypress', () => {
13-
expect(
14-
getReadmeContents({framework: 'cra', cypress: false}, framework)
15-
).toMatchSnapshot();
16-
});
17-
18-
it('allows returning a readme with cypress', () => {
19-
expect(
20-
getReadmeContents({framework: 'cra', cypress: true}, framework)
21-
).toMatchSnapshot();
22-
});
23-
});
24-
259
describe('docusaurus', () => {
2610
const framework = getFramework('doc');
2711

script.js

-87
Original file line numberDiff line numberDiff line change
@@ -21,84 +21,6 @@ function frameworkForAnswers(answers) {
2121
return FRAMEWORKS.find(f => f.value === answers.framework);
2222
}
2323

24-
function initializeCra(answers) {
25-
group(
26-
'Initialize project',
27-
() => {
28-
command(`yarn create react-app ${answers.projectName}`);
29-
cd(answers.projectName);
30-
},
31-
{commit: false}
32-
);
33-
34-
group('Prevent package lock', () => {
35-
command('echo "package-lock=false" >> .npmrc');
36-
});
37-
38-
group('Update User Event library', () => {
39-
addNpmPackages({
40-
dev: true,
41-
packages: ['@testing-library/user-event'],
42-
});
43-
});
44-
45-
addCypress(answers);
46-
47-
group('Configure linting and formatting', () => {
48-
addNpmPackages({
49-
dev: true,
50-
packages: [
51-
'eslint-config-prettier',
52-
'eslint-plugin-prettier',
53-
'prettier',
54-
...(answers.cypress ? ['eslint-plugin-cypress'] : []),
55-
],
56-
});
57-
writeFile(
58-
'.eslintrc.js',
59-
dedent`
60-
module.exports = {
61-
extends: ['react-app', 'prettier'],
62-
plugins: [
63-
'prettier',
64-
${includeIf(answers.cypress, "'cypress',")}
65-
],
66-
${includeIf(answers.cypress, "env: {'cypress/globals': true},")}
67-
rules: {
68-
'import/order': ['warn', {alphabetize: {order: 'asc'}}], // group and then alphabetize lines - https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
69-
'no-duplicate-imports': 'error',
70-
'prettier/prettier': 'warn',
71-
quotes: ['error', 'single', {avoidEscape: true}], // single quote unless using interpolation
72-
'sort-imports': [
73-
'warn',
74-
{ignoreDeclarationSort: true, ignoreMemberSort: false},
75-
], // alphabetize named imports - https://eslint.org/docs/rules/sort-imports
76-
},
77-
overrides: [
78-
{
79-
files: ['src/**/*.spec.js'],
80-
extends: ['react-app/jest'],
81-
},
82-
],
83-
};
84-
`
85-
);
86-
writePrettierConfig();
87-
setScript('lint', 'eslint .');
88-
setScript('start', 'EXTEND_ESLINT=true react-scripts start');
89-
setScript('build', 'EXTEND_ESLINT=true react-scripts build');
90-
setScript('test', 'EXTEND_ESLINT=true react-scripts test');
91-
});
92-
93-
writeReadme(answers);
94-
95-
group('Autoformat files', () => {
96-
command('yarn lint --fix');
97-
});
98-
99-
writeGitHubActionsConfig(answers);
100-
}
101-
10224
function initializeDocusaurus(answers) {
10325
group('Initialize project', () => {
10426
command(
@@ -1344,15 +1266,6 @@ function writeSampleReactNativeFiles(answers) {
13441266
}
13451267

13461268
const FRAMEWORKS = [
1347-
{
1348-
value: 'cra',
1349-
name: 'Create React App',
1350-
alwaysIncludeUnitTesting: true,
1351-
skipUnitTestingQuestion: true,
1352-
cypressAvailable: true,
1353-
devServerPort: 3000,
1354-
initializer: initializeCra,
1355-
},
13561269
{
13571270
value: 'doc',
13581271
name: 'Docusaurus',

0 commit comments

Comments
 (0)