cdebase / fullstack-pro Goto Github PK
View Code? Open in Web Editor NEWFull Stack to create independent packages and to run on servers. Uses apollo, typescript, react, redux and more.
License: MIT License
Full Stack to create independent packages and to run on servers. Uses apollo, typescript, react, redux and more.
License: MIT License
Know error: nats-io/nats.js#187
Need to wait until next release.
ERROR in [at-loader] ../../node_modules/nats/index.d.ts:64:22
TS2694: Namespace '"tls"' has no exported member 'TlsOptions'.
Workaround: Ignore it as it won't affect anything except you see those errors.
Getting 2 warning when run : npm install
Warning 1:
npm WARN @sample-stack/[email protected] requires a peer of hemera-joi@>6.x but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of mocha@>=2.4.5 <=5 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^2.0.0 || ^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of nats@>= 0.8.x <= 1.2.x but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-dom@^15.4.2 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react-redux@^4.0.0 || ^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of sinon@1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of webpack@^1.9.11 || ^2 || ^3 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/@graphql-codegen/cli/node_modules/fsevents):
Warning 2:
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
Disabling persistgraphql-webpack-plugin
for now.
{ Error: Command failed: npm run prepublish
(node:84543) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
buffer.js:183
throw new TypeError(kFromErrorMsg);
^
TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
at Function.Buffer.from (buffer.js:183:11)
at writeOut (/Users/veeramarni/Documents/eclipse/workspace/phoneapps/development/projects/fullstack-pro/node_modules/webpack/lib/Compiler.js:279:25)
at asyncLib.forEach (/Users/veeramarni/Documents/eclipse/workspace/phoneapps/development/projects/fullstack-pro/node_modules/webpack/lib/Compiler.js:293:13)
at baseEach (/Users/veeramarni/Documents/eclipse/workspace/phoneapps/development/projects/fullstack-pro/node_modules/neo-async/async.js:2416:9)
at Object.each (/Users/veeramarni/Documents/eclipse/workspace/phoneapps/development/projects/fullstack-pro/node_modules/neo-async/async.js:2843:9)
at emitFiles (/Users/veeramarni/Documents/eclipse/workspace/phoneapps/development/projects/fullstack-pro/node_modules/webpack/lib/Compiler.js:257:13)
at /Users/veeramarni/Documents/eclipse/workspace/phoneapps/development/projects/fullstack-pro/node_modules/mkdirp/index.js:30:20
at FSReqWrap.oncomplete (fs.js:135:15)
Right now persistgraphql
work on generating extracted_queries.json
. Need to find ways to gather all the grahql
and create extracted-queries.json
which is accessible from frontend and backend.
We need to test and make sure all ports are mapped correctly for docker integration test.
1). Docker Run on hemera server
a) able to connect from the container to nats
running on 4222
port on the host.
2). Docker run on backend server
a) able to connect from the container to nats
running on 4222
port on the host.
b) map the container port 8080
to host port 8080
or something available. So we can access for other apps.
8080
exposed by the backend-server
3000
to host port 3000
so we can open the url in the browser.With spinjs": "0.4.159",
we noticing following errors.
> [email protected] watch /Users/full-stack/servers/backend-server
> cross-env NODE_ENV=development ENV_FILE=../../config/development/dev.env spin watch
TypeError: Cannot read property 'parentCompilation' of undefined
at Object.getRootCompiler (/Users/full-stack/node_modules/awesome-typescript-loader/src/instance.ts:71:15)
at compiler (/Users/full-stack/node_modules/awesome-typescript-loader/src/index.ts:40:23)
at Object.loader (/Users/full-stack/node_modules/awesome-typescript-loader/src/index.ts:14:12)
at LOADER_EXECUTION (/Users/full-stack/node_modules/loader-runner/lib/LoaderRunner.js:119:14)
at runSyncOrAsync (/Users/full-stack/node_modules/loader-runner/lib/LoaderRunner.js:120:4)
at iterateNormalLoaders (/Users/full-stack/node_modules/loader-runner/lib/LoaderRunner.js:229:2)
at /Users/full-stack/node_modules/loader-runner/lib/LoaderRunner.js:202:4
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3) 'TypeError: Cannot read property \'parentCompilation\' ofundefined\n at Object.getRootCompiler (/Users/full-stack/node_modules/awesome-typescript-loader/src/instance.ts:71:15)\n at compiler (/Users/full-stack/node_modules/awesome-typescript-loader/src/index.ts:40:23)\n at Object.loader (/Users/full-stack/node_modules/awesome-typescript-loader/src/index.ts:14:12)\n at LOADER_EXECUTION (/Users/full-stack/node_modules/loader-runner/lib/LoaderRunner.js:119:14)\n at runSyncOrAsync (/Users/full-stack/node_modules/loader-runner/lib/LoaderRunner.js:120:4)\n at iterateNormalLoaders (/Users/full-stack/node_modules/loader-runner/lib/LoaderRunner.js:229:2)\n at /Users/full-stack/node_modules/loader-runner/lib/LoaderRunner.js:202:4\n at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)'
server-webpack error Module build failed (from /Users/full-stack/node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 0)
Cannot read property 'parentCompilation' of undefined
at Object.getRootCompiler (/Users/full-stack/node_modules/awesome-typescript-loader/src/instance.ts:71:15)
at compiler (/Users/full-stack/node_modules/awesome-typescript-loader/src/index.ts:40:23)
at Object.loader (/Users/full-stack/node_modules/awesome-typescript-loader/src/index.ts:14:12)
Throw token not found error in better way
currently it throws like this
./token_revoke.sh eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkOWMyMmE2Mi1kNDk3LTQyMWQtYWJhOC0zOWRiYjMxOWQyMmEiLCJzdWIiOiI1OWQ4MDYzZDk0OWQ3NTcxNjI0YWE0MDQiLCJleHAiOjE1MDc5MTA3NTIsImlhdCI6MTUwNzkwNzE1Mn0.Z5rmbWgeumapgvP2Zglg6dKqJA6VBl-9KFxbSwE7SnY
{}Veeras-MacBook-Pro:curl veeramarni$ ./tokeinfo.sh eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkOWMyMmE2Mi1kNDk3LTQyMWQtYWJhOC0zOWRiYjMxOWQyMmEiLCJzdWIiOiI1OWQ4MDYzZDk0OWQ3NTcxNjI0YWE0MDQiLCJleHAiOjE1MDc5MTA3NTIsImlhdCI6MTUwNzkwNzE1Mn0.Z5rmbWgeumapgvP2Zglg6dKqJA6VBl-9KFxbSwE7SnY<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Error: Token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkOWMyMmE2Mi1kNDk3LTQyMWQtYWJhOC0zOWRiYjMxOWQyMmEiLCJzdWIiOiI1OWQ4MDYzZDk0OWQ3NTcxNjI0YWE0MDQiLCJleHAiOjE1MDc5MTA3NTIsImlhdCI6MTUwNzkwNzE1Mn0.Z5rmbWgeumapgvP2Zglg6dKqJA6VBl-9KFxbSwE7SnY not Found or not Valid<br> at ValidateTokenService.<anonymous> (/Users/veeramarni/Documents/eclipse/workspace/phoneapps/development/projects/IDE/identity-stack/servers/packages/identity-server-core/lib/index.js:3128:1)<br> at Generator.next (<anonymous>)<br> at fulfilled (/Users/veeramarni/Documents/eclipse/workspace/phoneapps/development/projects/IDE/identity-stack/servers/packages/identity-server-core/lib/index.js:2995:1)<br> at <anonymous><br> at process._tickCallback (internal/process/next_tick.js:188:7)</pre>
</body>
</html>
Rendering issue
index.cb8d6311f6c52c49f24e.js:9505 Warning: React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:
(client) a-reactid="14">{
"isSaving": false,
(server) a-reactid="14">{
"counter": 85,
"isS
We need to make sure both the SSR and Client Template generate same html.
https://github.com/cdmbase/fullstack-pro/blob/master/servers/frontend-server/src/setup/ssr/html.tsx
https://github.com/cdmbase/fullstack-pro/blob/master/tools/html-plugin-template.ejs
https://github.com/acdlite/recompose (not maintained) and hooks
replaces it.
the following css, need to be injected in SSR html template
https://github.com/cdmbase/fullstack-pro/blob/master/servers/frontend-server/src/index.css
Pass the process.env files such as LOG_LEVEL to the frontend.
Right now errors referred to index.js
instead of specific file.
[02:48:20.922Z] ERROR fullstack-server: Cannot read property 'compareHash' of undefined
TypeError: Cannot read property 'compareHash' of undefined
at VersioningHasher.<anonymous> (/Users/veeramarni/Documents/eclipse/workspace/phoneapps/development/projects/IDE/identity-stack/servers/packages/identity-server-core/lib/index.js:290:1)
at next (native)
Waiting for new release as mentioned in
webpack-contrib/uglifyjs-webpack-plugin#228
"uglify-es": "3.3.9",
"uglifyjs-webpack-plugin": "1.1.8",
We want to create as many examples from all the packages we use in our stack… it is becoming difficult to troubleshoot which of the latest packages was causing an issue. So we want to write examples shown by that package in our project.
Here, you see connectedReactRouter’s counter example, to check whether it is working as expected we navigate through the menu and we should have the webpage redirect to that location. Then we can do counter test to make sure latest connected-react-router is working fine.
similarly, we will add more counter
examples for other packages such as apollo/epics/redux/react-redux, etc.
DefinitelyTyped/DefinitelyTyped#15960
"types": [
"mathjs",
"react",
"react-native",
"react-native-drawer",
"react-native-orientation",
"react-navigation",
"jest"
],
This eliminates the conflict even though node.d.ts is in node_modules @types.
To replicate the issue just run npm run test
from root
folder.
● redux integration › updates child props on state change
expect(received).toEqual(expected)
Expected value to equal:
{"people": [{"name": "Leia Skywalker"}]}
Received:
{"people": [{"name": "Leia Skywalker", Symbol(id): "$ROOT_QUERY.allPeople({\"first\":2}).people.0"}], Symbol(i
d): "$ROOT_QUERY.allPeople({\"first\":2})"}
Difference:
- Expected
+ Received
Object {
"people": Array [
Object {
"name": "Leia Skywalker",
+ Symbol(id): "$ROOT_QUERY.allPeople({\"first\":2}).people.0",
},
],
+ Symbol(id): "$ROOT_QUERY.allPeople({\"first\":2})",
}
at Component.componentWillReceiveProps (packages/sample-client-react/src/containers/__tests__/redux.test.tsx:65:54)
at node_modules/react-test-renderer/lib/ReactCompositeComponent.js:610:23
at measureLifeCyclePerf (node_modules/react-test-renderer/lib/ReactCompositeComponent.js:75:12)
at ReactCompositeComponentWrapper.updateComponent (node_modules/react-test-renderer/lib/ReactCompositeComponent.js:609:9)
at ReactCompositeComponentWrapper.receiveComponent (node_modules/react-test-renderer/lib/ReactCompositeComponent.js:546:10)
at Object.receiveComponent (node_modules/react-test-renderer/lib/ReactReconciler.js:124:22)
at ReactCompositeComponentWrapper._updateRenderedComponent (node_modules/react-test-renderer/lib/ReactCompositeComponent.js:753:23)
at ReactCompositeComponentWrapper._performComponentUpdate (node_modules/react-test-renderer/lib/ReactCompositeComponent.js:723:10)
at ReactCompositeComponentWrapper.updateComponent (node_modules/react-test-renderer/lib/ReactCompositeComponent.js:644:12)
at ReactCompositeComponentWrapper.receiveComponent (node_modules/react-test-renderer/lib/ReactCompositeComponent.js:546:10)
If a package depends on another package, which could lead to multiple copies of interdependencies between packages which causes to run different instances and make the test fail.
For now the workaround is to delete packages in node modules.
The following warnings are seen after adding
https://github.com/cdmbase/fullstack-pro/blob/master/servers/frontend-server/.spinrc.js#L71
Failed to load ./.env.
Failed to load ./.env.
Failed to load ./.env.
Perform initial setup with spin
Will wait until this resolves.
apollographql/subscriptions-transport-ws#201
$ npm install -f && npm run build
npm WARN using --force I sure hope you know what you are doing.
npm WARN The package @fullstack-pro/server-core is included as both a dev and production dependency.
npm ERR! path /Users/mycomputer/fullstack-pro/node_modules/.staging/frontend-server-f1e8c89e/node_modules/@workbench-stack/client-core
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/mycomputer/fullstack-pro/node_modules/.staging/frontend-server-f1e8c89e/node_modules/@workbench-stack/client-core' -> '/Users/mycomputer/fullstack-pro/node_modules/.staging/@package-stack/client-core-22f97ec8'
npm ERR! enoent This is related to npm not being able to find a file.
Remove package-lock.json
Setup:
github-todos config repo cdmbase/fullstack-pro
Make sure you have string " TODO " in the files to create as issues.
getting undefined
cors origin when the frontend connects to backend in kubernetes env. Temporary disabled on both env.
Add
"prepublish": "git checkout publish && git merge -s recursive -X theirs master",
"publish": "lerna publish",
"postpublish": "git checkout master",
"publish:force": "npm run publish -- --force-publish=*",
Seeing some significant errors withs @typescript 1.4. We will continue with version 1.3 until we know exactly the issue is.
[at-loader] Checking finished with 6 errors
[at-loader] ./node_modules/graphql-subscriptions/dist/pubsub-engine.d.ts:5:52
TS2304: Cannot find name 'AsyncIterator'.
[at-loader] ./node_modules/graphql-subscriptions/dist/pubsub.d.ts:12:52
TS2304: Cannot find name 'AsyncIterator'.
[at-loader] ./node_modules/graphql-subscriptions/dist/with-filter.d.ts:2:94
TS2304: Cannot find name 'AsyncIterator'.
[at-loader] ./node_modules/graphql-subscriptions/dist/with-filter.d.ts:3:58
TS2304: Cannot find name 'AsyncIterator'.
[at-loader] ./node_modules/rxjs/Subject.d.ts:16:22
TS2415: Class 'Subject<T>' incorrectly extends base class 'Observable<T>'.
Types of property 'lift' are incompatible.
Type '<R>(operator: Operator<T, R>) => Observable<T>' is not assignable to type '<R>(operator: Operator<T, R>) => Observable<R>'.
Type 'Observable<T>' is not assignable to type 'Observable<R>'.
Type 'T' is not assignable to type 'R'.
[at-loader] ./node_modules/rxjs/observable/dom/WebSocketSubject.d.ts:24:22
TS2415: Class 'WebSocketSubject<T>' incorrectly extends base class 'AnonymousSubject<T>'.
Types of property 'lift' are incompatible.
Type '<R>(operator: Operator<T, R>) => WebSocketSubject<R>' is not assignable to type '<R>(operator: Operator<T, R>) => Observable<T>'.
Type 'WebSocketSubject<R>' is not assignable to type 'Observable<T>'.
Types of property 'operator' are incompatible.
Type 'Operator<any, R>' is not assignable to type 'Operator<any, T>'.
Type 'R' is not assignable to type 'T'.
[at-loader] ./servers/frontend-server/src/index.tsx:68:19
TS2345: Argument of type '{ apollo: (state: Store, action: ApolloAction) => Store; "@sample/counter": (state: { value: numb...' is not assignable to parameter of type 'ReducersMapObject'.
Property 'apollo' is incompatible with index signature.
Type '(state: Store, action: ApolloAction) => Store' is not assignable to type 'Reducer<any>'.
Types of parameters 'action' and 'action' are incompatible.
Type 'A' is not assignable to type 'ApolloAction'.
Type 'Action' is not assignable to type 'ApolloAction'.
Type 'Action' is not assignable to type 'QueryResultAction'.
Property 'result' is missing in type 'Action'.
Type 'A' is not assignable to type 'WriteAction'.
Type 'Action' is not assignable to type 'WriteAction'.
Property 'writes' is missing in type **'Action'.**
#```
We need the google project name to pick from /config/env file.
https://github.com/cdmbase/fullstack-pro/blob/master/Jenkinsfile#L34
VM15507:161 WebSocket connection to 'ws://localhost:8080/graphql' failed: Invalid frame header
This is due to webpack auto updates at some point broke the subscription. The workaround is to restart the server to temporarily fix the issue.
This issue happens mostly when you try to modify the subscription code of the graphql-schema.
client.js:47 Uncaught TypeError: eventemitter3_1.EventEmitter is not a constructor
at new SubscriptionClient (client.js:47)
at Object../src/index.js (index.js:33)
at webpack_require (bootstrap b03e71f0b0db94868ce6:669)
at fn (bootstrap b03e71f0b0db94868ce6:87)
at Object.0 (splashscreen.js:10)
at webpack_require (bootstrap b03e71f0b0db94868ce6:669)
at bootstrap b03e71f0b0db94868ce6:715
at bundle.js:719
Wait until dependencies are corrected.
https://github.com/sysgears/persistgraphql-webpack-plugin
apollographql/persistgraphql#23
Current @0.3.1 version installs mocha
and @types/mocha
If build fails due to duplicate types of jest and mocha, then remove mocha
and @types/mohca
manually. #
Right now, we run webpack --watch
using lerna command which executes as parallel process to run on all the packages. This would takes more cpu and if we have more packages it will slow down the system.
https://github.com/cdmbase/fullstack-pro/blob/webpack-watch/package.json#L27
Need to optimize webpack, by having multiple entry points pointing to each package and bundling within the package directory.
https://github.com/cdmbase/fullstack-pro/blob/webpack-watch/tools/webpack-helper.js#L40
That way we will have a root webpack config for all the packages and it also improves the performance for webpack -watch
.
Also, we need to run multiple webpack compilations based on lerna's package folders. If we going many packages for a folder, we can limit it to have multiple folders inorder to have multiple webpack compilation.
Removing ncu
library until it gets fixed.
Noticing some errors.
[16:13:06.790Z] ERROR @sample-stack-server: 2 errors were thrown when executing your GraphQL queries.
Error: 2 errors were thrown when executing your GraphQL queries.
at /Users/veeramarni/Documents/fullstack-pro/node_modules/react-apollo/server.js:86:19
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
[HPM] Error occurred while trying to proxy request / from localhost:3000 to http://localhost:3010 (ECONNRESET) (https://nodejs.org/api/errors.html#errors_common_system_errors)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.