Skip to content

Commit 4f41706

Browse files
committed
Setup yarn workspaces
1 parent 48e62fa commit 4f41706

Some content is hidden

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

51 files changed

+1156
-52
lines changed
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: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "cra-template-wptheme-typescript",
3+
"version": "3.3.0-wp.1",
4+
"keywords": [
5+
"wordpress",
6+
"create-react-app",
7+
"wordpress-theme",
8+
"wordpress-development",
9+
"wordpress-starter-theme",
10+
"wordpress-api",
11+
"reactjs",
12+
"react",
13+
"react-theme",
14+
"wordpress-server",
15+
"react-tutorial",
16+
"react-wordpress-themes",
17+
"php",
18+
"typescript",
19+
"template"
20+
],
21+
"description": "The TypeScript template for Create React WPTheme.",
22+
"main": "template.json",
23+
"repository": {
24+
"type": "git",
25+
"url": "https://github.com/devloco/create-react-wptheme.git"
26+
},
27+
"license": "MIT",
28+
"engines": {
29+
"node": ">=8"
30+
},
31+
"bugs": {
32+
"url": "https://github.com/devloco/create-react-wptheme/issues"
33+
},
34+
"files": [
35+
"template",
36+
"template.json"
37+
]
38+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"dependencies": {
3+
"@testing-library/react": "^9.3.2",
4+
"@testing-library/jest-dom": "^4.2.4",
5+
"@testing-library/user-event": "^7.1.2",
6+
"@types/node": "^12.0.0",
7+
"@types/react": "^16.9.0",
8+
"@types/react-dom": "^16.9.0",
9+
"@types/jest": "^24.0.0",
10+
"typescript": "~3.7.2"
11+
}
12+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
2+
3+
## Available Scripts
4+
5+
In the project directory, you can run:
6+
7+
### `npm start`
8+
9+
Runs the app in the development mode.<br />
10+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
11+
12+
The page will reload if you make edits.<br />
13+
You will also see any lint errors in the console.
14+
15+
### `npm test`
16+
17+
Launches the test runner in the interactive watch mode.<br />
18+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19+
20+
### `npm run build`
21+
22+
Builds the app for production to the `build` folder.<br />
23+
It correctly bundles React in production mode and optimizes the build for the best performance.
24+
25+
The build is minified and the filenames include the hashes.<br />
26+
Your app is ready to be deployed!
27+
28+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
29+
30+
### `npm run eject`
31+
32+
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
33+
34+
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.
35+
36+
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.
37+
38+
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.
39+
40+
## Learn More
41+
42+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
43+
44+
To learn React, check out the [React documentation](https://reactjs.org/).
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
Binary file not shown.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta name="theme-color" content="#000000" />
8+
<meta
9+
name="description"
10+
content="Web site created using create-react-app"
11+
/>
12+
<link rel="apple-touch-icon" href="logo192.png" />
13+
<!--
14+
manifest.json provides metadata used when your web app is installed on a
15+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16+
-->
17+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18+
<!--
19+
Notice the use of %PUBLIC_URL% in the tags above.
20+
It will be replaced with the URL of the `public` folder during the build.
21+
Only files inside the `public` folder can be referenced from the HTML.
22+
23+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24+
work correctly both with client-side routing and a non-root public URL.
25+
Learn how to configure a non-root public URL by running `npm run build`.
26+
-->
27+
<title>React App</title>
28+
</head>
29+
<body>
30+
<noscript>You need to enable JavaScript to run this app.</noscript>
31+
<div id="root"></div>
32+
<!--
33+
This HTML file is a template.
34+
If you open it directly in the browser, you will see an empty page.
35+
36+
You can add webfonts, meta tags, or analytics to this file.
37+
The build step will place the bundled scripts into the <body> tag.
38+
39+
To begin the development, run `npm start` or `yarn start`.
40+
To create a production bundle, use `npm run build` or `yarn build`.
41+
-->
42+
</body>
43+
</html>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
$_reactSrc = realpath(__DIR__) . "/react-src";
3+
$_publicPath = $_reactSrc . "/public";
4+
$_postInstallerPath = $_publicPath . "/post_installer.php";
5+
6+
if (file_exists($_postInstallerPath)) {
7+
// read the package.json file
8+
$packagePath = $_reactSrc . "/package.json";
9+
$json = json_decode(file_get_contents($packagePath), true);
10+
11+
// set the "homepage" correctly in the JSON
12+
// this ensures all WebPack produced links will work
13+
$templatePath = get_template_directory_uri();
14+
$templatePath = parse_url($templatePath, PHP_URL_PATH);
15+
$json["homepage"] = $templatePath;
16+
// set browserLaunchTo to the site's root
17+
$json["browserLaunchTo"] = site_url();
18+
19+
// rewrite the package.json file with the new value for "homepage"
20+
$fp = fopen($packagePath, "w");
21+
fwrite($fp, json_encode($json, JSON_PRETTY_PRINT));
22+
fclose($fp);
23+
24+
// delete the current index.php page (which is this page you are currently reading)
25+
unlink($_publicPath . "/index.php");
26+
// rename the "post_installer.php" to make it the new index.php file
27+
rename($_postInstallerPath, $_publicPath . "/index.php");
28+
}
29+
?>
30+
31+
Now, back in your command prompt, rerun the "start" script again...
32+
33+
<script>
34+
setTimeout(function() {
35+
window.location.replace(window.location);
36+
}, 3000);
37+
</script>
8.38 KB
Loading
22.4 KB
Loading

0 commit comments

Comments
 (0)