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

Lines changed: 15 additions & 10 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 22 additions & 22 deletions
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 0 additions & 23 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)