Skip to content

Commit

Permalink
chore: rework demo, setup actions build and host
Browse files Browse the repository at this point in the history
  • Loading branch information
Barthelemy Bonhomme committed Dec 10, 2024
1 parent 70bad43 commit eaf60b7
Show file tree
Hide file tree
Showing 12 changed files with 123 additions and 155 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ jobs:
working-directory: ${{ env.BUILD_PATH }}

- name: Build
run: yarn build --mode=demo
run: yarn build:demo
working-directory: ${{ env.BUILD_PATH }}

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ env.BUILD_PATH }}/dist
path: ${{ env.BUILD_PATH }}/demo

deploy:
environment:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
registry-url: https://registry.npmjs.org/
always-auth: true
- run: yarn
- run: yarn build --mode=lib
- run: yarn build:lib
env:
NODE_ENV: production
- run: yarn publish
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ node_modules/
### IDE
.idea

demo
dist
/demo
/dist
36 changes: 0 additions & 36 deletions dist/scroll-snap-slider.css

This file was deleted.

6 changes: 3 additions & 3 deletions hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ if ! eslint --fix $(find "$DIRECTORIES" -type f -name '*.js'); then
exit 1
fi

e_info "Linting & Fixing SCSS Code Style"
if ! stylelint --fix $(find "$DIRECTORIES" -type f -name '*.scss'); then
e_error "Error in SCSS file. Run ${YELLOW}stylelint *.scss${RESET} to check."
e_info "Linting & Fixing CSS Code Style"
if ! stylelint --fix $(find "$DIRECTORIES" -type f -name '*.css'); then
e_error "Error in CSS file. Run ${YELLOW}stylelint *.css${RESET} to check."
exit 1
fi

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@
"eslint-plugin-promise": "6.1.1",
"postcss": "^8.4.35",
"postcss-scss": "^4.0.9",
"sass": "^1.71.1",
"stylelint": "^16.2.1",
"stylelint-config-standard": "^36.0.0",
"stylelint-config-standard-scss": "^13.0.0",
"stylelint-order": "^6.0.4",
"terser": "^5.37.0",
"typedoc": "^0.25.9",
"typedoc": "^0.27.4",
"typescript": "^5.3.3",
"vite": "5.4.6",
"vite-plugin-dts": "^3.7.3"
},
"scripts": {
"build:doc": "typedoc --options ./typedoc.json src",
"build:doc": "typedoc --tsconfig tsconfig.json --options ./typedoc.json src",
"build:css": "mkdir -p dist && cp src/lib/scroll-snap-slider.css dist/scroll-snap-slider.css",
"build": "vite build && yarn build:doc && yarn build:css",
"build:demo": "vite build --mode demo --base scroll-snap-slider && yarn build:doc",
"build:lib": "vite build --mode lib && yarn build:css",
"dev": "vite dev"
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/lib/ScrollSnapAutoplay.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ScrollSnapPlugin } from './ScrollSnapPlugin';

/**
* @classdesc Plugin that automatically changes slides.
* Plugin that automatically changes slides.
*/
export class ScrollSnapAutoplay extends ScrollSnapPlugin {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ScrollSnapDraggable.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ScrollSnapPlugin } from './ScrollSnapPlugin'

/**
* @classdesc Plugin that enables mouse/pointer drag. Note, that touch interaction is enabled natively in all browsers.
* Plugin that enables mouse/pointer drag. Note, that touch interaction is enabled natively in all browsers.
*/
export class ScrollSnapDraggable extends ScrollSnapPlugin {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/ScrollSnapSlider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ declare global {
}

/**
* @classdesc Mostly CSS slider with great performance.
* Mostly CSS slider with great performance.
*/
export class ScrollSnapSlider {
/**
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"node_modules"
],
"entryPointStrategy": "expand",
"out": "demo/docs"
"out": "demo/docs",
"githubPages": true,
},
"references": [
{
Expand Down
Loading

0 comments on commit eaf60b7

Please sign in to comment.