Skip to content

Commit 90964d2

Browse files
authored
Merge pull request #475 from primer/import-primer-module-build
Import primer-module-build to the monorepo
2 parents bd4a414 + ff07c6d commit 90964d2

File tree

17 files changed

+254
-8
lines changed

17 files changed

+254
-8
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ env:
1212
- secure: "KcGydAqL7ryDh2rTJJB4wU8NE5BRtnrRXDEcPBScSscO3zFsHXHBDvvO04B/9hFVatXzGYXmkn+FZ0P9QikhvebzdwwyqUG2SKFiHhMvbX0m0WtAhn5NqDuKU1r5qy5YQ18r/tiLfC9GSAlEpfLAH58pwpcn8srV3Mn/yKvlrfs="
1313

1414
script:
15-
- cd meta/scoreboard; npm install; npm test
1615
- npm test
1716

1817
after_success:

lerna.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"lerna": "2.4.0",
33
"packages": [
4+
"meta/*",
45
"modules/*",
56
"tools/*"
67
],

meta/scoreboard/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"private": true,
3+
"name": "primer-scorecard",
34
"scripts": {
45
"test": "node index.js"
56
},

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
"test": "npm run test-all-modules && lerna run test",
2121
"test-all-modules": "ava --verbose tests/test-*.js"
2222
},
23+
"dependencies": {
24+
"primer-module-build": "file:tools/primer-module-build",
25+
"stylelint-config-primer": "file:tools/stylelint-config-primer"
26+
},
2327
"devDependencies": {
2428
"@storybook/addon-options": "^3.2.6",
2529
"@storybook/react": "^3.2.12",
@@ -30,7 +34,7 @@
3034
"babel-preset-react": "^6.24.1",
3135
"commit-status": "^4.1.0",
3236
"css-loader": "^0.28.4",
33-
"execa": "^0.8.0",
37+
"execa": "^0.10.0",
3438
"fs-extra": "^4.0.2",
3539
"gh-pages": "^1.0.0",
3640
"glob": "^7.1.2",
@@ -40,12 +44,12 @@
4044
"lerna": "2.4.0",
4145
"lerna-changelog": "^0.7.0",
4246
"minimatch": "^3.0.4",
43-
"node-sass": "^4.5.3",
47+
"node-sass": "^4.9.0",
4448
"npm-run-all": "^4.0.2",
49+
"npx": "^10.2.0",
4550
"octicons": "^6.0.1",
4651
"parse-pairs": "^0.2.2",
4752
"postcss-loader": "^2.0.6",
48-
"primer-module-build": "^1.0.2",
4953
"raw-loader": "^0.5.1",
5054
"react": "^15.6.1",
5155
"react-dom": "^15.6.1",
@@ -55,7 +59,6 @@
5559
"semver": "^5.3.0",
5660
"style-loader": "^0.18.2",
5761
"stylelint": "^7.13.0",
58-
"stylelint-config-primer": "^2.0.0",
5962
"unist-util-find-before": "^2.0.1",
6063
"unist-util-parents": "^1.0.0",
6164
"unist-util-select": "^1.5.0",

script/lint-scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22
set -e
3-
$(dirname $0)/npm-run stylelint --quiet --syntax scss **/*.scss
3+
npx stylelint --quiet --syntax scss **/*.scss

script/npm-run-all

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22
set -e
3-
$(dirname $0)/npm-run npm-run-all --serial --silent "$@"
3+
npx npm-run-all --serial --silent "$@"

script/test-docs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22
set -e
3-
$(dirname $0)/npm-run ava --verbose $(dirname $0)/../tests/modules/test-document-styles.js "$@"
3+
npx ava --verbose $(dirname $0)/../tests/modules/test-document-styles.js "$@"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"plugins": [
3+
"eslint-plugin-github"
4+
],
5+
"env": {
6+
"es6": true,
7+
"node": true
8+
},
9+
"extends": [
10+
"plugin:github/recommended",
11+
"plugin:github/es6"
12+
]
13+
}
14+

tools/primer-module-build/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2018 GitHub Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

tools/primer-module-build/cli.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env node
2+
'use strict'
3+
/* eslint-disable no-console */
4+
const meow = require('meow')
5+
const build = require('./')
6+
7+
const cli = meow(`
8+
Usage
9+
$ primer-module-build [file]
10+
11+
File
12+
File. This is required. The file input is the .scss file that
13+
will be built into .css. The build automatically looks in the
14+
node_modules/ directory for any inputs.
15+
16+
Example
17+
$ primer-module-build index.scss
18+
`)
19+
20+
build(cli)
21+
.then(files => {
22+
console.warn('YES! wrote %d files:', files.length)
23+
for (const file of files) console.warn(file)
24+
process.exit(0)
25+
})
26+
.catch(err => {
27+
console.error('NO:', err)
28+
process.exit(1)
29+
})

0 commit comments

Comments
 (0)