Skip to content

Commit

Permalink
fix: fix isReachStart's default value (#18)
Browse files Browse the repository at this point in the history
* fix: fix isReachStart's default value

* chore: update cfcs modules

* docs: add CONTRIBUTING

* fix: fix CONTRIBUTING

* skip: apply review

* fix: add nohoist for test modules
  • Loading branch information
daybrush authored Aug 2, 2022
1 parent 6dc1715 commit 9c49266
Show file tree
Hide file tree
Showing 11 changed files with 130 additions and 44 deletions.
59 changes: 59 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# How to contribute to egjs-conveyer
egjs-conveyer is opened to everyone and we're welcoming for any kind of contribution.
We believe that our project can grow with your interests helping others' necessities.

## Style Guide

egjs-conveyer has several style guidelines to follow.
Before your start, please read attentively below instructions.

### Linting and Code Conventions
We adopted [ESLint](http://eslint.org/) to maintain our code quality.
All rules are described at [.eslintrc](.eslintrc) file.

### Commit Log Guidelines
egjs-conveyer use commit logs in many different purposes (like creating CHANGELOG, ease history searching, etc.).
To not break, you'll be forced to follow our commit log guidelines.
Before your commit/push, make sure following our commit log guidelines.

The outline is as below:
```
<type>(<module>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

- **Types**
- **feat**: A new feature
- **fix**: A bug fix
- **docs**: Documentation only changes
- **style**: Changes that do not affect the meaning of the code. Such as white-space, formatting, missing semi-colons, etc... It also possible to change JSHint, JSCS rules of the code.
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **test**: Adding missing tests. Changing tests.
- **demo**: Adding missing demos. Changing demos.
- **chore**: Changes to the build process or tools and libraries such as documentation generation

[See More Commit Log Guidelines](https://github.com/naver/egjs/wiki/Commit-Log-Guidelines)

## How to submit Pull Requests
Steps to submit your pull request:

1. Fork `egjs-conveyer` on your repository
2. Create new branch from your egjs master branch (and be sure always to be up-to-date)
3. Do your work
4. Create test code for your work (when is possible)
5. Move the folder to `packages/conveyer` or frameworks folder.
6. Run `npm run lint` for linting and Code Conventions (update until without any error or warnings)
7. Run test code by `npm run test OR npm run test:chrome` in `packages/conveyer`.
Make sure tests are all passed at least in Chrome(latest desktop version)
8. Write commit log following convention and push to your repository branch.
9. Create a new PR from your branch to egjs-conveyer.
10. Wait for reviews.
When your contribution is well enough to be accepted, then will be merged to our branch.
11. All done!


## License
By contributing to egjs-conveyer, you're agreeing that your contributions will be licensed under its [MIT](https://opensource.org/licenses/MIT) license.
18 changes: 17 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,28 @@
"@types/react-dom": "^17.0.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"@cfcs/core": "^0.0.2"
"@cfcs/core": "~0.0.4"
},
"workspaces": {
"packages": [
"packages/*",
"packages/ngx-conveyer/projects/ngx-conveyer"
],
"nohoist": [
"**/@egjs/build-helper",
"**/@egjs/build-helper/**",
"**/rollup-plugin-vue",
"**/rollup-plugin-vue/**",
"**/karma",
"**/karma/**",
"**/karma-*",
"**/karma-*/**",
"**/@tyoes/chai",
"**/@tyoes/chai/**",
"**/@types/karma-chai",
"**/@types/karma-chai/**",
"**/@types/mocha",
"**/@types/mocha/**"
]
}
}
2 changes: 1 addition & 1 deletion packages/conveyer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"drag"
],
"dependencies": {
"@cfcs/core": "^0.0.2",
"@cfcs/core": "~0.0.4",
"@egjs/axes": "^3.4.0",
"@egjs/component": "^3.0.1"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/conveyer/src/Conveyer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Conveyer extends Component<ConveyerEvents> {
* @ko 스크롤이 시작에 닿았는지 여부.
* @name Conveyer#isReachStart
* @type {boolean}
* @default false
* @default true
* @readonly
* @example
* ```js
Expand All @@ -64,7 +64,7 @@ class Conveyer extends Component<ConveyerEvents> {
* conveyer.isReachStart
* ```
*/
@Reactive("isReachStart") private _isReachStart = false;
@Reactive("isReachStart") private _isReachStart = true;
/**
* Whether the scroll has reached the end.
* @ko 스크롤이 끝에 닿았는지 여부.
Expand Down
23 changes: 17 additions & 6 deletions packages/conveyer/test/unit/Conveyer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,19 +537,30 @@ describe("test Conveyer", () => {
});
});
describe("Events", () => {
it("should check if reachStart event triggered, isReachStart is true", () => {
it("should check if reachStart event triggered, isReachStart is true", async () => {
// Given
conveyer = new Conveyer(".items", {
autoInit: false,
});
const container = document.querySelector(".items");

container!.scrollLeft = 100;

conveyer = new Conveyer(".items");

// false
const firstIsReachStart = conveyer.isReachStart;

// When
const spy = sinon.spy();
conveyer.on("reachStart", spy);
conveyer.init();


// when
conveyer.scrollTo(0);
await waitFor(100);


// Then
expect(spy.callCount).to.be.equals(1);
expect(firstIsReachStart).to.be.equals(false);
expect(conveyer.isReachStart).to.be.equals(true);
});
it("should check if leaveStart event triggered, isReachStart is false", async () => {
// Given
Expand Down
2 changes: 1 addition & 1 deletion packages/ngx-conveyer/projects/ngx-conveyer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@angular/core": "^13.0.0"
},
"dependencies": {
"@cfcs/angular": "^0.0.2",
"@cfcs/angular": "~0.0.4",
"@egjs/conveyer": "~1.3.1",
"tslib": "^2.3.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-conveyer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"use"
],
"dependencies": {
"@cfcs/react": "^0.0.2",
"@cfcs/react": "~0.0.4",
"@egjs/conveyer": "~1.3.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-conveyer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@
},
"dependencies": {
"@egjs/conveyer": "~1.3.1",
"@cfcs/svelte": "~0.0.2"
"@cfcs/svelte": "~0.0.4"
}
}
2 changes: 1 addition & 1 deletion packages/vue-conveyer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
],
"dependencies": {
"@egjs/conveyer": "~1.3.1",
"@cfcs/vue3": "~0.0.2"
"@cfcs/vue3": "~0.0.4"
},
"devDependencies": {
"@egjs/build-helper": "^0.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/vue2-conveyer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@
},
"dependencies": {
"@egjs/conveyer": "~1.3.1",
"@cfcs/vue2": "~0.0.2"
"@cfcs/vue2": "~0.0.4"
}
}
58 changes: 29 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1668,48 +1668,48 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==

"@cfcs/angular@^0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@cfcs/angular/-/angular-0.0.2.tgz#ab088e584bbedf2b39d38e203a845dfb4bf693ca"
integrity sha512-gP1S6EC+nJmPfDXqK7ApcZW5/y1Lf5EIUKMgCYHvqLVyPEUK4Xk08p/YW/lpy6zWp72H1R2uFCeg8rcTf2CPSA==
"@cfcs/angular@~0.0.4":
version "0.0.4"
resolved "https://registry.yarnpkg.com/@cfcs/angular/-/angular-0.0.4.tgz#df681e3ac4f198941958e8703001b2c19ba25189"
integrity sha512-j2r/Q6ooHi5Ee1le9n735qb2xQGoy253zUF2xirr1IAzT67AAEuG/kTq++UwMkmPe1j008S6s7AzkEYcKu3lvw==
dependencies:
"@cfcs/core" "~0.0.2"
"@cfcs/core" "~0.0.4"
tslib "^2.3.0"

"@cfcs/core@^0.0.2", "@cfcs/core@~0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@cfcs/core/-/core-0.0.2.tgz#cd86620e2f5ee2101bd2268965f794ba04d7ef9c"
integrity sha512-4vvvwmtTf810rfGEwteDskVTpvfKUx6CTOy3ii6ep7Xr/9OfhECk9rBwqkO0QiTNay3fwTptFh2+FTB8u+Ouvw==
"@cfcs/core@~0.0.4":
version "0.0.4"
resolved "https://registry.yarnpkg.com/@cfcs/core/-/core-0.0.4.tgz#5c1e89c2c170dfa9ba69450376ed0d894e19e2a1"
integrity sha512-Y/BD2l+XpGtx2LT/ehdqUyvJ6OpI3F6yAQMNKj1t57WhzQX1AS6uEQRLmgPWd75fzsyV7u4Aia/+5KeCqgHuNg==
dependencies:
"@egjs/component" "^3.0.2"

"@cfcs/react@^0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@cfcs/react/-/react-0.0.2.tgz#d281781558cf3908edd235ddc34d8ab845e9c1ad"
integrity sha512-oFmyCtLAJhG+wRxKAW2hLFdaGhHCz9aTpBhTfTdIbr06/eKXd4fsBQ59x28h6X5okLz5H7KCJ1r4iwD1VwBWqg==
"@cfcs/react@~0.0.4":
version "0.0.4"
resolved "https://registry.yarnpkg.com/@cfcs/react/-/react-0.0.4.tgz#aa22e4bfbd4851c00240ef1f6a1353151facde27"
integrity sha512-0ETIzD8dxURPCBq59hjxm8P9TwPDeEqlSTlUng9q4L8IPDBcuQzyQRtmQQKxWVTP2zfA8ov/B85Yw3Qdp2xC9g==
dependencies:
"@cfcs/core" "~0.0.2"
"@cfcs/core" "~0.0.4"

"@cfcs/svelte@~0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@cfcs/svelte/-/svelte-0.0.2.tgz#237e4acda19342d9705ca487b3da0749c04acab4"
integrity sha512-Df0q+YGcteTkCIFbKxSnnpD82vU89cl2RCazURurdctKCSFntUqr6jkllAAVTbzyH4QYNABqj3h2aNsforijkw==
"@cfcs/svelte@~0.0.4":
version "0.0.4"
resolved "https://registry.yarnpkg.com/@cfcs/svelte/-/svelte-0.0.4.tgz#130afa25805847be0991d7824d31ec576e0f28d0"
integrity sha512-HkYn8qGY1IyX70H0r9DvwM/PhnkYew6oqRmewzF4z0RuR6M6xu7dGfAYHiVbEXMDIunY5CFUIAlieK2TY1mmWg==
dependencies:
"@cfcs/core" "~0.0.2"
"@cfcs/core" "~0.0.4"

"@cfcs/vue2@~0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@cfcs/vue2/-/vue2-0.0.2.tgz#a31b3b7267f3c384997188faaf5398503c214975"
integrity sha512-r5PwLrXSjJE+C2JpdEE+Jg50D2EuE9NvO7fQGv2C4LpaykW4XM4HRk79QXqhNzTHBxFbvP/Fmxza+X/ygL9EXg==
"@cfcs/vue2@~0.0.4":
version "0.0.4"
resolved "https://registry.yarnpkg.com/@cfcs/vue2/-/vue2-0.0.4.tgz#5e27dbcb3dd6b7516f75fc2943fec6037587cf9c"
integrity sha512-tFAdAbsYA/Q2kVM+j/KHhXmTrnm+NzfvHTtfgZP2rR4RyMSFkVfUIcUhtOuSTPcdGG052G/6MEVzJJ/tMeL3UA==
dependencies:
"@cfcs/core" "~0.0.2"
"@cfcs/core" "~0.0.4"

"@cfcs/vue3@~0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@cfcs/vue3/-/vue3-0.0.2.tgz#65157eda47eb3f1a81949ba28600dc4727f76958"
integrity sha512-H0rAxqsklb1/1GpMYSXwyiFrb3WKcme/TdaxPGvzSI/Rc1cI7G4synxA11DKNdZNLz2sd11R74CcPXeuPMhJFQ==
"@cfcs/vue3@~0.0.4":
version "0.0.4"
resolved "https://registry.yarnpkg.com/@cfcs/vue3/-/vue3-0.0.4.tgz#aff1e3d1a823f303cd0d2414e1b415834b8e8062"
integrity sha512-r+6svTEA71diI3UFCL0y4usAkPQ0HSmCy8PUyLtoQS1/fr5mOubt18Klz8noeqpcghkVhkTYjf6QSAjloDzGZw==
dependencies:
"@cfcs/core" "~0.0.2"
"@cfcs/core" "~0.0.4"

"@cnakazawa/watch@^1.0.3":
version "1.0.4"
Expand Down

0 comments on commit 9c49266

Please sign in to comment.