Skip to content

Commit 5a35047

Browse files
Merge pull request #70 from vinaysharma14/development
Development
2 parents 08c25cb + 0458a1c commit 5a35047

File tree

8 files changed

+63
-20
lines changed

8 files changed

+63
-20
lines changed

ROADMAP.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
11
# Road Map :construction:
22

3-
It's great to see you interested in what **Rapid React** holds for the future! You are always welcome for your inputs on the road map. Below is the curated list of upcoming changes lined up:
3+
It's great to see you interested in what **Rapid React** holds for the future! You are always welcome to pitch in your ideas on the road map. Below is the curated list of upcoming changes lined up:
44

5-
### New Features
5+
## New Features
66

7-
- There would be a dedicated prompt to choose from and scaffold commonly used design libraries:
7+
- A dedicated setup to choose from and setup popular design libraries:
88

99
- [Reactstrap](https://reactstrap.github.io/)
1010
- [React Bootstrap](https://react-bootstrap.github.io/)
1111
- [Ant Design](https://ant.design/)
12+
- [Styled Components](https://styled-components.com/)
1213
- [Material UI](https://material-ui.com/)
1314
- [Tailwind CSS](https://tailwindcss.com/)
1415
- [Chakra UI](https://chakra-ui.com/)
1516

16-
### Minor changes:
17+
- Support for Internationalization with
1718

18-
- Invalid names would be logged if entered for any of these: `Route`, `Folder`, `Reducer`, `MobX Store`, `Dependency`, `Dev Dependency`, etc.
19+
- [React Intl](https://formatjs.io/docs/react-intl/)
20+
- [React i8n Next](https://react.i18next.com/)
21+
22+
- Setting up [Husky Git Hooks](https://typicode.github.io/husky/#/) with [Lint Staged](https://www.npmjs.com/package/lint-staged).
23+
24+
- Setting up [ESLint](https://eslint.org/) with commonly used configs and plugins such as:
25+
26+
- [eslint-config-airbnb-typescript](https://www.npmjs.com/package/eslint-config-airbnb-typescript)
27+
- [eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import)
28+
- [eslint-plugin-jsx-a11y](https://www.npmjs.com/package/eslint-plugin-jsx-a11y)
29+
- [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react)
30+
- [eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks)
31+
32+
- Setting up [code splitting](https://reactjs.org/docs/code-splitting.html) with Lazy Loading and suspense.
33+
34+
- Support for [dockerizing](https://www.docker.com/) the app.
35+
36+
### Minor changes
37+
38+
- Logging invalid names entered for any of these: `Route`, `Folder`, `Reducer`, `MobX Store`, `Dependency`, `Dev Dependency`, etc.

docs/images/greetings.png

118 KB
Loading

docs/images/intro.gif

34.6 KB
Loading

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "rapid-react",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "A light weight interactive CLI Automation Tool 🛠️ for rapid scaffolding of React apps with Create React App under the hood. ⚛️",
55
"main": "lib/index.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
88
"lint": "npx eslint --fix 'src/**/*.ts'",
9-
"start": "npx nodemon --no-stdin --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts",
9+
"start": "npx nodemon --no-stdin --watch 'src/**/*.ts' --exec npx ts-node src/index.ts",
1010
"prebuild": "rm -rf lib",
1111
"build": "tsc -p . && npx ts-node src/scripts/minify.ts && npx ncp src/assets lib/assets && npm pack --dry-run"
1212
},

src/index.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,28 @@ import {
1515
generateScaffoldConfig,
1616
} from './scripts';
1717

18+
const { version } = require('../package.json');
19+
1820
const init = async () => {
1921
const {
22+
thanks,
2023
welcome,
21-
walkThrough,
2224
complete,
23-
thanks,
2425
raiseIssue,
26+
walkThrough,
2527
} = messages;
2628

2729
const asciiArt = figlet.textSync(name, { font: 'ANSI Shadow' });
2830

2931
// greetings
3032
console.log(`\n${chalk.cyan(asciiArt)}`);
33+
console.log(chalk.green(`(v${version})\n`));
3134

3235
await checkUpdate();
3336

3437
console.log(`${welcome}\n`);
35-
features.forEach((value, index) => console.log(`${chalk.green('✔')} ${value} ${index === features.length - 1 ? '\n' : ''}`));
36-
console.log(`${chalk.cyan(walkThrough)}\n`);
38+
features.forEach(value => console.log(`${chalk.green('✔')} ${value}`));
39+
console.log(`\n${chalk.cyan(walkThrough)}\n`);
3740

3841
try {
3942
// ask user for app information via an interactive setup
@@ -105,7 +108,7 @@ const init = async () => {
105108
console.log(`\n${complete} ${chalk.green(directory)}\n`);
106109
console.log(thanks);
107110
console.log(`${raiseIssue}\n`);
108-
notify();
111+
await notify();
109112
} catch (error) {
110113
console.error(error.message);
111114
}

src/scripts/folder.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ const flattenScaffoldConfig = (
2424
if (isFile && typeof children === 'string') {
2525
// maintain all files in an array with path & data
2626
files.push({ path, data: children });
27-
}
28-
else {
27+
} else {
2928
// maintain all directories with path
3029
directories.push({ path });
3130
}

src/scripts/notify.ts

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
1+
import os from 'os';
2+
import { exec } from 'child_process';
3+
14
const player = require('play-sound')();
5+
const asyncExec = require('util').promisify(exec);
6+
7+
export const notify = async() => {
8+
const assetPath = __dirname.replace('scripts', 'assets/notification.mp3');
9+
10+
if (os.platform() === 'win32') {
11+
// handle audio playback on windows machine explicitly
12+
// code reference has been taken from https://github.com/nomadhoc/sound-play
13+
14+
const command = 'powershell -c';
15+
const playAudio = '$player.Play();';
16+
const setVolume = '$player.Volume = 1;';
17+
const loadAudioFile = `$player.open('${assetPath}');`;
18+
const addPresentationCore = 'Add-Type -AssemblyName presentationCore;';
19+
const createMediaPlayer = '$player = New-Object system.windows.media.mediaplayer;';
20+
const stopAudio = 'Start-Sleep 1; Start-Sleep -s $player.NaturalDuration.TimeSpan.TotalSeconds;Exit;';
221

3-
export const notify = () => {
4-
player.play(`${__dirname.replace('scripts', 'assets/notification.mp3')}`, function(error: string) {
5-
error && console.error(error);
6-
});
22+
await asyncExec( `${command} ${addPresentationCore} ${createMediaPlayer} ${loadAudioFile} ${setVolume} ${playAudio} ${stopAudio}`);
23+
} else {
24+
player.play(assetPath, function(error: string) {
25+
error && console.error(error);
26+
});
27+
}
728
};

0 commit comments

Comments
 (0)