Skip to content

Commit aae0ea3

Browse files
fix: React scaffolding is broken because of create-react-app (#914)
1 parent 59f1324 commit aae0ea3

File tree

210 files changed

+745
-18
lines changed

Some content is hidden

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

210 files changed

+745
-18
lines changed

.github/workflows/applications.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
steps:
3838

3939
- name: Get sources
40-
uses: actions/checkout@v3
40+
uses: actions/checkout@v4
4141

4242
- name: Run npm install
4343
env:
@@ -74,23 +74,36 @@ jobs:
7474

7575
- name: Archive artifacts
7676
if: ${{ failure() }}
77-
uses: actions/upload-artifact@v3
77+
uses: actions/upload-artifact@v4
7878
with:
79-
name: artifacts
79+
name: app-tests-artifacts-${{ matrix.APPROACH }}-${{ matrix.NODE }}-${{ matrix.OS }}
8080
path: |
8181
test-results.xml
8282
packages/devextreme-cli/testing/__tests__/__diff_snapshots__
8383
packages/devextreme-cli/testing/sandbox/logs
8484
85+
merge-artifacts:
86+
runs-on: ubuntu-latest
87+
needs: application-test
88+
if: ${{ failure() && !cancelled() }}
89+
steps:
90+
- name: Merge Artifacts
91+
uses: actions/upload-artifact/merge@v4
92+
continue-on-error: true
93+
with:
94+
name: artifacts
95+
pattern: app-tests-artifacts-*
96+
delete-merged: true
97+
8598
schematics-test:
8699
runs-on: ubuntu-latest
87100
steps:
88101

89102
- name: Get sources
90-
uses: actions/checkout@v3
103+
uses: actions/checkout@v4
91104

92105
- name: Set up Node.js and restore cache
93-
uses: actions/setup-node@v3
106+
uses: actions/setup-node@v4
94107
with:
95108
node-version: 18
96109
cache: 'npm'

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
steps:
3838
- name: Checkout repository
39-
uses: actions/checkout@v3
39+
uses: actions/checkout@v4
4040

4141
# Initializes the CodeQL tools for scanning.
4242
- name: Initialize CodeQL

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
steps:
1515

1616
- name: Get sources
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
1818

1919
- name: Use Node.js
20-
uses: actions/setup-node@v3
20+
uses: actions/setup-node@v4
2121
with:
2222
node-version: '18'
2323

.github/workflows/themebuilder.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ jobs:
1616
steps:
1717

1818
- name: Get sources
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020

2121
- name: Use Node.js
22-
uses: actions/setup-node@v3
22+
uses: actions/setup-node@v4
2323
with:
2424
node-version: ${{ matrix.NODE }}
2525

2626
- name: Restore npm cache
27-
uses: actions/cache@v3
27+
uses: actions/cache@v4
2828
with:
2929
path: ~/.npm
3030
key: themebuilder-${{ runner.os }}-node-${{ matrix.NODE }}-${{ hashFiles('**/package-lock.json') }}

packages/devextreme-cli/src/applications/application.react.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ const create = async(appName, options) => {
6363
const toolingVersion = extractToolingVersion(options);
6464
const commandArguments = [`-p=create-react-app${toolingVersion}`, 'create-react-app', appName];
6565

66-
if(templateOptions.isTypeScript) {
67-
commandArguments.push('--template typescript');
68-
}
66+
const templateSuffix = templateOptions.isTypeScript ? '-typescript' : '';
67+
const templatePath = path.resolve(__dirname, `../templates/cra-template${templateSuffix}`);
68+
69+
commandArguments.push(`--template file:${templatePath}`);
6970

7071
await runCommand('npx', commandArguments);
7172

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2013-present, Facebook, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# cra-template-typescript
2+
3+
This is the official TypeScript template for [Create React App](https://github.com/facebook/create-react-app).
4+
5+
To use this template, add `--template typescript` when creating a new app.
6+
7+
For example:
8+
9+
```sh
10+
npx create-react-app my-app --template typescript
11+
12+
# or
13+
14+
yarn create react-app my-app --template typescript
15+
```
16+
17+
For more information, please refer to:
18+
19+
- [Getting Started](https://create-react-app.dev/docs/getting-started) – How to create a new app.
20+
- [User Guide](https://create-react-app.dev) – How to develop apps bootstrapped with Create React App.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "cra-template-typescript",
3+
"version": "1.2.0",
4+
"keywords": [
5+
"react",
6+
"create-react-app",
7+
"template",
8+
"typescript"
9+
],
10+
"description": "The base TypeScript template for Create React App.",
11+
"repository": {
12+
"type": "git",
13+
"url": "https://github.com/facebook/create-react-app.git",
14+
"directory": "packages/cra-template-typescript"
15+
},
16+
"license": "MIT",
17+
"engines": {
18+
"node": ">=14"
19+
},
20+
"bugs": {
21+
"url": "https://github.com/facebook/create-react-app/issues"
22+
},
23+
"files": [
24+
"template",
25+
"template.json"
26+
]
27+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"package": {
3+
"dependencies": {
4+
"@testing-library/jest-dom": "^6.6.3",
5+
"@testing-library/react": "^16.2.0",
6+
"@testing-library/dom": "^10.4.0",
7+
"@testing-library/user-event": "^14.6.0",
8+
"@types/jest": "^29.5.14",
9+
"@types/node": "^22.0.0",
10+
"@types/react": "^19.0.0",
11+
"@types/react-dom": "^19.0.0",
12+
"typescript": "^4.0.0",
13+
"web-vitals": "^4.2.4"
14+
},
15+
"eslintConfig": {
16+
"extends": ["react-app", "react-app/jest"]
17+
}
18+
}
19+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Getting Started with Create React App
2+
3+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4+
5+
## Available Scripts
6+
7+
In the project directory, you can run:
8+
9+
### `npm start`
10+
11+
Runs the app in the development mode.\
12+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13+
14+
The page will reload if you make edits.\
15+
You will also see any lint errors in the console.
16+
17+
### `npm test`
18+
19+
Launches the test runner in the interactive watch mode.\
20+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21+
22+
### `npm run build`
23+
24+
Builds the app for production to the `build` folder.\
25+
It correctly bundles React in production mode and optimizes the build for the best performance.
26+
27+
The build is minified and the filenames include the hashes.\
28+
Your app is ready to be deployed!
29+
30+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31+
32+
### `npm run eject`
33+
34+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35+
36+
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37+
38+
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39+
40+
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41+
42+
## Learn More
43+
44+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45+
46+
To learn React, check out the [React documentation](https://reactjs.org/).

0 commit comments

Comments
 (0)