Skip to content

Commit 241c4c0

Browse files
authored
Merge pull request #12 from reactplay/Issue-369-Create-play-workflow
Issue 369 create play workflow
2 parents 81b928f + 8bacbb7 commit 241c4c0

24 files changed

Lines changed: 667 additions & 102 deletions

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@reactplay:registry=https://npm.pkg.github.com

README.md

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,51 @@
1-
# React-Play Development Kit
1+
# Create React Play
22

3-
## Prerequisite
4-
1. GitHUb ssh to be configured
3+
## Welcome to `reactplay.io` ecosystem
4+
5+
A package to generate boilerplate files for creating a play withing your local system. Another idea of this package to create a backbone structure for running all sort of maintenance and house keeping task.
6+
7+
## Command Line Options
8+
Here are few options
9+
- -h/help: Show all available arguments and flags
10+
- -c/create: Creates a play boilerplate within local directory structure
11+
- -u/update: Update an exsiting play
12+
- -p/prepare: Prepre an environment for build/run
13+
14+
## How it works
15+
16+
### Example: Create a play
17+
1. Fork [reactplay](https://github.com/reactplay/react-play)
18+
2. Clone your branch
19+
3. Install packages using
20+
```bash
21+
yarn
22+
#or
23+
npm install
24+
```
25+
4. run reactplay application using
26+
```bash
27+
yarn start
28+
#or
29+
npm start
30+
```
31+
5. Hit "Create" button on web portal
32+
6. Provide necessary information
33+
7. Submit your play request
34+
8. It will generate an unique id for you
35+
9. <b>Navigate to root directory of your local reactplay repo and run
36+
```bash
37+
npx create-react-play -c <the_unique_id>
38+
```
39+
This will create necessary resources and link them together.
40+
</b>
41+
10. Now you will find your play under
42+
```
43+
<reactplay_directory>/plays/<your_play_name>
44+
```
45+
11. Now its all with you, create an awesome play and flaunt it infront of the globe
46+
12. Create a pull request when you are done
47+
48+
### Example: Prepare environemnt
49+
```bash
50+
npx create-react-play -p
51+
```

_templates/component_js.tmpl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import PlayHeader from 'common/playlists/PlayHeader';
2+
import './styles.%PLAY_STYLE%';
3+
4+
function %PLAY_TITLE_NAME%(props) {
5+
6+
// Your Code Start below.
7+
8+
return (
9+
<>
10+
<div className="play-details">
11+
<PlayHeader play={props} />
12+
<div className="play-details-body">
13+
{/* Your Code Starts Here */}
14+
<div>
15+
<h1>Play Details - %PLAY_TITLE_STRING%</h1>
16+
<p>
17+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
18+
Pellentesque euismod, urna eu tincidunt consectetur,
19+
nisi nunc ultricies nisi, eget consectetur nunc nisi
20+
euismod nunc.
21+
</p>
22+
</div>
23+
{/* Your Code Ends Here */}
24+
</div>
25+
</div>
26+
</>
27+
);
28+
}
29+
30+
export default %PLAY_TITLE_NAME%;

_templates/component_ts.tmpl

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import React from 'react';
2+
import PlayHeader from 'common/playlists/PlayHeader';
3+
import './styles.{{style}}';
4+
5+
function %PLAY_TITLE_NAME%(props) {
6+
7+
// Your Code Start below.
8+
9+
return (
10+
<>
11+
<div className="play-details">
12+
<PlayHeader play={props} />
13+
<div className="play-details-body">
14+
{/* Your Code Starts Here */}
15+
<div>
16+
<h1>Play Details - %PLAY_TITLE_STRING%</h1>
17+
<p>
18+
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
19+
Pellentesque euismod, urna eu tincidunt consectetur,
20+
nisi nunc ultricies nisi, eget consectetur nunc nisi
21+
euismod nunc.
22+
</p>
23+
</div>
24+
{/* Your Code Ends Here */}
25+
</div>
26+
</div>
27+
</>
28+
);
29+
}
30+
31+
export default %PLAY_TITLE_NAME%;

_templates/readme_md.tmpl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# %PLAY_NAME%
2+
3+
%PLAY_DESCRIPTION%
4+
5+
## Play Demographic
6+
7+
- Language: %PLAY_LANGUAGE%
8+
- Level: %PLAY_LEVEL%
9+
10+
## Creator Information
11+
12+
- User: %PLAY_GITHUB%
13+
- Gihub Link: https://github.com/%PLAY_GITHUB%
14+
- Blog: %PLAY_BLOG%
15+
- Video: %PLAY_VIDEO%
16+
17+
## Implementation Details
18+
19+
Update your implementation idea and details here
20+
21+
## Consideration
22+
23+
Update all considerations(if any)
24+
25+
## Resources
26+
27+
Update external resources(if any)

_templates/styles_css.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* enter stlyes here */

_templates/styles_scss.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* enter stlyes here */

bin/global.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/usr/bin/env node
22

3-
import { log, invoke_process } from "../lib/index.js";
3+
import { invoke_process } from "../lib/index.js";
44
import { CONSOLE_COLORS } from "../util/const.js";
5+
import fs from "fs";
6+
// import * as meta from "";
57

68
// Displays the text in the console
7-
9+
let meta = JSON.parse(fs.readFileSync("package.json", "utf-8"));
810
console.log(
911
CONSOLE_COLORS.FgGreen,
1012
"┌─────────────────────────────────────────────────────────────────────────┐"
@@ -16,13 +18,13 @@ console.log(
1618
" | Welcome to |"
1719
);
1820
console.log(
19-
" | React Play Development Kit |"
21+
` | Create Rect Play (v ${meta.version}) |`
2022
);
2123
console.log(
2224
" | |"
2325
);
2426
console.log(
25-
" | For help hit : rpdk -h/help |"
27+
" | For help hit : create-react-play -h/help |"
2628
);
2729
console.log(
2830
" └─────────────────────────────────────────────────────────────────────────┘"

hooks/basic_hooks.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
1+
import { exec } from "child_process";
2+
import { Log } from "../log/index.js";
3+
14
export const basic_get_package_manager = () => {
2-
console.log("Checking package manager");
5+
Log.log("Checking package manager");
36
return "yarn";
47
};
8+
9+
export const basic_check_shell_connectivity = () => {
10+
Log.log("Checking shell connectivity");
11+
Log.log(process.cwd());
12+
exec(
13+
`sh ${process.cwd()}\\react-play-dev-kit\\scripts\\sample.sh`,
14+
(error, stdout, stderr) => {
15+
if (error) {
16+
Log.log(`error: ${error.message}`);
17+
return;
18+
}
19+
if (stderr) {
20+
Log.log(`stderr: ${stderr}`);
21+
return;
22+
}
23+
Log.log(`stdout: ${stdout}`);
24+
}
25+
);
26+
};

hooks/data_hooks.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
import { loadPlay } from "../lib/services/datasource/index.js";
2+
import { Log } from "../log/index.js";
3+
14
export const data_read_table = (table_name) => {
2-
console.log(`Reading ${table_name} table`);
5+
Log.log(`Reading ${table_name} table`);
6+
};
7+
8+
export const data_read_play_by_id = async (arg) => {
9+
const data = await loadPlay(arg.value);
10+
return data;
311
};

0 commit comments

Comments
 (0)