Skip to content

Commit b934f2b

Browse files
committed
Config documentation
1 parent 7eec61f commit b934f2b

File tree

10 files changed

+93
-78
lines changed

10 files changed

+93
-78
lines changed

config/alerts.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ let emoji = require('node-emoji');
66
let chalk = require('chalk');
77

88
/**
9-
* Config
9+
* Alert configuration
10+
*
11+
* @type {Object}
1012
*/
11-
1213
module.exports = {
1314
/**
14-
* Node Emoji
15+
* Node Emoji. Refer to the package for details on the available options.
1516
*
16-
* @param {String} Source https://github.com/omnidan/node-emoji
17-
* @param {String} Dict https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json
17+
* @source https://github.com/omnidan/node-emoji
18+
* @source https://raw.githubusercontent.com/omnidan/node-emoji/master/lib/emoji.json
1819
*/
1920
styles: emoji.get('nail_care'),
2021
scripts: emoji.get('rainbow'),
@@ -30,11 +31,16 @@ module.exports = {
3031
compression: emoji.get('compression') + ' ',
3132
package: emoji.get('package'),
3233
accessible: emoji.get('person_doing_cartwheel'),
34+
3335
/**
34-
* Chalk string coloring functions
36+
* Chalk configuration. Refer to the package for details on the available
37+
* options. The current color selection is based on the NYC Opportunity
38+
* brand colors.
39+
*
40+
* @source https://github.com/chalk/chalk
41+
* @source https://nycopatterns.cityofnewyork.us/colors
3542
*
36-
* @param {String} Source https://github.com/chalk/chalk
37-
* @param {String} Colors https://nycopatterns.cityofnewyork.us/colors
43+
* @type {Object}
3844
*/
3945
str: {
4046
path: s => chalk.hex('#FFC0F6').underline(s), // pink

config/global.js

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/**
2-
* Global Configuration
2+
* Global configuration
33
*
44
* @type {Object}
55
*/
66
module.exports = {
77
/**
8-
* Main Project Directories
8+
* Main project directories
99
*
1010
* @type {String}
1111
*/
@@ -14,7 +14,8 @@ module.exports = {
1414
dist: 'dist',
1515

1616
/**
17-
* Project Entrypoints
17+
* Project entrypoints. These are used by other files to determine defaults.
18+
* They must also have a reference in the directories configuration below.
1819
*
1920
* @type {Object}
2021
*/
@@ -28,15 +29,17 @@ module.exports = {
2829
},
2930

3031
/**
31-
* Directories to scaffold
32+
* Directories to scaffold. The scaffold command will create the filesystem
33+
* configured here and use files in the ./scaffold directory as the contents
34+
* for files described here.
3235
*
3336
* @type {Object}
3437
*/
3538
directories: [
3639
/**
37-
* Configuration Path(s)
40+
* Configuration path(s)
3841
*
39-
* @type {Object}
42+
* @type {Object}
4043
*/
4144
{
4245
__dirname: 'config',
@@ -49,7 +52,7 @@ module.exports = {
4952
},
5053

5154
/**
52-
* Distribution Directory
55+
* Distribution directory
5356
*
5457
* @type {Object}
5558
*/
@@ -58,7 +61,7 @@ module.exports = {
5861
},
5962

6063
/**
61-
* Source and Patterns path(s)/naming
64+
* Source and patterns path(s)/naming
6265
*
6366
* @type {Object}
6467
*/
@@ -173,14 +176,14 @@ module.exports = {
173176
}
174177
],
175178

176-
/**
177-
* Default arguments
178-
*
179-
* @type {Object}
180-
*/
181-
args: {
182-
notifications: '', // '--nondescript -nd' or '--silent'
183-
linting: '', // '--no-lint -nl'
184-
pa11y: '', // '--no-pa11y -np'
185-
}
179+
// /**
180+
// * Default arguments
181+
// *
182+
// * @type {Object}
183+
// */
184+
// args: {
185+
// notifications: '', // '--nondescript -nd' or '--silent'
186+
// linting: '', // '--no-lint -nl'
187+
// pa11y: '', // '--no-pa11y -np'
188+
// }
186189
};

config/lint.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
/**
2+
* Lint configuration
3+
*
4+
* @type {Object}
5+
*/
16
module.exports = {
27
/**
3-
* ES Lint Configuration
8+
* ESLint configuration. Refer to the package for details on the available options.
49
*
5-
* @param {String} url https://eslint.org
10+
* @source https://eslint.org/docs/user-guide/configuring
11+
* @source https://github.com/google/eslint-config-google
12+
*
13+
* @type {Object}
614
*/
715
eslint: {
816
extends: 'google',
@@ -24,17 +32,21 @@ module.exports = {
2432
]
2533
}
2634
},
35+
2736
/**
28-
* Stylelint
37+
* stylelint configuration. Refer to the package for details on the available options.
38+
*
39+
* @source https://stylelint.io/user-guide/configure
2940
*
30-
* @param {String} url https://stylelint.io
41+
* @type {Object}
3142
*/
3243
stylelint: {
3344
extends: 'stylelint-config-standard',
3445
rules: {
46+
'color-hex-case': 'upper',
3547
'no-missing-end-of-source-newline': null,
3648
'at-rule-no-unknown': [true, {
37-
'ignore': ['use', 'tailwind']
49+
'ignoreAtRules': ['use', 'forward', 'tailwind']
3850
}]
3951
}
4052
}

config/make.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const alerts = resolve('config/alerts');
1010
/**
1111
* Templates
1212
*
13-
* Templates are stored in the config/make directory. These are the templates
13+
* Templates are stored in the ./config/make directory. These are the templates
1414
* used for the different filetypes. There are a few template variables that
1515
* are interpolated in by the make.js script;
1616
*
@@ -45,7 +45,7 @@ const dirs = {
4545
};
4646

4747
/**
48-
* Make Configuration
48+
* Make configuration
4949
*
5050
* @type {Object}
5151
*/

config/pa11y.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/**
2-
* Configuration options for pa11y
2+
* Pa11y configuration. Refer to the package for details on the available options.
33
*
4-
* @param {String} url https://github.com/pa11y/pa11y#configuration
4+
* @source https://github.com/pa11y/pa11y#configuration
5+
*
6+
* @type {Object}
57
*/
68
module.exports = {
79
standard: 'WCAG2AA',

config/postcss.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ const resolve = require(path.join(__dirname, '../', 'bin/util/resolve'));
77
const installed = require(path.join(__dirname, '../', 'bin/util/installed'));
88

99
/**
10-
* PostCSS Plugins
10+
* PostCSS plugins. This is where most of the configuration for PostCSS is
11+
* handled. Refer to the PostCSS docs for details and available plugins.
12+
*
13+
* @source https://github.com/postcss/postcss#plugins
1114
*
1215
* @type {Array}
1316
*/
@@ -16,7 +19,7 @@ let plugins = [
1619
];
1720

1821
/**
19-
* Check for tailwindcss
22+
* Check for the tailwindcss package
2023
*/
2124

2225
if (installed('tailwindcss')) {
@@ -27,7 +30,7 @@ if (installed('tailwindcss')) {
2730
}
2831

2932
/**
30-
* PostCSS Configuration
33+
* PostCSS configuration.
3134
*
3235
* @type {Object}
3336
*/

config/slm.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports = {
1717
src: global.src, // Base source directory for all possible slm files
1818
dist: global.dist, // Distribution for slm files
1919
views: global.entry.views, // View directory within source directory ^
20+
2021
/**
2122
* Options to pass to the marked package
2223
*
@@ -27,6 +28,7 @@ module.exports = {
2728
headerIds: true,
2829
smartypants: true
2930
},
31+
3032
/**
3133
* Options to pass to the JS Beautify package for formatting html
3234
*
@@ -41,6 +43,7 @@ module.exports = {
4143
wrap_line_length: 0,
4244
indent_inner_html: false
4345
},
46+
4447
/**
4548
* The following objects are locals passed to the slm view render and
4649
* are accessed via control codes. For example, in a .slm template;

config/svgs.js

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,51 +15,20 @@ module.exports = {
1515
src: `${global.src}/svg`, // svg source
1616
dist: `${global.dist}/svg`, // svg distribution
1717
prefix: 'pttrn-', // Prefix to prepend to optimized svgs
18+
1819
/**
1920
* Plugin options for SVGO
2021
*
21-
* @param {String} source https://github.com/svg/svgo#what-it-can-do
22+
* @source https://github.com/svg/svgo#what-it-can-do
2223
*/
2324
svgo: {
2425
convertPathData: false,
25-
// cleanupAttrs: true,
26-
// removeDoctype: true,
27-
// removeXMLProcInst: true,
28-
// removeComments: true,
29-
// removeMetadata: true,
30-
// removeTitle: true,
31-
// removeDesc: true,
32-
// removeUselessDefs: true,
33-
// removeEditorsNSData: true,
34-
// removeEmptyAttrs: true,
35-
// removeHiddenElems: true,
36-
// removeEmptyText: true,
37-
// removeEmptyContainers: true,
38-
// removeViewBox: false,
39-
// cleanupEnableBackground: true,
40-
// convertStyleToAttrs: true,
41-
// convertColors: true,
42-
// convertTransform: true,
43-
// removeUnknownsAndDefaults: true,
44-
// removeNonInheritableGroupAttrs: true,
45-
// removeUselessStrokeAndFill: true,
46-
// removeUnusedNS: true,
47-
// cleanupIDs: true,
48-
// cleanupNumericValues: true,
49-
// moveElemsAttrsToGroup: true,
50-
// moveGroupAttrsToElems: true,
51-
// collapseGroups: true,
52-
// removeRasterImages: false,
53-
// mergePaths: true,
54-
// convertShapeToPath: true,
55-
// sortAttrs: true,
56-
// removeDimensions: true,
57-
// removeAttrs: {attrs: '(stroke|fill)'}
5826
},
27+
5928
/**
6029
* Plugin options for svgstore
6130
*
62-
* @param {String} source https://github.com/svgstore/svgstore#options
31+
* @source https://github.com/svgstore/svgstore#options
6332
*/
6433
svgstore: {
6534
/** Filename of the sprite. It will not use the prefix defined above. */

config/tailwindcss.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
// const tokens = require('./tokens.js');
77

88
/**
9-
* Config
9+
* Tailwindcss Config
10+
*
11+
* @source https://tailwindcss.com/docs/configuration
12+
*
13+
* @type {Object}
1014
*/
11-
1215
module.exports = {};

config/tokens.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ const package = resolve('package.json');
1414
*/
1515
module.exports = {
1616
/**
17-
* Possiple options (and their defaults) to pass to json-to-scss
17+
* JSON-TO-SCSS configuration. Below possible options and their defaults are listed
1818
*
19-
* @type {Source} https://github.com/rlapoele/json-to-scss
19+
* @source https://github.com/rlapoele/json-to-scss
20+
*
21+
* @type {Mixed}
2022
*/
21-
output: `"${global.src}/${global.entry.config}/_tokens.scss"`,
23+
output: `"${path.join(global.base, global.src, global.entry.config, '_tokens.scss')}"`,
2224
// prefix: '"$tokens:"',
2325
// suffix: '"";""',
2426
// format: '".scss"',
@@ -31,6 +33,18 @@ module.exports = {
3133
// keys: 'auto',
3234
// values: 'auto',
3335
// stringKeys: '"family,font-family,fontfamily,font-stack,fontstack,font-face,fontface"',
36+
37+
/**
38+
* Design tokens. These can be custom values for your Sass library as well
39+
* as be values mapped directly to tokens in the Tailwindcss configuration.
40+
* CSS variables can also be used in the token configuration. Note, other
41+
* Tailwindcss configuration options, such as variants and modules should
42+
* be configured in the `tailwindcss` configuration.
43+
*
44+
* @source https://tailwindcss.com/docs/configuration
45+
*
46+
* @type {Mixed}
47+
*/
3448
'version': `"${package.version}"`,
3549
'border': {
3650
'width': '3px',

0 commit comments

Comments
 (0)