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 5 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
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"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",
"linkcheck": "hyperlink -r dist/index.html --canonicalroot https://webpack.js.org/ --skip support__ --skip sidecar.gitter.im --todo img.shields.io --todo external-redirect | tee master.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 Down Expand Up @@ -71,12 +72,12 @@
"fontgen-loader": "git://github.com/EugeneHlushko/fontgen-loader.git#a26a73843900ca4b518853952b1fc3c816103512",
"front-matter": "^2.3.0",
"gh-pages": "^1.0.0",
"github": "^10.0.0",
"html-webpack-plugin": "^2.30.1",
"html-webpack-template": "^6.1.0",
"github": "^10.0.0",
"http-server": "^0.10.0",
"husky": "^1.0.0-rc.8",
"hyperlink": "^3.0.1",
"hyperlink": "github:Munter/hyperlink#070916d",
"loader-utils": "^1.1.0",
"lodash": "^4.17.4",
"markdownlint": "^0.6.0",
Expand Down Expand Up @@ -106,7 +107,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 Down
4 changes: 2 additions & 2 deletions src/components/Markdown/Markdown.scss
Original file line number Diff line number Diff line change
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/NotificationBar/NotificationBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MessageBar extends React.Component {
<Container className="notification-bar__inner">
<p>
Sponsor webpack and get apparel from the <a href="https://webpack.threadless.com">official shop</a> or get
stickers <a href="http://www.unixstickers.com/tag/webpack">here</a>! All proceeds go to our{' '}
stickers <a href="https://www.unixstickers.com/tag/webpack">here</a>! All proceeds go to our{' '}
<a href="https://opencollective.com/webpack">open collective</a>!
</p>
{localStorageIsEnabled ? (
Expand Down
6 changes: 5 additions & 1 deletion src/components/SidebarItem/SidebarItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export default class SidebarItem extends React.Component {
if ( `/${currentPage}` === url ) {
return `#${anchor.id}`;

} else return `${url}#${anchor.id}`;
} else if (!anchor.id) {
return url;
} else {
return `${url}#${anchor.id}`;
}
}
}
4 changes: 2 additions & 2 deletions src/content/concepts/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ T> webpack 1 requires a specific loader to convert ES2015 `import`, however this
webpack supports modules written in a variety of languages and preprocessors, via _loaders_. _Loaders_ describe to webpack **how** to process non-JavaScript _modules_ and include these _dependencies_ into your _bundles_.
The webpack community has built _loaders_ for a wide variety of popular languages and language processors, including:

* [CoffeeScript](http://coffeescript.org)
* [CoffeeScript](https://coffeescript.org)
* [TypeScript](https://www.typescriptlang.org)
* [ESNext (Babel)](https://babeljs.io)
* [Sass](http://sass-lang.com)
* [Sass](https://sass-lang.com)
* [Less](http://lesscss.org)
* [Stylus](http://stylus-lang.com)

Expand Down
2 changes: 1 addition & 1 deletion src/content/concepts/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module.exports = {
//...
output: {
path: '/home/proj/cdn/assets/[hash]',
publicPath: 'http://cdn.example.com/assets/[hash]/'
publicPath: 'https://cdn.example.com/assets/[hash]/'
Copy link
Member

Choose a reason for hiding this comment

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

this change tho 🌝

}
};
```
Expand Down
4 changes: 2 additions & 2 deletions src/content/configuration/configuration-languages.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ webpack accepts configuration files written in multiple programming and data lan

## TypeScript

To write the webpack configuration in [TypeScript](http://www.typescriptlang.org/), you would first install the necessary dependencies:
To write the webpack configuration in [TypeScript](https://www.typescriptlang.org/), you would first install the necessary dependencies:

``` bash
npm install --save-dev typescript ts-node @types/node @types/webpack
Expand Down Expand Up @@ -90,7 +90,7 @@ __package.json__

## CoffeeScript

Similarly, to use [CoffeeScript](http://coffeescript.org/), you would first install the necessary dependencies:
Similarly, to use [CoffeeScript](https://coffeescript.org/), you would first install the necessary dependencies:

``` bash
npm install --save-dev coffee-script
Expand Down
2 changes: 1 addition & 1 deletion src/content/configuration/dev-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ webpack-dev-server --socket socket

## `devServer.staticOptions`

It is possible to configure advanced options for serving static files from `contentBase`. See the [Express documentation](http://expressjs.com/en/4x/api.html#express.static) for the possible options. An example:
It is possible to configure advanced options for serving static files from `contentBase`. See the [Express documentation](https://expressjs.com/en/4x/api.html#express.static) for the possible options. An example:

```js
module.exports = {
Expand Down
4 changes: 2 additions & 2 deletions src/content/guides/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ contributors:
- skipjack
---

Let's start by clearing up a common misconception. webpack is a module bundler like [Browserify](http://browserify.org/) or [Brunch](http://brunch.io/). It is _not a task runner_ like [Make](https://www.gnu.org/software/make/), [Grunt](https://gruntjs.com/), or [Gulp](https://gulpjs.com/). Task runners handle automation of common development tasks such as linting, building, or testing your project. Compared to bundlers, task runners have a higher level focus. You can still benefit from their higher level tooling while leaving the problem of bundling to webpack.
Let's start by clearing up a common misconception. webpack is a module bundler like [Browserify](http://browserify.org/) or [Brunch](https://brunch.io/). It is _not a task runner_ like [Make](https://www.gnu.org/software/make/), [Grunt](https://gruntjs.com/), or [Gulp](https://gulpjs.com/). Task runners handle automation of common development tasks such as linting, building, or testing your project. Compared to bundlers, task runners have a higher level focus. You can still benefit from their higher level tooling while leaving the problem of bundling to webpack.

Bundlers help you get your JavaScript and stylesheets ready for deployment, transforming them into a format that's suitable for the browser. For example, JavaScript can be [minified](/plugins/uglifyjs-webpack-plugin) or [split into chunks](/guides/code-splitting) and [lazy-loaded](/guides/lazy-loading) to improve performance. Bundling is one of the most important challenges in web development, and solving it well can remove a lot of pain from the process.

Expand Down Expand Up @@ -96,7 +96,7 @@ For more information, please visit the [repository](https://github.com/zinserjan

## Karma

The [`karma-webpack`](https://github.com/webpack-contrib/karma-webpack) package allows you to use webpack to pre-process files in [Karma](http://karma-runner.github.io/1.0/index.html). It also makes use of [`webpack-dev-middleware`](https://github.com/webpack/webpack-dev-middleware) and allows passing configurations for both. A simple example may look something like this:
The [`karma-webpack`](https://github.com/webpack-contrib/karma-webpack) package allows you to use webpack to pre-process files in [Karma](https://karma-runner.github.io/1.0/index.html). It also makes use of [`webpack-dev-middleware`](https://github.com/webpack/webpack-dev-middleware) and allows passing configurations for both. A simple example may look something like this:

``` bash
npm install --save-dev webpack karma karma-webpack
Expand Down
2 changes: 1 addition & 1 deletion src/content/guides/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ See the [devtool documentation](/configuration/devtool/) for more information.

## Using Third Party Libraries

When installing third party libraries from npm, it is important to remember to install the typing definition for that library. These definitions can be found at [TypeSearch](http://microsoft.github.io/TypeSearch/).
When installing third party libraries from npm, it is important to remember to install the typing definition for that library. These definitions can be found at [TypeSearch](https://microsoft.github.io/TypeSearch/).

For example if we want to install lodash we can run the following command to get the typings for it:

Expand Down
2 changes: 1 addition & 1 deletion src/content/plugins/define-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ Use a different service URL in production/development builds:

```javascript
new webpack.DefinePlugin({
'SERVICE_URL': JSON.stringify('http://dev.example.com')
'SERVICE_URL': JSON.stringify('https://dev.example.com')
Copy link
Member

Choose a reason for hiding this comment

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

This one seems unnecessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unnecessary, but showing a good example imo

Copy link
Member

Choose a reason for hiding this comment

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

Yeah

});
```
2 changes: 1 addition & 1 deletion src/content/plugins/source-map-dev-tool-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Set a URL for source maps. Useful for hosting them on a host that requires autho

```js
new webpack.SourceMapDevToolPlugin({
append: '\n//# sourceMappingURL=http://example.com/sourcemap/[url]',
append: '\n//# sourceMappingURL=https://example.com/sourcemap/[url]',
filename: '[name].map'
});
```
Expand Down
50 changes: 0 additions & 50 deletions src/scripts/check-links.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/utilities/fetch-package-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function fetchPackageFiles(options, cb) {
.then(body => {
// modify README to fit page structure in site
if (body && file === 'README.md') {
body = processReadme(body);
body = processReadme(body, { source: url });
}

let title = pkg.name;
Expand Down
7 changes: 6 additions & 1 deletion src/utilities/process-readme.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = function processREADME(body) {
const Url = require('url');
Copy link
Member

Choose a reason for hiding this comment

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

Please use url


module.exports = function processREADME(body, options = {}) {
return body
.replace(/[^]*?<div align="center">([^]*?)<\/div>/, (match, content) => {
let parsed = content.match(/<p>([^]*?)<\/?p>/);
Expand All @@ -11,6 +13,9 @@ module.exports = function processREADME(body) {
// Modify links to keep them within the site
.replace(/https?:\/\/github.com\/(webpack|webpack-contrib)\/([-A-za-z0-9]+-loader\/?)([)"])/g, '/loaders/$2/$3')
.replace(/https?:\/\/github.com\/(webpack|webpack-contrib)\/([-A-za-z0-9]+-plugin\/?)([)"])/g, '/plugins/$2/$3')
// Replace local github links with absolute links to the github location
// EXAMPLE: [Contributing](./.github/CONTRIBUTING.md)
.replace(/\[([^\]]*)\]\((\.[^)]+)\)/g, (markdownLink, content, href) => `[${content}](${Url.resolve(options.source, href)})`)
// Replace any <h2> with `##`
.replace(/<h2[^>]*>/g, '## ')
.replace(/<\/h2>/g, '')
Expand Down