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

Rebuild hyperlink #2382

Merged
merged 41 commits into from Aug 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
b6fedfa
Update link checking to use latest hyperlink. Replaces #1582
Munter Jul 23, 2018
d0f9ed5
Stop appending empty fragment to urls pointing ad no fragment identifier
Munter Jul 23, 2018
b70a775
Resolve relative hrefs from README's to their github.com url instead …
Munter Jul 25, 2018
958c136
Prefer https where available and also use https in examples
Munter Jul 25, 2018
fa437ea
Make non-fragment links inside headings visible
Munter Jul 25, 2018
63ae0bd
Update webpack docs china link
Munter Jul 25, 2018
00e8fbc
Fixed invalid edit links to index pages
Munter Jul 25, 2018
a317676
skip fragment check for vimdoc that is known to fail
Munter Jul 25, 2018
12dccb7
Fix broken link to migration guide from configuration/resolve
Munter Jul 25, 2018
de51fb0
Also resolve github README relative links when they don't start with …
Munter Jul 25, 2018
42b9d84
Add missing pages: Vote, Organization, Starter kits
Munter Jul 25, 2018
adcd3bd
Remove unused code
Munter Jul 25, 2018
422e7fa
Fix link that was redirected
Munter Jul 25, 2018
f400cd2
Open all target='_blank' links with rel='noopener' for security
Munter Jul 25, 2018
1c3ee46
Skip link checking img.shields.io
Munter Jul 25, 2018
fc4e876
Change order of markdown url rewriting to avoid errors
Munter Jul 25, 2018
b363414
Use lowercase variable name for node url module. See https://github.c…
Munter Jul 25, 2018
bd227a8
Update link to file-loader github repo
Munter Jul 26, 2018
ade9cb7
Rewrite links from https://npmjs.com to https://www.npmjs.com to avoi…
Munter Jul 26, 2018
1a19c2d
Skip checking links to npmjs.com/package that causes hyperlink to get…
Munter Jul 26, 2018
071407e
Updated organization projects urls to their redirect target
Munter Jul 26, 2018
73dec22
Update tool-list to get correct links for projects
Munter Jul 26, 2018
73779f7
Updated links to their redirect target
Munter Jul 26, 2018
43967dd
Remove jscs-loader. The project is deprecated, merged with eslint and…
Munter Jul 26, 2018
a8c6872
Update link to karma-webpack project
Munter Jul 26, 2018
076dd73
Remove link to named-modules-plugin, which is now in webpack core
Munter Jul 26, 2018
2ef4cb9
Added missing mini-css-extract-plugin to fetch script
Munter Jul 26, 2018
4932f17
Skip checking links to known deleted github users
Munter Jul 26, 2018
3ddaa42
Update broken fragments to work with new markdown generator
Munter Jul 26, 2018
2438e5b
Fixed more broken links
Munter Jul 27, 2018
710188c
Merge branch 'rebuild' into rebuild-hyperlink
montogeek Jul 27, 2018
972de53
infra(site) Copy assets when building
montogeek Jul 27, 2018
ebede53
Update github location for css-loader
Munter Jul 27, 2018
9e8fab8
Remove dead github accounts from contributors listings
Munter Jul 27, 2018
42cb344
infra(site) Fix fetchPackages script when running locally
montogeek Jul 27, 2018
cabd893
Fix internal fragmtn links in optimization.md
Munter Jul 27, 2018
5321534
Skip link checking or opencollective.com/webpack. Massive html respon…
Munter Jul 27, 2018
7b20e07
Remove link to non-existing named-modules-plugin
Munter Jul 29, 2018
21c589f
Use new release of hyperlink
Munter Jul 29, 2018
ab6f6c1
feat(infra) Travis optimization (#2404)
Munter Aug 2, 2018
e48c836
Merge branch 'rebuild' into rebuild-hyperlink
montogeek Aug 2, 2018
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
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -8,3 +8,4 @@ src/**/_*.md
npm-debug.log
yarn-error.log
package-lock.json
.cache
61 changes: 49 additions & 12 deletions .travis.yml
@@ -1,15 +1,52 @@
branches:
only:
- master
- develop
sudo: false
language: node_js
node_js:
- "8"
sudo: required
install:
- yarn
- sudo pip install proselint
before_script:
- source ./src/scripts/env.sh
script:
- bash ./src/scripts/deploy.sh

cache:
yarn: true
directories:
- node_modules
- dist
- .cache

stages:
- Build
- Post-build

jobs:
fast_finish: true
allow_failures:
- name: External Link Check

include:
- stage: Build
name: Lint and Build
before_install: npm install --global yarn
install: yarn
script:
- yarn lint:js
- yarn lint:markdown
- yarn lint:social
- yarn build
- yarn lint:links
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Random badge timeout. They seem to happen a lot. Might want to mark those as optional with a --todo


- stage: Build
name: Proselint
language: python
python: 3.6
cache:
pip: true
directories:
- $HOME/.cache
install: pip install -r requirements.txt
script: cp .proselintrc ~/ && proselint src/content
Copy link
Member

Choose a reason for hiding this comment

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

Is this really running before build?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Proselint is running in parallel with the remaining linting and the build. This is because it tends to be a slow run, but a really fast container boot because it only relies on the python ecosystem.

Proselint and the remaining limiting plus build run in parallel. If any of them fails it fails the pipeline, so you'll have the same effect as before, but faster once you remove the parallelization limitation


- stage: Post-build
name: Deploy
if: branch = master
script: bash ./src/scripts/deploy.sh

- stage: Post-build
name: External Link Check
script: yarn linkcheck
31 changes: 21 additions & 10 deletions package.json
Expand Up @@ -26,17 +26,24 @@
"scripts": {
"clean": "rimraf ./dist src/content/**/_*.md src/**/_*.json",
"start": "cross-env NODE_ENV=development webpack-dev-server --config webpack.dev.js --env.dev",
"update-repos": "node src/utilities/fetch-package-repos.js",
"content": "node src/scripts/build-content-tree.js ./src/content ./src/_content.json",
"build-test": "npm run build && http-server build/",
"fetch": "sh src/scripts/fetch.sh",
"fetch": "run-p fetch:*",
"fetch:readmes": "node src/utilities/fetch-package-readmes.js",
"fetch:supporters": "node src/utilities/fetch-supporters.js",
"fetch:starter-kits": "node src/utilities/fetch-starter-kits.js",
"prebuild": "npm run clean",
"build": "npm run fetch && npm run content && cross-env NODE_ENV=production webpack --config webpack.prod.js && npm run sitemap && echo webpack.js.org > dist/CNAME",
"build": "run-s fetch content && cross-env NODE_ENV=production webpack --config webpack.prod.js",
"postbuild": "npm run sitemap",
"test": "npm run lint",
"lint": "run-s lint:*",
"lint:js": "eslint src --ext .js,.jsx,.md",
"lint:js": "eslint src --ext .js,.jsx,.md --cache true --cache-location .cache/.eslintcache",
"lint:markdown": "markdownlint --config ./.markdownlint.json *.md ./src/content/**/*.md --ignore './src/content/**/_*.md'",
"lint:social": "alex . -q",
"lint:prose": "cp .proselintrc ~/ && proselint src/content",
"lint:links": "hyperlink -r dist/index.html --canonicalroot https://webpack.js.org/ -i | tee internal-links.tap | tap-spot",
Copy link
Member

Choose a reason for hiding this comment

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

What is tee internal-links.tap?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Tee writes a copy of stdout to a file while paying through the stdout pipe. It let's us keep a copy of the raw tap output while seeing the nice formatted report in the console. It's just in case we need to go back and look at the output in a different manner, for example if the reporter has a bug, or we forgot to copy/paste the console output

Copy link
Member

Choose a reason for hiding this comment

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

It is a dependency or something available in linux?

Copy link
Member

Choose a reason for hiding this comment

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

Oh yeah, linux program, cool! TIL

"linkcheck": "hyperlink -r dist/index.html --canonicalroot https://webpack.js.org/ --skip support__ --skip sidecar.gitter.im --skip vimdoc.sourceforge.net --skip img.shields.io --skip npmjs.com/package/ --skip opencollective.com/webpack --todo external-redirect | tee external-links.tap | tap-spot",
"sitemap": "cd dist && sitemap-static --prefix=https://webpack.js.org/ > sitemap.xml",
"serve": "npm run build && sirv start ./dist --port 4000",
"deploy": "gh-pages -d dist"
Expand All @@ -47,11 +54,15 @@
}
},
"lint-staged": {
"*.{js,jsx,md}": ["npm run lint:js"],
"*.md": ["npm run lint:markdown"]
"*.{js,jsx,md}": [
"npm run lint:js"
],
"*.md": [
"npm run lint:markdown"
]
},
"devDependencies": {
"@octokit/rest": "^15.2.6",
"@octokit/rest": "^15.9.4",
"alex": "^5.1.0",
"autoprefixer": "^7.2.3",
"babel-core": "^6.26.0",
Expand All @@ -62,7 +73,7 @@
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.24.1",
"copy-webpack-plugin": "^4.3.0",
"copy-webpack-plugin": "4.5.2",
"cross-env": "5.2.0",
"css-loader": "^0.28.5",
"directory-tree": "2.1.0",
Expand All @@ -81,7 +92,7 @@
"html-webpack-template": "^6.1.0",
"http-server": "^0.10.0",
"husky": "^1.0.0-rc.8",
"hyperlink": "^3.0.1",
"hyperlink": "^4.0.0",
"lint-staged": "^7.2.0",
"loader-utils": "^1.1.0",
"lodash": "^4.17.4",
Expand Down Expand Up @@ -113,7 +124,7 @@
"sitemap-static": "^0.4.2",
"static-site-generator-webpack-plugin": "^3.4.1",
"style-loader": "^0.18.2",
"tap-parser": "^6.0.1",
"tap-spot": "^1.1.1",
"through2": "^2.0.3",
"uglifyjs-webpack-plugin": "^1.1.6",
"webpack": "^3.10.0",
Expand All @@ -122,9 +133,9 @@
},
"dependencies": {
"@rigor789/remark-autolink-headings": "^5.1.0",
"ajv": "^5.5.2",
"docsearch.js": "^2.5.2",
"gitter-sidecar": "^1.2.3",
"ajv": "^5.5.2",
"javascriptstuff-db": "^1.12.0",
"lodash.throttle": "^4.1.1",
"prop-types": "^15.5.10",
Expand Down
3 changes: 3 additions & 0 deletions repositories/README.md
@@ -0,0 +1,3 @@
# Webpack documentation repositories

The files in this directory are auto generated from `src/utils/fetch-package-repos.js` and should not be edited by hand. Any manual changes will be overwritten by the automation next time it runs.
45 changes: 45 additions & 0 deletions repositories/loaders.json
@@ -0,0 +1,45 @@
[
"webpack-contrib/json-loader",
"webpack-contrib/raw-loader",
"webpack-contrib/coffee-loader",
"webpack-contrib/css-loader",
"webpack-contrib/style-loader",
"webpack-contrib/script-loader",
"webpack-contrib/less-loader",
"webpack-contrib/bundle-loader",
"webpack-contrib/val-loader",
"webpack-contrib/file-loader",
"webpack-contrib/url-loader",
"webpack-contrib/i18n-loader",
"webpack-contrib/json5-loader",
"webpack-contrib/worker-loader",
"webpack-contrib/jshint-loader",
"webpack-contrib/imports-loader",
"webpack-contrib/exports-loader",
"webpack-contrib/mocha-loader",
"webpack-contrib/coverjs-loader",
"webpack-contrib/expose-loader",
"webpack-contrib/node-loader",
"webpack-contrib/coffee-redux-loader",
"webpack-contrib/transform-loader",
"webpack-contrib/html-loader",
"webpack-contrib/sass-loader",
"webpack-contrib/source-map-loader",
"webpack-contrib/react-proxy-loader",
"webpack-contrib/null-loader",
"webpack-contrib/multi-loader",
"webpack-contrib/istanbul-instrumenter-loader",
"webpack-contrib/eslint-loader",
"webpack-contrib/yaml-frontmatter-loader",
"webpack-contrib/svg-inline-loader",
"webpack-contrib/restyle-loader",
"webpack-contrib/gzip-loader",
"webpack-contrib/cache-loader",
"webpack-contrib/thread-loader",
"webpack-contrib/polymer-webpack-loader",
"webpack-contrib/workerize-loader",
"webpack-contrib/config-loader",
"babel/babel-loader",
"postcss/postcss-loader",
"peerigon/extract-loader"
]
15 changes: 15 additions & 0 deletions repositories/plugins.json
@@ -0,0 +1,15 @@
[
"webpack-contrib/i18n-webpack-plugin",
"webpack-contrib/component-webpack-plugin",
"webpack-contrib/compression-webpack-plugin",
"webpack-contrib/extract-text-webpack-plugin",
"webpack-contrib/copy-webpack-plugin",
"webpack-contrib/npm-install-webpack-plugin",
"webpack-contrib/stylelint-webpack-plugin",
"webpack-contrib/babel-minify-webpack-plugin",
"webpack-contrib/uglifyjs-webpack-plugin",
"webpack-contrib/zopfli-webpack-plugin",
"webpack-contrib/closure-webpack-plugin",
"webpack-contrib/css-webpack-plugin",
"webpack-contrib/mini-css-extract-plugin"
]
1 change: 1 addition & 0 deletions requirements.txt
@@ -0,0 +1 @@
proselint
1 change: 1 addition & 0 deletions src/CNAME
@@ -0,0 +1 @@
webpack.js.org
2 changes: 1 addition & 1 deletion src/components/Link/Link.jsx
Expand Up @@ -11,7 +11,7 @@ export default ({
if ( url ) to = url;

if ( to.startsWith('http') || to.startsWith('//') )
return <a href={ to } target="_blank" { ...props } />;
return <a href={ to } target="_blank" rel="noopener" { ...props } />;

else return <Link to={ to } { ...props } />;
};
4 changes: 2 additions & 2 deletions src/components/Markdown/Markdown.scss
Expand Up @@ -26,7 +26,7 @@
color: inherit;
}

a {
a[aria-hidden="true"] {
margin-left: 8px;
font-size: 0.8em;
height: 1em;
Expand All @@ -35,7 +35,7 @@
transition: all 250ms;
}

&:hover a {
&:hover a[aria-hidden="true"] {
opacity: 1;
visibility: visible;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navigation/Navigation.jsx
Expand Up @@ -46,7 +46,7 @@ export default class Navigation extends React.Component {
className="navigation__languages"
items={[
{ title: 'English', url: 'https://webpack.js.org/' },
{ lang: 'zh', title: '中文', url: 'https://doc.webpack-china.org/' }
{ lang: 'zh', title: '中文', url: 'https://webpack.docschina.org/' }
]} />
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Organization/Organization.jsx
Expand Up @@ -8,7 +8,7 @@ import './Organization.scss';

const Organization = props => {
return (
<Container className="organization page__content">
<Container className="organization page__content markdown">
<h1>The Organization</h1>

<p>The list below provides a brief overview of all commonly used projects in the webpack ecosystem.</p>
Expand Down
4 changes: 4 additions & 0 deletions src/components/Organization/Organization.scss
Expand Up @@ -3,6 +3,10 @@

.organization {
padding: 1.5em;

&__title > h4 {
margin-top: 0; // Overrides markdown scss
Copy link
Member

Choose a reason for hiding this comment

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

Why add markdown in the first place?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Seems all the basic styles are now scoped under .markdownwhere they previously existed under page__content (now removed).

I'm not happy with this solution, but I'm not going to redo the CSS architecture as well when my focus is fixing broken links

Copy link
Member

Choose a reason for hiding this comment

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

Me neither, will fix :)

}
}

.organization__projects {
Expand Down