Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add/delete CRUD cli module in server and database directories #790

Open
wants to merge 104 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
ca84bde
Add cli-crud core functionality
Werter12 Jul 23, 2018
fe7cd96
Add generated containers file
Werter12 Jul 23, 2018
b9a5fad
Add domain-schema dependencies
Werter12 Jul 23, 2018
a7a7630
Fix pagiantion: wrong __typename being generated
mitjade Jul 23, 2018
a380e0c
Create commandInvoker, split addCrud and addModule
Werter12 Jul 24, 2018
5921d22
Add runCommand to CommandInvoker and change require in addCrud
Werter12 Jul 25, 2018
dc7f9ed
Update addModule index.js file changing, get rid of client module cre…
Werter12 Jul 25, 2018
88c7731
Refactor addModule. Reduce read and write file operations
Werter12 Jul 25, 2018
dc427ae
Fix tablePrefix generating. Divide renameFiles function
Werter12 Jul 25, 2018
c5ee744
Init delete module command
Werter12 Jul 25, 2018
a591425
Refactor deleteModule. Reduce read and write file operations and add …
Werter12 Jul 26, 2018
4798deb
Add domain-schema/knex dependency
Werter12 Jul 26, 2018
577e2b6
Add reading index file no matter what extension it has
Werter12 Jul 26, 2018
c9d5087
Add absent types to graphql template
Werter12 Jul 27, 2018
2a6d4ad
Fix babel class compilation issue, after running migrate command
Werter12 Jul 27, 2018
ec74a4b
Add -m option for deletemodule command to delete migration and seeds
Werter12 Jul 27, 2018
efe807b
Add sub command deleteMigrations. Add config for repeated paths
Werter12 Jul 27, 2018
6f37efd
Add sub command add migration. Replace hardcoded paths on paths from …
Werter12 Jul 27, 2018
91cb235
Replace paths in deleteMigrations function. Delete console.logs. Rena…
Werter12 Jul 27, 2018
9185223
Delete unnecessary files. Make small changes to addCrud and deleteMod…
Werter12 Jul 27, 2018
02067b9
Fix base path
Werter12 Jul 30, 2018
2f501e6
Add new dependencies
Werter12 Jul 31, 2018
6364aa7
Add crud and helpers from cli-crud
Werter12 Jul 31, 2018
9d9af2b
Refactor selectBy and getSelectFields functions
Werter12 Jul 31, 2018
f77ccb8
Refactor getList ordering and filtering, getPaginated, getTotal funct…
Werter12 Jul 31, 2018
7533456
Merge branch 'master' into add-delete-crud-cli-server-database
lyzhovnik Sep 10, 2018
ee04e55
Resolve version conflicts in yarn.lock for shelljs lib
lyzhovnik Sep 10, 2018
2d404c6
Update cli templates to the latest structure
lyzhovnik Sep 10, 2018
fc328e2
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Sep 18, 2018
a842a10
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Sep 19, 2018
7ed626b
schema - noIdSuffix: allow no ‘id’ suffix in related fields
mitjade Sep 19, 2018
89a1a6b
crud: fix get total if filter applied
mitjade Sep 19, 2018
ccd5891
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Sep 19, 2018
ad69238
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Sep 19, 2018
a6496d8
remame files to .ts if possible
mitjade Sep 19, 2018
87562e8
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Sep 20, 2018
64689cc
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Sep 25, 2018
a2e7332
fix crud refactoring regressions + small fixes
mitjade Sep 25, 2018
e1dc2e5
fix filter by boolean
mitjade Sep 26, 2018
c02551c
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Sep 26, 2018
cbb6e76
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Sep 27, 2018
7962cc0
convert resolvers to ts
mitjade Sep 27, 2018
9c80ec1
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Sep 28, 2018
3a1c57d
remove eslint disable
mitjade Sep 28, 2018
34201de
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Sep 28, 2018
e84d384
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Oct 3, 2018
56c7645
merge with master
mitjade Oct 9, 2018
cef3301
fix sortable funcionality
mitjade Oct 9, 2018
c6797f6
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Oct 10, 2018
0e65010
update packages, fix cli crud templates
mitjade Oct 10, 2018
bb54498
fix merge conflicts
mitjade Oct 12, 2018
8303f9a
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Oct 12, 2018
0bc902f
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Oct 18, 2018
ee72a24
crud: add in and contains to filters, small fixes, add editor scope, …
mitjade Oct 18, 2018
1d3bd4a
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Oct 18, 2018
4a4423d
changes scope order
mitjade Oct 18, 2018
9ce8ebe
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Oct 18, 2018
a5f21fe
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Oct 23, 2018
b6c2b3b
sql crud: fix where in
mitjade Oct 23, 2018
2dc8f76
sql crud: fix where in
mitjade Oct 23, 2018
ece2f78
merge with master
mitjade Oct 24, 2018
ea1e3dd
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Oct 26, 2018
8e43942
add updateMany funconality for one to one relations, add updateschema…
mitjade Oct 26, 2018
18e4ed6
merge with master
mitjade Oct 29, 2018
4d42370
small fix
mitjade Oct 29, 2018
e12e4f7
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Nov 9, 2018
77ac977
update yarn lock
mitjade Nov 9, 2018
b345307
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Nov 9, 2018
eef7b28
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Nov 9, 2018
5ea4e8c
crud: update to latest
mitjade Nov 16, 2018
2fb9277
update to latest cli-crud
mitjade Nov 22, 2018
ff00752
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Nov 22, 2018
25a5a58
Add package name to `package.json`
mitjade Nov 23, 2018
b09c06a
fix comments
mitjade Nov 23, 2018
5535f8e
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Nov 23, 2018
e534dc4
Merge branch 'add-package-name' into add-delete-crud-cli-server-database
mitjade Nov 23, 2018
d8fd47e
update addcrud
mitjade Nov 23, 2018
64b83f9
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Dec 12, 2018
8f3f224
small fixes
mitjade Dec 12, 2018
7074f5a
Merge branch 'master' into cli-crud
mitjade Jan 30, 2019
d0e02af
reorder package file
mitjade Jan 30, 2019
7d2f6de
addCrud wip
mitjade Jan 30, 2019
fc3d05e
remove log and replace with console.log for now, to fix __DEV__ not b…
mitjade Jan 31, 2019
29a2553
fix cli addCrud, and updateSchema
mitjade Jan 31, 2019
f50a569
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Jan 31, 2019
49d5466
merge with master
mitjade Feb 1, 2019
7453699
small cleanup
mitjade Feb 1, 2019
c6c53d8
move generatedSchemas
mitjade Feb 5, 2019
7d6e171
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Feb 5, 2019
dc97260
merge with master
mitjade Feb 18, 2019
5e5003f
merge latest
mitjade Mar 11, 2019
b7825c4
merge with master
mitjade Mar 11, 2019
78ba078
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Jul 15, 2019
45031d2
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Jul 15, 2019
544668c
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Jul 16, 2019
8a69ab8
remove uneeded dep
mitjade Jul 16, 2019
ebcafd7
yarn.lock
mitjade Jul 19, 2019
d8a8680
latest changes
mitjade Jul 19, 2019
4e2d9a7
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Aug 23, 2019
d246678
merge with master
mitjade Aug 26, 2019
53372d0
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Aug 28, 2019
2aa8506
merge master
mitjade Dec 17, 2019
e1fdf64
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Dec 24, 2019
7dc71e3
Merge branch 'master' into add-delete-crud-cli-server-database
mitjade Jan 14, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/tools/templates/crud/client-react/graphql/*
**/tools/templates/crud/server-ts/*.graphql
2 changes: 1 addition & 1 deletion modules/core/common/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const log = minilog(loggerName);
(log as any).suggest.defaultResult = false;
(log as any).suggest.clear().allow(loggerName, settings.app.logging.level);

if (__DEV__ && __SERVER__ && !__TEST__) {
if (typeof __DEV__ !== 'undefined' && typeof __SERVER__ !== 'undefined' && typeof __TEST__ !== 'undefined') {
const consoleLog = global.console.log;
global.console.log = (...args: any[]) => {
if (args.length === 1 && typeof args[0] === 'string' && args[0].match(/^\[(HMR|WDS)\]/)) {
Expand Down
10 changes: 6 additions & 4 deletions modules/core/common/net.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import url from 'url';
import { PLATFORM } from './utils';

const apiUrlDefine = typeof __API_URL__ !== 'undefined' ? __API_URL__ : '/graphql';

export const serverPort =
PLATFORM === 'server' && (process.env.PORT || (typeof __SERVER_PORT__ !== 'undefined' ? __SERVER_PORT__ : 8080));
export const isApiExternal = !!url.parse(__API_URL__).protocol;
export const isApiExternal = !!url.parse(apiUrlDefine).protocol;

const clientApiUrl =
!isApiExternal && PLATFORM === 'web'
? `${window.location.protocol}//${window.location.hostname}${
__DEV__ ? ':8080' : window.location.port ? ':' + window.location.port : ''
}${__API_URL__}`
: __API_URL__;
}${apiUrlDefine}`
: apiUrlDefine;

const serverApiUrl = !isApiExternal ? `http://localhost:${serverPort}${__API_URL__}` : __API_URL__;
const serverApiUrl = !isApiExternal ? `http://localhost:${serverPort}${apiUrlDefine}` : apiUrlDefine;

export const apiUrl = PLATFORM === 'server' ? serverApiUrl : clientApiUrl;
15 changes: 15 additions & 0 deletions modules/core/server-ts/api/rootSchema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ type FieldError {
message: String!
}

type PageInfo {
totalCount: Int
hasNextPage: Boolean
}

type BatchPayload {
count: Int
errors: [FieldError!]
}

input OrderByInput {
column: String
order: String
}

type Query {
dummy: Int
}
Expand Down
1 change: 1 addition & 0 deletions modules/core/server-ts/generatedSchemas.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default {};
2 changes: 2 additions & 0 deletions modules/core/server-ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { createServer } from './entry';
export { serverPromise } from './entry';
export { createSchema } from './api/schema';

export { default as schemas } from './generatedSchemas';

export default new ServerModule({
onAppCreate: [createServer]
});
Loading