Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions src/templates/react.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import { Template } from './template';

import basicTemplate from './basic';
import { PackageJson } from 'type-fest';

const reactTemplate: Template = {
name: 'react',
dependencies: [
...basicTemplate.dependencies,
'@types/react',
'@types/react-dom',
'react',
'react-dom',
],
packageJson: {
...basicTemplate.packageJson,
peerDependencies: {
react: '>=16',
},
scripts: {
...basicTemplate.packageJson.scripts,
test: 'tsdx test',
} as PackageJson['scripts'],
},
};

export default reactTemplate;
import { Template } from './template';
import basicTemplate from './basic';
import { PackageJson } from 'type-fest';
const reactTemplate: Template = {
name: 'react',
dependencies: [
...basicTemplate.dependencies,
'@types/react',
'@types/react-dom',
'react',
'react-dom',
],
packageJson: {
...basicTemplate.packageJson,
peerDependencies: {
react: '>=18',
},
scripts: {
...basicTemplate.packageJson.scripts,
test: 'tsdx test',
} as PackageJson['scripts'],
},
};
export default reactTemplate;
28 changes: 14 additions & 14 deletions templates/react/example/index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Playground</title>
</head>

<body>
<div id="root"></div>
<script src="./index.tsx"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Playground</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="./index.tsx"></script>
</body>
</html>
28 changes: 14 additions & 14 deletions templates/react/example/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import 'react-app-polyfill/ie11';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Thing } from '../.';

const App = () => {
return (
<div>
<Thing />
</div>
);
};

ReactDOM.render(<App />, document.getElementById('root'));
import 'react-app-polyfill/ie11';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Thing } from '../src';
const App = () => {
return (
<div>
<Thing />
</div>
);
};
ReactDOM.render(<App />, document.getElementById('root'));
49 changes: 25 additions & 24 deletions templates/react/example/package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
{
"name": "example",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"start": "parcel index.html",
"build": "parcel build index.html"
},
"dependencies": {
"react-app-polyfill": "^1.0.0"
},
"alias": {
"react": "../node_modules/react",
"react-dom": "../node_modules/react-dom/profiling",
"scheduler/tracing": "../node_modules/scheduler/tracing-profiling"
},
"devDependencies": {
"@types/react": "^16.9.11",
"@types/react-dom": "^16.8.4",
"parcel": "^1.12.3",
"typescript": "^3.4.5"
}
}
{
"name": "example",
"version": "1.2.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"start": "parcel index.html",
"build": "parcel build index.html"
},
"dependencies": {
"react": "^18.2.0",
"react-app-polyfill": "^3.0.0",
"react-dom": "^18.2.0"
},
"alias": {
"scheduler/tracing": "../node_modules/scheduler/tracing-profiling"
},
"devDependencies": {
"@types/react": "^18.2.12",
"@types/react-dom": "^18.2.5",
"parcel": "^2.9.2",
"process": "^0.11.10",
"typescript": "^5.1.3"
}
}