@common-stack/generate-plugin 6.0.6-alpha.6 → 6.0.6-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/lib/generators/add-frontend/generator.cjs +1 -1
  3. package/lib/generators/add-frontend/generator.cjs.map +1 -1
  4. package/lib/generators/add-frontend/generator.mjs +1 -1
  5. package/lib/generators/add-frontend/generator.mjs.map +1 -1
  6. package/lib/generators/add-frontend/templates/package.json +3 -2
  7. package/lib/generators/add-fullstack/files/package.json +3 -3
  8. package/package.json +2 -2
  9. package/src/generators/add-frontend/generator.ts +2 -1
  10. package/src/generators/add-fullstack/files/package.json +3 -3
  11. package/lib/generators/add-fullstack/files/docs/Moleculer.md +0 -10
  12. package/lib/generators/add-fullstack/files/docs/References.md +0 -13
  13. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/Adding_New_Modules.md +0 -84
  14. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/Desktop_Setup.md +0 -12
  15. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/DoAndDont.md +0 -35
  16. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/GitHooks.md +0 -3
  17. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/HowToContribute.md +0 -14
  18. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/How_to_Run_Various_Options.md +0 -95
  19. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/Known_Issues.md +0 -19
  20. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/Lint_And_Formatter.md +0 -9
  21. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/Project_Setup.md +0 -159
  22. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/Dynamically_Render_Components.md +0 -57
  23. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/HOC_With_Render_Props.md +0 -87
  24. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/Mongoose_Connection.md +0 -45
  25. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/React_Componet_Extensions.md +0 -11
  26. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/RxJS_notes.md +0 -3
  27. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/Styles_With_Type.md +0 -52
  28. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/Tutorials.md +0 -12
  29. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/faq.md +0 -17
  30. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/installation_issues.md +0 -9
  31. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/lerna-build-tools.md +0 -504
  32. package/lib/generators/add-fullstack/files/docs/development/CodeContribution/lerna-yarn-workspaces.md +0 -82
  33. package/lib/generators/add-fullstack/files/docs/development/Database/mongodb-test.md +0 -6
  34. package/lib/generators/add-fullstack/files/docs/development/Deployment/How_To_Setup_Jenkins.md +0 -60
  35. package/lib/generators/add-fullstack/files/docs/development/Deployment/JenkinsDeployment.md +0 -16
  36. package/lib/generators/add-fullstack/files/docs/development/Expo/expo-commands.md +0 -5
  37. package/lib/generators/add-fullstack/files/docs/development/Mobile/How_To_Make_Expo_Wrok_With_Monorepos.md +0 -9
  38. package/lib/generators/add-fullstack/files/docs/development/Mobile/React-Native-FAQ.md +0 -4
  39. package/lib/generators/add-fullstack/files/docs/development/Mobile/Run_mobile.md +0 -9
  40. package/src/generators/add-fullstack/files/docs/Moleculer.md +0 -10
  41. package/src/generators/add-fullstack/files/docs/References.md +0 -13
  42. package/src/generators/add-fullstack/files/docs/development/CodeContribution/Adding_New_Modules.md +0 -84
  43. package/src/generators/add-fullstack/files/docs/development/CodeContribution/Desktop_Setup.md +0 -12
  44. package/src/generators/add-fullstack/files/docs/development/CodeContribution/DoAndDont.md +0 -35
  45. package/src/generators/add-fullstack/files/docs/development/CodeContribution/GitHooks.md +0 -3
  46. package/src/generators/add-fullstack/files/docs/development/CodeContribution/HowToContribute.md +0 -14
  47. package/src/generators/add-fullstack/files/docs/development/CodeContribution/How_to_Run_Various_Options.md +0 -95
  48. package/src/generators/add-fullstack/files/docs/development/CodeContribution/Known_Issues.md +0 -19
  49. package/src/generators/add-fullstack/files/docs/development/CodeContribution/Lint_And_Formatter.md +0 -9
  50. package/src/generators/add-fullstack/files/docs/development/CodeContribution/Project_Setup.md +0 -159
  51. package/src/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/Dynamically_Render_Components.md +0 -57
  52. package/src/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/HOC_With_Render_Props.md +0 -87
  53. package/src/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/Mongoose_Connection.md +0 -45
  54. package/src/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/React_Componet_Extensions.md +0 -11
  55. package/src/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/RxJS_notes.md +0 -3
  56. package/src/generators/add-fullstack/files/docs/development/CodeContribution/React-Patterns/Styles_With_Type.md +0 -52
  57. package/src/generators/add-fullstack/files/docs/development/CodeContribution/Tutorials.md +0 -12
  58. package/src/generators/add-fullstack/files/docs/development/CodeContribution/faq.md +0 -17
  59. package/src/generators/add-fullstack/files/docs/development/CodeContribution/installation_issues.md +0 -9
  60. package/src/generators/add-fullstack/files/docs/development/CodeContribution/lerna-build-tools.md +0 -504
  61. package/src/generators/add-fullstack/files/docs/development/CodeContribution/lerna-yarn-workspaces.md +0 -82
  62. package/src/generators/add-fullstack/files/docs/development/Database/mongodb-test.md +0 -6
  63. package/src/generators/add-fullstack/files/docs/development/Deployment/How_To_Setup_Jenkins.md +0 -60
  64. package/src/generators/add-fullstack/files/docs/development/Deployment/JenkinsDeployment.md +0 -16
  65. package/src/generators/add-fullstack/files/docs/development/Expo/expo-commands.md +0 -5
  66. package/src/generators/add-fullstack/files/docs/development/Mobile/How_To_Make_Expo_Wrok_With_Monorepos.md +0 -9
  67. package/src/generators/add-fullstack/files/docs/development/Mobile/React-Native-FAQ.md +0 -4
  68. package/src/generators/add-fullstack/files/docs/development/Mobile/Run_mobile.md +0 -9
@@ -1,159 +0,0 @@
1
- ## Getting Started
2
-
3
- If you want to develop FullStack locally you must follow the following instructions:
4
-
5
- 1. Clone fullstack-pro locally
6
- ```
7
- git clone https://github.com/cdmbase/fullstack-pro
8
- cd fullstack-pro
9
- ```
10
-
11
- 2. Install dependencies and build packages.
12
-
13
- a. make sure `python` version `2.7.16` or higher in `^2` version installed.
14
-
15
- b. install `node-gyp` globally. For installation check [this document](https://github.com/nodejs/node-gyp#installation).
16
-
17
- c. install `watchman` for macOS users
18
-
19
- d. Node version supported is `>=12.18.4` and `yarn` version is `1.22`. You can Download Node from [here](https://nodejs.org/dist/v12.18.4/)
20
-
21
- e. Insall and build packages using following command. Run from the root folder of this project.
22
- ```
23
- yarn global add lerna
24
- yarn bootstrap
25
- ```
26
-
27
- 3. Setup environment file
28
-
29
- You need to have environemnt file before you start the project. There is a sample file exist at `config/development/dev.env.sample` which you can copy as `config/development/dev.env`.
30
-
31
- ```
32
- cp ./config/development/dev.env.sample ./config/development/dev.env
33
- ```
34
-
35
- You may need to set personalized values in the `dev.env` file.
36
-
37
- 4. Start server MongoDB and Redis (look for Installation Section)
38
-
39
- > redis-server
40
-
41
- > mongod
42
-
43
- 5. Start both client and server together
44
- ```
45
- yarn start
46
- ```
47
- Alternatively, if you need to run `backend` and `frontend` on its respective terminal instead of one terminal then follow [How to Start Backend and Frontend seperately](./How_to_Run_Various_Options.md#how-to-start-backend-and-frontend-seperately)
48
-
49
- ### Server Enpoints:
50
- The graphql server endpoints are
51
- >http://localhost:8080/graphql
52
-
53
- The browser server endopoint is
54
- >http://localhost:3000
55
-
56
-
57
- ## How to run with HotReload for live changes both in the server and browser?
58
-
59
- To run build with watch for dependent packages, for auto reloading changes into the server to be productive during development.
60
-
61
- ```
62
- yarn watch-packages
63
- ```
64
-
65
- If you also need to watch along with it, you can use as many scopes as required like below.
66
-
67
- ```
68
- yarn watch-packages -- --scope=@sample-stack/counter-module* --scope=@packageb
69
- ```
70
-
71
- To run build with watch for all the packages. Note: This will run watch on all packages under `packages-modules` and may saturate the resources in your laptop instead run above `watch-packages` command.
72
-
73
- ```
74
- yarn watch
75
- ```
76
-
77
- Sometimes if we have to run `build` or `watch` you can use the `lerna` [command](https://github.com/lerna/lerna/tree/master/commands/exec#usage) for the targeted packages
78
-
79
- ```
80
- lerna exec --scope=<package name> yarn watch
81
- ```
82
-
83
- - here `<package name>` will be the package you working on currently. If you have multiple packages, then you need to run it multiple times for each package in its respective terminal.
84
-
85
- ## How to take changes from the branch?
86
-
87
- Most of the changes at code level can be taken using `git` command.
88
-
89
- But in some cases when `lerna's packages` are added or versions in `packages.json` are updated, to avoid getting installed duplicate pacakges due to monrepo architecture you need to first clean existing `node_modules` and reinstall again. This can be done with following command.
90
-
91
- ```
92
- yarn clean:force && git pull <branch_name> && yarn install && yarn build
93
- ```
94
- - here <branch_name> should be replaced with the branch you getting updates.
95
-
96
- ## Installation of Prerequisties servers
97
-
98
- Install redis and mongo and setup an instance with default settings on default port,
99
- Please check the installation documentation of each one.
100
-
101
- MongoDB install : https://www.mongodb.com/docs/manual/administration/install-community/
102
- Redis install: https://redis.io/docs/getting-started/
103
-
104
-
105
- ## Advance Options
106
- ### To test Production build and run
107
- You need to run Frontend and Backend in two seperate servers.
108
-
109
- to start frontend server
110
- ```
111
- lerna exec --scope=*frontend-server yarn build
112
- lerna exec --scope=*frontend-server yarn start:dev
113
- ```
114
- to start backend server
115
- ```
116
- lerna exec --scope=*backend-server yarn build
117
- lerna exec --scope=*backend-server yarn start:dev
118
- ```
119
-
120
- Note: you can pass `:<env>` next to `start` to use env config.
121
- - dev: to use `/config/development/dev.env`
122
- - stage: to use `/config/staging/staging.env`
123
-
124
-
125
-
126
- ### Docker build and run
127
-
128
- Build three docker images by following the steps:
129
- - Frontend Server
130
- ```
131
- lerna exec --scope=*frontend-server yarn docker:build
132
- lerna exec --scope=*frontend-server yarn docker:run
133
- ```
134
- - Backend Server
135
- ```
136
- lerna exec --scope=*backend-server yarn docker:build
137
- lerna exec --scope=*backend-server yarn docker:run
138
- ```
139
- - moleculer-server
140
- ```
141
- lerna exec --scope=*moleculer-server yarn docker:build
142
- lerna exec --scope=*moleculer-server yarn docker:run
143
- ```
144
-
145
- Note: It uses `/config/staging/staging.env` for environment variables.
146
-
147
- ### Environment settings for non-development
148
- ```
149
- GRAPHQL_URL
150
- CLIENT_URL
151
- NATS_URL
152
- NATS_USER
153
- NATS_PW
154
- ```
155
- ## Troubleshoot
156
- To troubleshoot webpack configuration run
157
- ```
158
- yarn zen:watch:debug
159
- ```
@@ -1,57 +0,0 @@
1
-
2
- Refernce: https://medium.com/@j5bot/react-dynamically-rendering-different-components-without-switch-the-capitalized-reference-e668d89e460b
3
-
4
- ```
5
- import React from 'react'; // required to use JSX
6
-
7
- export const CapitalizedReferenceComponentCollectionExternals = (props) => {
8
-
9
- // get references to all possible components
10
- // that this component might render,
11
- // and the collection of dynamic components we need to render,
12
- // using destructuring
13
- const { components: Components, collection } = props;
14
-
15
- // A Capitalized reference to reuse
16
- let Component;
17
-
18
- // A reference to the component's props to reuse
19
- let componentProps;
20
-
21
- // A function which returns component.props if it exists,
22
- // and otherwise returns props
23
- const defaultMapPropsToComponent = function (
24
- {
25
- component = {},
26
- props = {}
27
- } = {}
28
- ) {
29
-
30
- return component.props || props;
31
-
32
- };
33
-
34
- // render the component collection
35
- return(
36
- <div>{
37
- collection.map(
38
- ( component ) => {
39
- // Reference the proper component
40
- Component = Components[ component.type ];
41
- // Get the props you want to use for this component instance
42
- // here we are assuming that you can specify a mapping function
43
- // on the component definition, in props, or use the default
44
- componentProps = (
45
- component.mapPropsToComponent ||
46
- props.mapPropsToComponent ||
47
- defaultMapPropsToComponent
48
- )( component, props );
49
- return (<Component { ...componentProps } />);
50
- }
51
- )
52
- }</div>
53
- );
54
- };
55
-
56
- export default CapitalizedReferenceComponentCollectionExternals;
57
- ```
@@ -1,87 +0,0 @@
1
- Reference: https://gist.github.com/mjackson/a1bee5a8b24a0db7ff29586b124cfb38
2
- https://www.youtube.com/watch?v=BcVAq3YFiuc&t=1397s
3
- https://cdb.reacttraining.com/use-a-render-prop-50de598f11ce
4
- ```
5
- import React from "react";
6
- import ReactDOM from "react-dom";
7
- import PropTypes from "prop-types";
8
-
9
- document.body.style.background = `
10
- linear-gradient(135deg,
11
- #1e5799 0%,
12
- #2989d8 50%,
13
- #207cca 51%,
14
- #7db9e8 100%
15
- )
16
- `;
17
-
18
- const getHeaderStyle = y => {
19
- const pin = y >= 100;
20
- const top = -y / 2;
21
- return {
22
- textTransform: "uppercase",
23
- textAlign: "center",
24
- width: "100%",
25
- margin: 0,
26
- position: "fixed",
27
- top: pin ? "0px" : `${top + 50}px`,
28
- textShadow: pin
29
- ? `0px ${(y - 100) / 5}px ${Math.min(
30
- (y - 100) / 10,
31
- 20
32
- )}px rgba(0, 0, 0, 0.5)`
33
- : "none"
34
- };
35
- };
36
-
37
- class ScrollY extends React.Component {
38
- state = { y: 0 };
39
-
40
- handleWindowScroll = () => {
41
- this.setState({ y: window.scrollY });
42
- };
43
-
44
- componentDidMount() {
45
- this.handleWindowScroll();
46
- window.addEventListener("scroll", this.handleWindowScroll);
47
- }
48
-
49
- componentWillUnmount() {
50
- window.removeEventListener("scroll", this.handleWindowScroll);
51
- }
52
-
53
- render() {
54
- return this.props.children(this.state.y);
55
- }
56
- }
57
-
58
- class App extends React.Component {
59
- render() {
60
- const { y } = this.props;
61
-
62
- return (
63
- <div style={{ height: "300vh", color: "white" }}>
64
- <h1 style={getHeaderStyle(y)}>{this.props.message}</h1>
65
- </div>
66
- );
67
- }
68
- }
69
-
70
- function withScrollY(Component) {
71
- return class extends React.Component {
72
- render() {
73
- return (
74
- <ScrollY>{y => <Component {...this.props} y={y} />}</ScrollY>
75
- );
76
- }
77
- };
78
- }
79
-
80
- const AppWithScrollY = withScrollY(App);
81
-
82
- ReactDOM.render(
83
- <AppWithScrollY message="hello" />,
84
- document.getElementById("app")
85
- );
86
-
87
- ```
@@ -1,45 +0,0 @@
1
-
2
- Reference:
3
- https://github.com/barakbd/docker_typescript_debug_vscode/blob/8454ab4bdd9713da373e898e7c606193bfbfc5e2/src/config/mongoose_connection.ts
4
-
5
- ```
6
- / https://codingsans.com/blog/mongoose-models-using-typescript-classes
7
- import * as mongoose from "mongoose";
8
- var connectionOptions: mongoose.ConnectionOptions | undefined;
9
-
10
- const uri: string = `mongodb://${process.env.MONGODB_HOST_AND_PORT_LIST}/${
11
- process.env.MONGODB_DATABASE_NAME
12
- }`;
13
-
14
- console.log("uri", uri);
15
- const mongooseConnectionOptions: mongoose.ConnectionOptions = {
16
- autoReconnect: true,
17
- reconnectTries: 3,
18
- keepAlive: 120,
19
- user: process.env.MONGODB_DB_USERNAME,
20
- pass: process.env.MONGODB_DB_PASSWORD,
21
- authSource: process.env.MONGODB_AUTH_SOURCE,
22
- replicaSet: process.env.MONGODB_REPLICASET
23
- };
24
-
25
- process.env.NODE_ENV === "local"
26
- ? (connectionOptions = undefined)
27
- : (connectionOptions = mongooseConnectionOptions);
28
-
29
- console.log("mongoose connectionOptions - ", connectionOptions);
30
-
31
- mongoose
32
- .connect(uri, connectionOptions)
33
- .then(() => {
34
- console.info("mogoose connect - success");
35
- // console.info(`uri - ${uri}`);
36
- // console.info(`connectionOptions - ${connectionOptions}`);
37
- })
38
- .catch((err: mongoose.Error) => {
39
- console.error("mogoose connect - error - ", err);
40
- // throw err;
41
- process.kill(process.pid);
42
- });
43
- const mongooseConnection: mongoose.Connection = mongoose.connection;
44
- export { mongooseConnection };
45
- ```
@@ -1,11 +0,0 @@
1
-
2
-
3
- https://github.com/superdesk/superdesk-client-core/blob/d5ee7b11dddd2255a77b518e177b7ec33b167311/scripts/apps/extension-points/services/ExtensionPoints.js
4
-
5
- https://github.com/taskrabbit/react-component-extension
6
-
7
-
8
-
9
- https://github.com/camwest/react-slot-fill
10
-
11
- Reference: https://www.youtube.com/watch?v=395ou6k6C6k
@@ -1,3 +0,0 @@
1
-
2
-
3
- https://itnext.io/handling-redux-side-effects-the-rxjs-way-59c057b12cd4
@@ -1,52 +0,0 @@
1
-
2
- Sample Style Sheet implementation.
3
-
4
- ```js
5
- import * as CSS from 'csstype';
6
- import { css } from '@emotion/react'
7
-
8
- const DefaultSettingsView = (props: IDefaultSettings) => {
9
-
10
-
11
- return(()=> {
12
- <div className={css(styleSheet.title({title:title}))}>
13
- <span className={css(styleSheet.note({ width: width || 0 }))}>test</span>
14
- </div>
15
- })
16
-
17
- }
18
- const styleSheet: { [key: string]: (x: any) => CSS.Properties } = {
19
- resizable: {
20
- position: 'relative',
21
- '> .react-resizable-handle': {
22
- position: 'absolute',
23
- width: '3px',
24
- height: '100%',
25
- top: 0,
26
- right: 0,
27
- padding: '0 3px 3px 0',
28
- boxSizing: 'border-box',
29
- cursor: 'col-resize',
30
- },
31
- },
32
- title: ({ theme }) => ({
33
- textTransform: 'uppercase',
34
- padding: '5px 0',
35
- fontSize: '11px',
36
- marginLeft: '33px',
37
- color: theme.name === 'light' ? '#424242bd' : '#e7e7e77a',
38
- boxShadow: theme.name === 'light' ? '0px 1px 2px 0px #f3f3f3' : '0px 1px 2px 0px #000000',
39
- marginBottom: '2px',
40
- }),
41
- note: ({ width }) => ({
42
- marginLeft: '33px',
43
- fontSize: '14px',
44
- whiteSpace: 'nowrap',
45
- textOverflow: 'clip',
46
- display: 'block',
47
- maxWidth: width,
48
- overflow: 'hidden',
49
- }),
50
- };
51
-
52
- ```
@@ -1,12 +0,0 @@
1
-
2
-
3
- Typescript Tutorials
4
- ---
5
- https://basarat.gitbooks.io/typescript/
6
- https://medium.com/@martin_hotell/react-children-composition-patterns-with-typescript-56dfc8923c64
7
-
8
-
9
-
10
- Cors:
11
- ---
12
- https://www.blackhillsinfosec.com/cors-lite/
@@ -1,17 +0,0 @@
1
- ---
2
- id: faq-build
3
- title: Babel, JSX, and Build Steps
4
- permalink: docs/faq-build.html
5
- layout: docs
6
- category: FAQ
7
- ---
8
-
9
-
10
- ### From where this `@sample-stack/platform-browser` comes in `packages/sample-platform/browser/src/containers/Counter.tsx`?
11
-
12
- We use [lerna](https://github.com/lerna/lerna) for monorepo. For example all packages starts with `@sample-stack` are either under `packages` or `pacakges-modules` directories.
13
-
14
-
15
- ### What is use of rehydrate?
16
-
17
- It is used for SSR(server side rendering). Server generates initial browser page along with state(redux or apollo-client or css) and that state will be used in the browser to rehydated during browser rendering so the client state don't start from initial values.
@@ -1,9 +0,0 @@
1
-
2
-
3
-
4
- 1. Error when `node-gyp rebuild`.
5
- Could be missing `python`. Install it and rerun the install again.
6
- For more docs, check https://github.com/nodejs/node-gyp#installation
7
-
8
- 2. For Mac User to develop Desktop app need
9
- `xcode-select --install`