Skip to content

Commit fd37f67

Browse files
pierreneterskipjack
authored andcommitted
refactor(pwa): rename components and move code to /src (#1490)
Rename component directories, files and stylesheets. Move app specific code to a `/src` directory. Update all location dependent scripts. Resolve some linting issues -- it seems most of our content actually wasn't picked up by alex prior to these changes. This commit fixes/ignores the new warnings that cropped up.
1 parent 98e784b commit fd37f67

File tree

229 files changed

+162
-154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+162
-154
lines changed

.alexrc

+15-10
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,28 @@
22
"allow": [
33
"bigger",
44
"color",
5-
"lies",
5+
"colors",
6+
"crash",
7+
"dead",
8+
"dive",
69
"execute",
710
"executed",
811
"execution",
9-
"host-hostess",
12+
"dirty",
1013
"disabled",
11-
"crash",
14+
"failed",
1215
"failure",
13-
"period",
16+
"fire",
1417
"hook",
15-
"dirty",
1618
"host-hostess",
17-
"fire",
18-
"remains",
19+
"hosts",
1920
"jade",
20-
"failed",
21-
"white",
22-
"colors"
21+
"laid",
22+
"lies",
23+
"period",
24+
"pros",
25+
"reject",
26+
"remains",
27+
"white"
2328
]
2429
}

.gitignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ node_modules
22
npm-debug.log
33
build
44
generated
5-
components/support/support-backers.json
6-
components/support/support-sponsors.json
7-
components/starter-kits/starter-kits-data.json
5+
src/components/Support/support-backers.json
6+
src/components/Support/support-sponsors.json
7+
src/components/StarterKits/starter-kits-data.json
88
.antwar

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ language: node_js
66
node_js:
77
- "6"
88
script:
9-
- bash ./scripts/deploy.sh
9+
- bash ./src/scripts/deploy.sh
1010
sudo: required
1111
install:
1212
- npm install --global yarn

antwar.config.js

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
var _ = require('lodash');
22
var path = require('path');
33
var prevnextPlugin = require('antwar-prevnext-plugin');
4-
var markdown = require('./utilities/markdown');
5-
var highlight = require('./utilities/highlight');
4+
var markdown = require('./src/utilities/markdown');
5+
var highlight = require('./src/utilities/highlight');
66

77
module.exports = {
88
template: {
@@ -26,13 +26,13 @@ module.exports = {
2626
prevnextPlugin()
2727
],
2828
layout: function() {
29-
return require('./components/site/site.jsx').default
29+
return require('./src/components/Site/Site.jsx').default
3030
},
3131
paths: {
3232
'/': root(
3333
function() {
3434
return require.context(
35-
'json-loader!yaml-frontmatter-loader!./content',
35+
'json-loader!yaml-frontmatter-loader!./src/content',
3636
false,
3737
/^\.\/.*\.md$/
3838
);
@@ -51,7 +51,7 @@ module.exports = {
5151
'Concepts',
5252
function() {
5353
return require.context(
54-
'json-loader!yaml-frontmatter-loader!./content/concepts',
54+
'json-loader!yaml-frontmatter-loader!./src/content/concepts',
5555
false,
5656
/^\.\/.*\.md$/
5757
);
@@ -62,7 +62,7 @@ module.exports = {
6262
'Guides',
6363
function() {
6464
return require.context(
65-
'json-loader!yaml-frontmatter-loader!./content/guides',
65+
'json-loader!yaml-frontmatter-loader!./src/content/guides',
6666
true,
6767
/^\.\/.*\.md$/
6868
);
@@ -80,15 +80,15 @@ module.exports = {
8080
'guides/starter-kits': {
8181
title: 'Starter Kits',
8282
path() {
83-
return require('./components/starter-kits/starter-kits.jsx').default;
83+
return require('./src/components/StarterKits/StarterKits.jsx').default;
8484
}
8585
},
8686

8787
development: section(
8888
'Development',
8989
function() {
9090
return require.context(
91-
'json-loader!yaml-frontmatter-loader!./content/development',
91+
'json-loader!yaml-frontmatter-loader!./src/content/development',
9292
true,
9393
/^\.\/.*\.md$/
9494
);
@@ -99,7 +99,7 @@ module.exports = {
9999
'Configuration',
100100
function() {
101101
return require.context(
102-
'json-loader!yaml-frontmatter-loader!./content/configuration',
102+
'json-loader!yaml-frontmatter-loader!./src/content/configuration',
103103
false,
104104
/^\.\/.*\.md$/
105105
);
@@ -112,7 +112,7 @@ module.exports = {
112112
'API',
113113
function() {
114114
return require.context(
115-
'json-loader!yaml-frontmatter-loader!./content/api',
115+
'json-loader!yaml-frontmatter-loader!./src/content/api',
116116
false,
117117
/^\.\/.*\.md$/
118118
);
@@ -125,7 +125,7 @@ module.exports = {
125125
'API',
126126
function() {
127127
return require.context(
128-
'json-loader!yaml-frontmatter-loader!./content/api/plugins',
128+
'json-loader!yaml-frontmatter-loader!./src/content/api/plugins',
129129
false,
130130
/^\.\/.*\.md$/
131131
);
@@ -144,7 +144,7 @@ module.exports = {
144144
'Loaders',
145145
function() {
146146
const content = require.context(
147-
'json-loader!yaml-frontmatter-loader!./content/loaders',
147+
'json-loader!yaml-frontmatter-loader!./src/content/loaders',
148148
false,
149149
/^\.\/.*\.md$/
150150
);
@@ -161,7 +161,7 @@ module.exports = {
161161
'Plugins',
162162
function() {
163163
const content = require.context(
164-
'json-loader!yaml-frontmatter-loader!./content/plugins',
164+
'json-loader!yaml-frontmatter-loader!./src/content/plugins',
165165
false,
166166
/^\.\/.*\.md$/
167167
);
@@ -178,7 +178,7 @@ module.exports = {
178178
'Support',
179179
function() {
180180
return require.context(
181-
'json-loader!yaml-frontmatter-loader!./content/support',
181+
'json-loader!yaml-frontmatter-loader!./src/content/support',
182182
false,
183183
/^\.\/.*\.md$/
184184
);
@@ -187,25 +187,25 @@ module.exports = {
187187

188188
vote: {
189189
path() {
190-
return require('./components/vote/list.jsx').default
190+
return require('./src/components/Vote/List.jsx').default
191191
}
192192
},
193193

194194
'vote/feedback': {
195195
path() {
196-
return require('./components/vote/list.jsx').default
196+
return require('./src/components/Vote/List.jsx').default
197197
}
198198
},
199199

200200
'vote/moneyDistribution': {
201201
path() {
202-
return require('./components/vote/list.jsx').default
202+
return require('./src/components/Vote/List.jsx').default
203203
}
204204
},
205205

206206
organization: {
207207
path() {
208-
return require('./components/organization/organization.jsx').default
208+
return require('./src/components/Organization/Organization.jsx').default
209209
}
210210
}
211211
}
@@ -220,10 +220,10 @@ function root(contentCb) {
220220
processPage: processPage(), // Process individual page (url, content)
221221
layouts: { // Layouts (page/section)
222222
index: function() {
223-
return require('./components/splash/splash.jsx').default
223+
return require('./src/components/Splash/Splash.jsx').default
224224
},
225225
page: function() {
226-
return require('./components/page/page.jsx').default
226+
return require('./src/components/Page/Page.jsx').default
227227
}
228228
},
229229
redirects: {} // Redirects <from>: <to>
@@ -242,10 +242,10 @@ function section(title, contentCb, redirects = {}) {
242242
processPage: processPage(),
243243
layouts: {
244244
index: function() {
245-
return require('./components/page/page.jsx').default
245+
return require('./src/components/Page/Page.jsx').default
246246
},
247247
page: function() {
248-
return require('./components/page/page.jsx').default
248+
return require('./src/components/Page/Page.jsx').default
249249
}
250250
},
251251
redirects: redirects // <from>: <to>

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
"build": "npm run init:generated && npm run fetch && rm -rf build/ && node ./bootstrap.js && npm run sitemap && echo webpack.js.org > build/CNAME",
2929
"build-test": "npm run build && http-server build/",
3030
"deploy": "gh-pages -d build",
31-
"fetch": "scripts/fetch.sh",
31+
"fetch": "bash src/scripts/fetch.sh",
3232
"init:generated": "mkdirp ./generated/loaders && mkdirp ./generated/plugins ",
3333
"lint": "run-s lint:*",
34-
"lint:links": "hyperlink -r build/index.html --canonicalroot https://webpack.js.org/ | ./scripts/check-links.js",
34+
"lint:links": "hyperlink -r build/index.html --canonicalroot https://webpack.js.org/ | node ./src/scripts/check-links.js",
3535
"lint:js": "eslint . --ext .js --ext .jsx",
36-
"lint:markdown": "markdownlint --config ./.markdownlint.json *.md ./content/**/*.md",
36+
"lint:markdown": "markdownlint --config ./.markdownlint.json *.md ./src/content/**/*.md",
3737
"lint:social": "alex ./**/*.md",
38-
"lint:prose": "cp .proselintrc ~/ && proselint content",
38+
"lint:prose": "cp .proselintrc ~/ && proselint src/content",
3939
"test": "npm run lint",
4040
"sitemap": "cd build && sitemap-static --prefix=https://webpack.js.org/ > sitemap.xml"
4141
},

scripts/fetch.sh

-23
This file was deleted.
File renamed without changes.
File renamed without changes.

assets/by.svg src/assets/by.svg

File renamed without changes.

assets/cc.svg src/assets/cc.svg

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

components/contributors/contributors.jsx src/components/Contributors/Contributors.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import './contributors-style';
2+
import './Contributors.scss';
33

44
export default ({contributors}) => {
55
if (!contributors.length) {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

components/footer/footer.jsx src/components/Footer/Footer.jsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from 'react';
2-
import Link from '../link/link';
3-
import Container from '../container/container';
2+
import Link from '../Link/Link';
3+
import Container from '../Container/Container';
44
import Icon from '../../assets/icon-square-small.svg';
55
import CC from '../../assets/cc.svg';
66
import BY from '../../assets/by.svg';
7-
import './footer-style';
7+
import './Footer.scss';
88

99
export default (props) => {
1010
return (
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

components/navigation/navigation.jsx src/components/Navigation/Navigation.jsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react';
2-
import Link from '../link/link';
3-
import Container from '../container/container';
4-
import Logo from '../logo/logo';
5-
import Dropdown from '../dropdown/dropdown';
2+
import Link from '../Link/Link';
3+
import Container from '../Container/Container';
4+
import Logo from '../Logo/Logo';
5+
import Dropdown from '../Dropdown/Dropdown';
66

77
// TODO: Maybe by updating the routing scheme later on we can avoid hardcoding this?
88
let Sections = [
File renamed without changes.

components/notification-bar/notification-bar.jsx src/components/NotificationBar/NotificationBar.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import Container from '../container/container';
2+
import Container from '../Container/Container';
33
import testLocalStorage from '../../utilities/test-local-storage';
44

55
const version = '1';

components/organization/organization.jsx src/components/Organization/Organization.jsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from 'react';
2-
import Container from '../container/container';
3-
import Contributors from '../contributors/contributors';
4-
import Link from '../link/link';
5-
import Shield from '../shield/shield';
2+
import Container from '../Container/Container';
3+
import Contributors from '../Contributors/Contributors';
4+
import Link from '../Link/Link';
5+
import Shield from '../Shield/Shield';
66
import Items from './projects.json';
7-
import './organization-style';
7+
import './Organization.scss';
88

99
export default props => {
1010
return (

components/page/page.jsx src/components/Page/Page.jsx

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import React from 'react';
22
import Interactive from 'antwar-interactive';
3-
import Container from '../container/container';
4-
import Sidebar from '../sidebar/sidebar';
5-
import PageLinks from '../page-links/page-links';
6-
import Gitter from '../gitter/gitter';
7-
import Contributors from '../contributors/contributors';
8-
import Sponsors from '../sponsors/sponsors';
9-
import './page-style';
10-
import '../sidebar/sidebar-style';
11-
import '../sponsors/sponsors-style';
12-
import '../gitter/gitter-style';
3+
import Container from '../Container/Container';
4+
import Sidebar from '../Sidebar/Sidebar';
5+
import PageLinks from '../PageLinks/PageLinks';
6+
import Gitter from '../Gitter/Gitter';
7+
import Contributors from '../Contributors/Contributors';
8+
import Sponsors from '../Sponsors/Sponsors';
9+
import './Page.scss';
10+
import '../Sidebar/Sidebar.scss';
11+
import '../Sponsors/Sponsors.scss';
12+
import '../Gitter/Gitter.scss';
1313

1414
export default ({ section, page }) => (
1515
<Container className="page">
1616

1717
<Sponsors />
1818

1919
<Interactive
20-
id="components/sidebar/sidebar.jsx"
20+
id="src/components/Sidebar/Sidebar.jsx"
2121
component={ Sidebar }
2222
sectionName={ section.name }
2323
pages={ section.pages().map(page => ({
@@ -65,7 +65,7 @@ export default ({ section, page }) => (
6565
) : null }
6666

6767
<Interactive
68-
id="components/gitter/gitter.jsx"
68+
id="src/components/Gitter/Gitter.jsx"
6969
component={ Gitter } />
7070
</section>
7171
</Container>
File renamed without changes.

components/page-links/page-links.jsx src/components/PageLinks/PageLinks.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React from 'react';
22
import TrimEnd from 'lodash/trimEnd';
3-
import './page-links-style';
3+
import './PageLinks.scss';
44

55
export default ({
66
section = '',
77
page = {}
88
}) => {
9-
let baseURL = 'https://github.com/webpack/webpack.js.org/edit/master/content';
9+
let baseURL = 'https://github.com/webpack/webpack.js.org/edit/master/src/content';
1010
let indexPath = page.type === 'index' ? '/index' : '';
1111
let mainPath = page.url.startsWith('/') ? page.url : `/${page.url}`;
1212
let editLink = page.edit || baseURL + TrimEnd(mainPath, '/') + indexPath + '.md';
File renamed without changes.

components/sidebar/sidebar.jsx src/components/Sidebar/Sidebar.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react';
2-
import Shield from '../shield/shield';
3-
import SidebarItem from '../sidebar-item/sidebar-item';
2+
import Shield from '../Shield/Shield';
3+
import SidebarItem from '../SidebarItem/SidebarItem';
44

55
export default class Sidebar extends Component {
66
constructor(props) {
File renamed without changes.

0 commit comments

Comments
 (0)