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

Hot Reloading Examples page #1090

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions bs-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
| Browser-sync config file
| For up-to-date information about the options:
| http://www.browsersync.io/docs/options/
| */
module.exports = {
"ui": false,
"files": ['dist/**', 'example/**', 'docs/**', 'themes/**'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm planning on moving the examples/ folder to introjs-website repo. I think we should keep this repo for Intro.js codebase and the introjs-website for docs, examples, etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I was wondering about that. That makes this whole PR dead. I can make new instructions once those changes are made I guess. We could run rollup -c -w in this repo, and then browsersync in the website, with yarn link or something? Cool to close this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually what happens with the netlify deploys if the example dir is moved?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question. I did not consider the Netilfy deploys 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git sub-modules? 😨

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if there are any good solutions. Symlinking and string replacements (for URL's) come to my mind. I guess it's a good question as to what the examples pages are for. Are they for the website? or for development?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both? I thing the end goal is to have the examples folder on the website but it's also nice to have that folder in the main repo (helps with Netlify deployments as you mentioned).

"watchEvents": [
"change"
],
"ignore": ["node_modules/*"],
"single": false,
"watchOptions": {
"ignoreInitial": true
},
"server": true,
"port": 4000,
"notify": false,
"startPath": "/example"
};
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,33 @@
},
"main": "intro.js",
"scripts": {
"start": "npm run watch-all",
"prettier": "prettier --write 'src/**/*'",
"test": "npm run test:jest && npm run test:jshint",
"test:watch": "jest ./tests --verbose --watch",
"test:jest": "jest ./tests --verbose",
"test:jshint": "jshint ./src --verbose && jshint ./tests --verbose",
"release": "./bin/release.sh || true",
"build": "rollup -c",
"build:watch": "rollup -c -w"
"build:watch": "rollup -c -w",
"examples:watch": "browser-sync start --config bs-config.js",
"watch-all": "npm-run-all -p build:watch examples:watch"
},
"devDependencies": {
"@babel/core": "^7.12.3",
"@babel/preset-env": "^7.12.1",
"@rollup/plugin-json": "^4.1.0",
"autoprefixer": "^9.0.0",
"babel-jest": "^26.6.3",
"browser-sync": "^2.26.13",
"core-js": "^3.6.5",
"eslint": "^7.13.0",
"jest": "^26.6.3",
"jshint": "^2.12.0",
"lerna-changelog": "^1.0.1",
"minify": "^6.0.0",
"node-sass": "^4.14.1",
"npm-run-all": "^4.1.5",
"postcss": "^8.1.1",
"postcss-clean": "^1.1.0",
"postcss-normalize": "^8.0.1",
Expand Down