-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #648 from rei/next
Fall 2019 Release (next => master)
- Loading branch information
Showing
454 changed files
with
12,327 additions
and
13,294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ backstop_data/html_report/ | |
src/**/__tests__/*.spec.js | ||
src/**/dist/*.js | ||
|
||
|
||
src/components/icon/comps/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,57 @@ | ||
// babelrc cooy | ||
// { | ||
// "presets": [ | ||
// [ | ||
// "env", | ||
// { | ||
// "modules": false | ||
// } | ||
// ], | ||
// "stage-2" | ||
// ], | ||
// "plugins": [ | ||
// "transform-runtime" | ||
// ], | ||
// "comments": false, | ||
// "env": { | ||
// "test": { | ||
// "presets": [ | ||
// "env", | ||
// "stage-2" | ||
// ], | ||
// "plugins": [ | ||
// "istanbul" | ||
// ] | ||
// } | ||
// } | ||
// } | ||
|
||
/* eslint-disable */ | ||
|
||
module.exports = function (api) { | ||
|
||
const env = process.env.NODE_ENV; | ||
const babelEnv = process.env.BABEL_ENV; | ||
|
||
api.cache(true); | ||
|
||
// TODO: refactor to use babel `env` API here instead | ||
|
||
const targets = env === 'test' ? | ||
{ | ||
node: 'current', | ||
} : | ||
{ | ||
browsers: [ | ||
'Chrome >= 70', | ||
'Firefox > 64', | ||
'iOS > 11', | ||
'Safari >= 9', | ||
'Explorer >= 11', | ||
'Edge >= 15', | ||
], | ||
}; // TODO: pull @rei browserslist instead | ||
|
||
const presetEnvConfig = (env === 'prod') ? | ||
{ | ||
modules: false, // TODO: cjs settings? | ||
} : | ||
{ | ||
targets | ||
} | ||
|
||
const presets = [ | ||
[ | ||
"@babel/preset-env", | ||
presetEnvConfig, | ||
], | ||
"@vue/babel-preset-jsx" | ||
]; | ||
|
||
const plugins = [ | ||
[ | ||
"@babel/plugin-transform-runtime", | ||
{ | ||
corejs: "3", | ||
useBuiltIns: "usage" | ||
"corejs": 3, | ||
"useESModules": babelEnv === 'esm', | ||
} | ||
] | ||
]; | ||
const plugins = ['@babel/plugin-transform-runtime']; | ||
|
||
return { | ||
presets, | ||
plugins | ||
plugins, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const sass = require('node-sass'); | ||
const packageImporter = require('node-sass-package-importer'); | ||
const fs = require('fs-extra'); | ||
|
||
sass.render({ | ||
file: `./src/css/fonts.scss`, | ||
// outputStyle: 'compressed', | ||
importer: packageImporter(), | ||
}, (err, result) => { | ||
if (err) console.log('error:', err); | ||
else { | ||
fs.outputFileSync('./static/cdr-fonts.css', result.css.toString(), 'utf-8'); | ||
console.log('Succesfully built static/cdr-fonts.css'); | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
const path = require('path'); | ||
const fs = require('fs-extra'); | ||
const glob = require('glob'); | ||
const cedarPackageJson = require('../package.json'); | ||
const variablesPackageJson = require('../../rei-cedar-component-variables/package.json'); | ||
|
||
const DEST_REPO_NAME = 'rei-cedar-component-variables'; | ||
const DEST_PATH = 'dist/scss'; | ||
const SUPPORTED_COMPONENTS = [ | ||
/* global vars */ | ||
'options.vars.scss', | ||
/* component vars */ | ||
'CdrButton.vars.scss', | ||
'CdrLink.vars.scss', | ||
'form-label.vars.scss', | ||
'CdrInput.vars.scss', | ||
'CdrSelect.vars.scss', | ||
'CdrCta.vars.scss', | ||
'CdrList.vars.scss' | ||
]; | ||
|
||
const destMixinsDir = path.join(__dirname, `../../${DEST_REPO_NAME + path.sep + DEST_PATH}`); | ||
|
||
// get vars files | ||
const files = glob.sync('./**/*.vars.scss', { ignore: ['../**/node_modules/**'] }); | ||
|
||
// copy vars files | ||
files.forEach((f) => { | ||
const fname = path.basename(f).replace(/^_/, ''); // remove `_` prefix from global vars files | ||
if (!SUPPORTED_COMPONENTS.includes(fname)) return console.log(`skipping ${fname}`); | ||
const outDest = `${destMixinsDir}/${fname}`; | ||
fs.copySync(f, outDest); | ||
console.log(`copied ${fname} to ${outDest}`) | ||
}); | ||
|
||
/* iterate over SUPPORTED_COMPONENTS to ensure that vars are loaded in correct order */ | ||
const indexFile = SUPPORTED_COMPONENTS.map(fname => `@import "./${fname}";`).join('\n'); | ||
const singleFile = SUPPORTED_COMPONENTS.map(fname => fs.readFileSync(`${destMixinsDir}/${fname}`, 'utf8')).join('\n'); | ||
|
||
fs.outputFileSync(`${destMixinsDir}/index.scss`, indexFile); | ||
fs.outputFileSync(`${destMixinsDir}/cedar-component-variables.scss`, singleFile); | ||
|
||
// update cedar and cdr-tokens versions in component-variables | ||
|
||
const cedarVersion = cedarPackageJson.version; | ||
const tokenVersion = cedarPackageJson.devDependencies['@rei/cdr-tokens']; | ||
|
||
console.log('updating component-variables peerDependencies', { cedarVersion, tokenVersion, currentPeerDeps: variablesPackageJson.peerDependencies }, ) | ||
variablesPackageJson.peerDependencies['@rei/cdr-tokens'] = tokenVersion; | ||
variablesPackageJson.peerDependencies['@rei/cedar'] = cedarVersion; | ||
fs.outputFileSync('../../rei-cedar-component-variables/package.json', JSON.stringify(variablesPackageJson)); |
Oops, something went wrong.