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

feat(backend): add OData & GraphQL packages #2

Merged
merged 78 commits into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
2823fd0
feat(backend): add OData & GraphQL packages
ghiscoding-SE Jun 4, 2020
a96ec38
(readme): add todo step to look into
ghiscoding-SE Jun 5, 2020
c7c3575
Merge remote-tracking branch 'origin/master' into feat-backend-services
ghiscoding-SE Jun 10, 2020
fc9cf6b
refactor(backend): start adding OData/GraphQL Examples
ghiscoding-SE Jun 12, 2020
a7641cf
Merge remote-tracking branch 'origin/master' into feat-backend-services
ghiscoding-SE Jun 12, 2020
3987edf
refactor(backend): fix backend examples to show query
ghiscoding Jun 15, 2020
04e6e62
refactor(backend): add SlickGrid type
ghiscoding Jun 15, 2020
189c179
refactor(backend): increase unit test code coverage
ghiscoding Jun 15, 2020
e1f4f52
refactor(backend): fix 2-way binding service with innerhtml
ghiscoding Jun 15, 2020
804cbe8
refactor(vanilla): fix incorrect argument type & sanitize data
ghiscoding Jun 15, 2020
7da25b8
refactor(vanilla): add more possible binding types
ghiscoding Jun 15, 2020
cbd8da1
refactor(backend): add grid presets with backend services
ghiscoding Jun 16, 2020
6ededc8
Merge branch 'master' into feat-backend-services
ghiscoding Jun 16, 2020
52a8f5d
refactor(backend): add parent container to include grid & pagination
ghiscoding Jun 16, 2020
0026559
refactor(example): use better TS Generics code
ghiscoding-SE Jun 17, 2020
bd9816a
Merge branch 'master' into feat-backend-services
ghiscoding-SE Jun 17, 2020
3fd745c
refactor(pagination): start adding pagination component
ghiscoding-SE Jun 17, 2020
73d1313
Merge branch 'master' into feat-backend-services
ghiscoding-SE Jun 18, 2020
d574e81
refactor(pagination): start adding bindings to slick pagination
ghiscoding-SE Jun 18, 2020
d875c13
refactor(backend): use binding service to rewrite slick pagination
ghiscoding Jun 19, 2020
7fec94d
refactor(pagination): get a fully working pagination component
ghiscoding-SE Jun 19, 2020
2f2df5b
refactor(pagination): fix TS build errors
ghiscoding-SE Jun 19, 2020
37a7799
refactor(pagination): fix unit tests and add couple more
ghiscoding Jun 20, 2020
05f7d0b
refactor(core): fix build TS errors
ghiscoding Jun 20, 2020
ec583ca
refactor(core): remove unnecessary build targets
ghiscoding Jun 23, 2020
20328ce
refactor(pagination): add translation into slick-pagination component
ghiscoding Jun 23, 2020
df68b32
refactor(tests): add Cypress and few E2E tests
ghiscoding Jun 23, 2020
98753f4
refactor(ci): add webpack server run to CircleCI
ghiscoding Jun 23, 2020
120a97b
refactor(ci): Jest should test only its own unit tests
ghiscoding Jun 23, 2020
33a6d8c
refactor(ci): add missing cypress mochasome script
ghiscoding Jun 23, 2020
843cb0c
refactor(ci): try using Cypress XML reporter
ghiscoding Jun 23, 2020
8354dd0
refactor(ci): try webpack server directly
ghiscoding Jun 23, 2020
f3b0de2
refactor(ci): try using http-server for Cypress tests
ghiscoding Jun 23, 2020
90c6119
refactor(ci): add bootstrap before prod build
ghiscoding Jun 23, 2020
732e316
refactor(ci): include docs folder to server for Cypress tests
ghiscoding Jun 23, 2020
b9b3814
refactor(ci): move Cypress test folder and add mochawesome reporter
ghiscoding Jun 23, 2020
1a977bf
refactor(ci): move cypress test folder
ghiscoding Jun 23, 2020
f99be56
refactor(ci): add Cypress, Mocha, Mochawesome to root
ghiscoding Jun 23, 2020
60ef9b6
refactor(ci): move http-server to root
ghiscoding Jun 23, 2020
9ab5099
refactor(ci): fix http-server folder location
ghiscoding Jun 23, 2020
d0039f2
refactor(tests): add slick-pagination component unit test
ghiscoding Jun 24, 2020
387278d
refactor(tests): add few more vanilla unit tests
ghiscoding Jun 25, 2020
9b3159d
(demo): build GitHub demo page
ghiscoding Jun 25, 2020
aa485b8
refactor(ci): update Cypress npm scripts to run from root
ghiscoding Jun 25, 2020
4907d62
refactor(ci): add codecov config file
ghiscoding Jun 25, 2020
e5049b3
refactor(ci): try full bundle before building demo site
ghiscoding Jun 25, 2020
13273ad
refactor(ci): try using webpack dev server for cypress tests
ghiscoding Jun 25, 2020
728c8fa
refactor(graphql): use gridoption backend service
ghiscoding Jun 25, 2020
a83643e
refactor(ci): try fixing Cypress tests
ghiscoding Jun 25, 2020
485a70b
refactor(ci): try using only webpack dev server for cypress
ghiscoding Jun 25, 2020
bdc8005
refactor(ci): use webpack dev server from lerna
ghiscoding Jun 25, 2020
e9f906c
refactor(ci): try running web dev server before jest
ghiscoding Jun 25, 2020
87ff034
refactor(ci): try building prod build before serving for cypress
ghiscoding Jun 25, 2020
790db12
refactor(ci): change code to test with cypress
ghiscoding Jun 25, 2020
c99d1ca
refactor(ci): try circle cache for monorepo
ghiscoding Jun 25, 2020
e420f62
refactor(ci): try using pre-build docs for cypress tests
ghiscoding Jun 25, 2020
e27934c
refactor(ci): use pre-built docs folder for cypress tests
ghiscoding Jun 25, 2020
7bfc0c4
refactor(ci): try circleci cache from yarn lock file
ghiscoding Jun 25, 2020
a9d1d05
refactor(ci): try using yarn lock file for circleci cache
ghiscoding Jun 25, 2020
68f7784
refactor(ci): go back to a working build with pre-built demo site
ghiscoding Jun 25, 2020
be2f69a
refactor(core): remove all unnecessary const types
ghiscoding-SE Jun 25, 2020
d8dfb10
Merge branch 'master' into feat-backend-services
ghiscoding-SE Jun 25, 2020
2a1593f
Merge branch 'master' into feat-backend-services
ghiscoding-SE Jun 25, 2020
53677c7
refactor(core): use appendChild since append doesn't always exist
ghiscoding-SE Jun 25, 2020
8550f13
Merge branch 'master' into feat-backend-services
ghiscoding-SE Jun 25, 2020
5d6e51d
refactor(tests): fix failing unit test
ghiscoding-SE Jun 25, 2020
ae9cc2e
refactor(ci): use yarn lock checksum for CircleCI caching
ghiscoding Jun 26, 2020
6eb0a6b
Merge branch 'master' into feat-backend-services
ghiscoding-SE Jun 26, 2020
22d47b4
Merge branch 'feat-backend-services' of https://github.com/ghiscoding…
ghiscoding-SE Jun 26, 2020
6af22d0
refactor(tests): add more unit tests
ghiscoding-SE Jun 26, 2020
1000e5b
Merge branch 'master' into feat-backend-services
ghiscoding-SE Jun 26, 2020
c1d44c6
(demo): update github demo page
ghiscoding Jun 27, 2020
f083307
refactor(tests): add more unit tests
ghiscoding Jun 27, 2020
8f8f328
refactor(tests): add few more vanilla service unit tests
ghiscoding Jun 28, 2020
aa41049
refactor(core): fix TS type warnings
ghiscoding Jun 28, 2020
7da68d1
refactor(core): add grid uid when finding header/viewport dom element
ghiscoding-SE Jun 29, 2020
58fa52c
refactor(core): add yarn lock file
ghiscoding-SE Jun 29, 2020
ab3f39b
refactor(tests): add more unit tests
ghiscoding-SE Jun 29, 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
38 changes: 35 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,29 @@ jobs:
steps:
- checkout
- restore_cache:
key: slickgrid-universal-build-{{ .Branch }}-{{ checksum "package.json" }}
key: slickgrid-universal-build-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run: yarn install
- save_cache:
key: slickgrid-universal-build-{{ .Branch }}-{{ checksum "package.json" }}
key: slickgrid-universal-build-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- "node_modules"
- run:
name: TypeScript Build (tsc)
command: yarn run build
# - run:
# name: Build Full Bundle (all Bundler types)
# command: yarn run bundle
# - run:
# name: Website Prod Build
# command: yarn run build:demo
- run:
name: Run Web Server
command: npm run serve
background: true
- run:
name: Running Cypress E2E tests with JUnit XML reporter
command: |
yarn run build
yarn run cypress:ci
- run:
name: Run Jest tests with JUnit as reporter
command: ./node_modules/.bin/jest --config test/jest.config.js --ci --runInBand --collectCoverage=true --reporters=default --reporters=jest-junit
Expand All @@ -27,3 +40,22 @@ jobs:
- run:
name: Upload Jest coverage to Codecov
command: bash <(curl -s https://codecov.io/bash)
- run:
name: Build Full Bundle (all Bundler types)
command: yarn run bundle
# - run:
# name: Website Prod Build
# command: yarn run build:demo
# - run:
# name: Run Web Server
# command: npm run dev:watch
# background: true
# - run:
# name: Run Web Server
# command: npm run serve
# background: true
# - run:
# name: Running Cypress E2E tests with JUnit XML reporter
# command: |
# yarn run cypress:ci

15 changes: 15 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
coverage:
precision: 2
round: up
range: "50...95"

status:
project:
default:
target: auto
# Fail the status if coverage drops by >= 3%
threshold: 3%
branches: null
patch:
default:
threshold: 5%
12 changes: 10 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,16 @@
"space-in-parens": [
"error"
],
"spaced-comment": "error",
"spaced-comment": [
"error",
"always",
{
"markers": [
"/"
]
}
],
"use-isnan": "error",
"valid-typeof": "off"
}
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ npm-debug.log
testem.log
/typings
yarn-error.log
yarn.lock

# System Files
.DS_Store
Expand All @@ -56,3 +55,4 @@ dist-demo
**/junit.xml
**/test-report.xml
**/testresult.xml
**/test-results.xml
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
**/junit.xml
**/test-report.xml
**/testresult.xml
**/test-results.xml

# compressed distribution files
dist-grid-bundle-zip
Expand Down
60 changes: 32 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,41 @@
[![codecov](https://codecov.io/gh/ghiscoding/slickgrid-universal/branch/master/graph/badge.svg)](https://codecov.io/gh/ghiscoding/slickgrid-universal)
[![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest)

This is a monorepo project (using Lerna) which is regrouping a few packages under a single repository.
The goal is to create a common repo that includes all Editors, Filters, Extensions and Services
that could be used by any Framework (it is framework agnostic).
It's also a good opportunity to decouple some features/services that not every project require at all time,
this will also help in getting smaller bundle size depending on which features (packages) are used. For example, not every project requires backend services (OData, GraphQL),
This is a monorepo project (using Lerna) which is regrouping a few packages under a single repository.
The goal is to create a common repo that includes all Editors, Filters, Extensions and Services
that could be used by any Framework (it is framework agnostic).
It's also a good opportunity to decouple some features/services that not every project require at all time,
this will also help in getting smaller bundle size depending on which features (packages) are used. For example, not every project requires backend services (OData, GraphQL),
which is why they are better handled with a monorepo structure.

### Demo page
The GitHub [demo page](https://ghiscoding.github.io/slickgrid-universal) uses 2 different themes (Material Design / Salesforce) but you could also use Bootstrap theme which is demoed in other frameworks.
The GitHub [demo page](https://ghiscoding.github.io/slickgrid-universal) uses 2 different themes (Material Design / Salesforce) but you could also use Bootstrap theme which is demoed in other frameworks.
- [Web-Demo-Vanilla-Bundle](https://ghiscoding.github.io/slickgrid-universal) with Material Design theme & Salesforce theme
- [Angular-Slickgrid](https://ghiscoding.github.io/Angular-Slickgrid/)
- [Slickgrid-Universal](https://ghiscoding.github.io/aurelia-slickgrid/)
- [Aurelia-Slickgrid](https://ghiscoding.github.io/aurelia-slickgrid/)

### Why create this monorepo?
You might be wondering why was this monorepo created? Here are a few of the reasons:
1. it removes a lot of duplicate code that exist in both
[Angular-Slickgrid](https://github.com/ghiscoding/Angular-Slickgrid) and [Slickgrid-Universal](https://github.com/ghiscoding/aurelia-slickgrid)
1. it removes a lot of duplicate code that exist in both
[Angular-Slickgrid](https://github.com/ghiscoding/Angular-Slickgrid) and [Aurelia-Slickgrid](https://github.com/ghiscoding/aurelia-slickgrid)
(these libs have over 80% of code in common and that is not very DRY).
2. decouple some Services that should not be required at all time (OData, GraphQL, Export to File, Export to Excel, ...)
3. framework agnostic, it could be implemented in many more frameworks in the future (interested in adding other frameworks? please contact me...)

### Frameworks using this monorepo
This is a Work in Progress, the goal is to eventually to rewrite [Angular-Slickgrid](https://github.com/ghiscoding/Angular-Slickgrid)
and [Slickgrid-Universal](https://github.com/ghiscoding/aurelia-slickgrid) to use this monorepo which will simplify debugging/fixing common code.
This is a Work in Progress, the goal is to eventually to rewrite [Angular-Slickgrid](https://github.com/ghiscoding/Angular-Slickgrid)
and [Aurelia-Slickgrid](https://github.com/ghiscoding/aurelia-slickgrid) to use this monorepo which will simplify debugging/fixing common code.

Note however that this project also has a Vanilla Implementation (not associated to any framework)
Note however that this project also has a Vanilla Implementation (not associated to any framework)
and it is also used to test with the UI portion. The Vanilla bundle is also used in our SalesForce (with Lightning Web Component) hence the creation of this monorepo.

#### The main packages structure is the following
- `@slickgrid-universal/common`: commonly used Formatters/Editors/Filters/Services/...
- this can then be used by any Framework (Angular, Aurelia, VanillaJS, ...)
- `@slickgrid-universal/excel-export`: export to Excel (xls/xlsx)
- `@slickgrid-universal/file-export`: export to text file (csv/txt)
- `@slickgrid-universal/graphql`: GraphQL querying (support Filter/Sort/Pagination) - COMING SOON
- `@slickgrid-universal/odata`: OData querying (support Filter/Sort/Pagination) - COMING SOON
- `@slickgrid-universal/graphql`: GraphQL querying (support Filter/Sort/Pagination with a GraphQL backend Server)
- `@slickgrid-universal/odata`: OData querying (support Filter/Sort/Pagination with an OData backend Server)
- `@slickgrid-universal/vanilla-bundle`: a vanilla TypeScript/JavaScript implementation (framework-less)
- &nbsp;
- **Standalone Package**
Expand All @@ -66,8 +66,8 @@ npm run build

3. Run Dev (Vanilla Implementation)

There is a Vanilla flavour implementation of this monorepo, vanilla means that it is not associated to any framework
and is written in plain TypeScript without being bound to any framework. The implementation is very similar to Angular and Aurelia.
There is a Vanilla flavour implementation of this monorepo, vanilla means that it is not associated to any framework
and is written in plain TypeScript without being bound to any framework. The implementation is very similar to Angular and Aurelia.
It could be used as a guideline to implement it in with other frameworks.

```bash
Expand All @@ -88,7 +88,7 @@ npm run test:watch
- [x] Aggregators (6)
- [x] Editors (11)
- [x] Filters (17)
- [ ] Add optional debounce filter delay to local grid
- [ ] Add optional debounce filter delay on local grid
- [x] Formatters (31)
- [ ] Extensions
- [x] AutoTooltip
Expand All @@ -112,22 +112,25 @@ npm run test:watch
- [x] Export Text (**separate package**)
- [x] Extension
- [x] Filter
- [ ] GraphQL (**separate package**)
- [ ] OData (**separate package**)
- [x] GraphQL (**separate package**)
- [x] OData (**separate package**)
- [x] Grid Event
- [x] Grid Service (helper)
- [x] Grid State
- [x] Grouping & Col Span
- [x] Pagination
- [ ] Resizer
- [ ] Resizer
- moved the Service to an Extension
- [x] Shared
- [x] Sort
- [ ] Others / Vanilla Implementation
- [x] Custom Footer
- [ ] add unit tests (possibly rewrite component in vanilla JS)
- [x] Backend Services + Pagination
- [x] Local Pagination
- [x] Grid Presets
- [ ] Dynamically Add Columns
- [ ] Grid Presets
- [ ] Local Pagination
- [ ] Translations Support
- [ ] Tree Data
- [x] add Grid Demo
- [x] add Collapse/Expand All into Context Menu
Expand All @@ -142,17 +145,18 @@ npm run test:watch
- [x] Add Multiple Example Demos with Vanilla implementation
- [x] Add GitHub Demo website
- [x] Add CI/CD (CircleCI or GitHub Actions)
- [x] Add Jest Unit tests
- [ ] Add Cypress E2E tests
- [x] Add Code Coverage (codecov)
- [x] Add Jest Unit tests
- [x] Add Jest Code Coverage (codecov)
- [x] Build and run on every PR
- [x] Add full bundler (all types) build step in CircleCI build
- [x] Bundle Creation (vanilla bundle)
- [ ] Eventually add Unit Tests as a PreBundle task
- [ ] Remove any Deprecated code
- [ ] Eventually add Unit Tests as a Pre-Bundle task
- [x] Remove any Deprecated code
- [ ] Create a [Migration Guide](https://github.com/ghiscoding/slickgrid-universal/wiki/Migration-for-Angular-Aurelia-Slickgrid) for Angular/Aurelia
- [x] Add simple input bindings in the demo (e.g. pinned rows input)
- [x] Add possibility to use SVG instead of Font Family
- [x] Add Typings (interfaces) for Slick Grid & DataView objects
- [x] Add interfaces to all SlickGrid core lib classes & plugins (basically add Types to everything)
- [ ] Cannot copy text from cell since it's not selectable
- [ ] Remove all Services init method 2nd argument (we can get DataView from the Grid object)
- [ ] Copy text from cell doesn't work in SF
- [ ] Remove all Services init method 2nd argument (we can get DataView directly from the Grid object)
297 changes: 0 additions & 297 deletions docs/app.0d425d500c9a48ed1158.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/app.0d425d500c9a48ed1158.bundle.map

This file was deleted.

297 changes: 297 additions & 0 deletions docs/app.9a11c6cd0a566769998d.bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/app.9a11c6cd0a566769998d.bundle.map

Large diffs are not rendered by default.

Loading