Skip to content

Commit 500f05a

Browse files
author
Samer Buna
committed
Upgrade and make create the default command
1 parent 11ded11 commit 500f05a

File tree

7 files changed

+124
-155
lines changed

7 files changed

+124
-155
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: samerbuna

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
11
{
22
"name": "reactful",
3-
"version": "3.0.1",
3+
"version": "3.1.3",
44
"description": "An opinionated practical CLI for developing full-stack server-rendered React applications. You can use it to generate an independent React application (optionally with TypeScript) that's fully-configured to render on both client and server. You can also use it to render simple template applications (without SSR).",
55
"repository": "jscomplete/reactful",
66
"author": "Samer Buna <[email protected]>",
77
"license": "MIT",
88
"scripts": {
99
"eslint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
10-
"format": "prettier --write src/ \"*.{ts,tsx,js,json}\"",
11-
"test": "jest",
10+
"format": "prettier --write src/ templates/ \"*.{ts,tsx,js,json}\"",
11+
"test": "jest src/**/*",
1212
"build": "rm -rf lib && tsc --sourceMap false --skipLibCheck true"
1313
},
1414
"bin": {
15-
"reactful": "lib/bin/reactful.js"
15+
"reactful": "lib/bin/reactful.js",
16+
"rr": "lib/bin/reactful.js"
1617
},
1718
"dependencies": {
1819
"commander": "^5.1.0",
1920
"fs-jetpack": "^2.4.0",
2021
"prompt-sync": "^4.2.0"
2122
},
2223
"devDependencies": {
23-
"@types/jest": "^25.2.3",
24-
"@typescript-eslint/eslint-plugin": "^3.2.0",
25-
"@typescript-eslint/parser": "^3.2.0",
24+
"@types/jest": "^26.0.0",
25+
"@typescript-eslint/eslint-plugin": "^3.3.0",
26+
"@typescript-eslint/parser": "^3.3.0",
2627
"eslint": "^7.2.0",
2728
"eslint-plugin-react": "^7.20.0",
2829
"eslint-plugin-react-hooks": "^4.0.4",
2930
"jest": "^26.0.1",
3031
"prettier": "^2.0.5",
3132
"ts-jest": "^26.1.0",
3233
"ts-node": "^8.10.2",
33-
"ts-node-dev": "^1.0.0-pre.44",
34+
"ts-node-dev": "^1.0.0-pre.49",
3435
"typescript": "^3.9.5",
3536
"typesync": "^0.7.0"
3637
}

src/bin/reactful.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ program
3636
}
3737

3838
program
39-
.command('create <app-name>')
39+
.command('create <app-name>', { isDefault: true })
4040
.alias('')
4141
.alias('new')
4242
.description('creata a new reactful project')
@@ -106,9 +106,11 @@ program
106106
.action((port = '1234') => openApp(`http://localhost:${port}`));
107107

108108
program
109-
.command('run <script>', { isDefault: true })
109+
.command('. <script>')
110110
.description('run a script in the current directroy')
111-
.action((script) => runCommand({ useYarn: yarnExists, script }));
111+
.action((script) => {
112+
runCommand({ useYarn: yarnExists, script });
113+
});
112114

113115
await program.parseAsync();
114116
})();

templates/simple/.eslintrc.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
node: true,
5+
commonjs: true,
6+
es2020: true,
7+
},
8+
parserOptions: {
9+
ecmaVersion: 2020,
10+
ecmaFeatures: {
11+
jsx: true,
12+
},
13+
sourceType: 'module',
14+
},
15+
plugins: ['react', 'react-hooks'],
16+
extends: [
17+
'eslint:recommended',
18+
'plugin:react/recommended',
19+
'plugin:react-hooks/recommended',
20+
],
21+
settings: {
22+
react: {
23+
version: 'detect',
24+
},
25+
},
26+
rules: {},
27+
};

templates/simple/src/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import * as React from "react";
2-
import * as ReactDOM from "react-dom";
1+
import * as React from 'react';
2+
import * as ReactDOM from 'react-dom';
33

4-
import { App } from "./components/App";
4+
import { App } from './components/App';
55

6-
import "./styles/index.css";
6+
import './styles/index.css';
77

8-
ReactDOM.render(<App />, document.getElementById("root"));
8+
ReactDOM.render(<App />, document.getElementById('root'));

templates/typescript/package.json

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)