Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues and cleanup #16

Merged
merged 10 commits into from
Feb 26, 2020
11 changes: 7 additions & 4 deletions bin/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,15 @@ const formatTemplateFileContents = (content, { name }) => {
const lowerKebabCaseName = lowerKebabCase(name);
// name to UpperCamelCase (e.g. text-input -> TextInput)
const upperCamelCaseName = upperCamelCase(name);
// gets git username from ./gitconfig
const userName = require('git-user-name');
// gets git email from ./gitconfig
const userEmail = require('git-user-email');
const replacements = [
{ regex: /\[name\]/g, value: lowerKebabCaseName },
{
regex: /\[Name\]/g,
value: upperCamelCaseName,
},
{ regex: /\[Name\]/g, value: upperCamelCaseName },
{ regex: /\[author\]/g, value: userName },
{ regex: /\[author-email\]/g, value: userEmail }
];

// replace all instances of [name] and [Name] accordingly
Expand Down
2,947 changes: 1,538 additions & 1,409 deletions package-lock.json

Large diffs are not rendered by default.

61 changes: 15 additions & 46 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@
},
"homepage": "https://github.com/AlaskaAirlines/ODS-WC-Generator#readme",
"dependencies": {
"arg": "^4.1.0",
"chalk": "^2.4.2",
"arg": "^4.1.3",
"chalk": "^3.0.0",
"latest-version": "^5.1.0"
},
"devDependencies": {
"@commitlint/cli": "^8.0.0",
"@commitlint/config-conventional": "^8.0.0",
"@semantic-release/changelog": "^3.0.4",
"@semantic-release/git": "^7.0.12",
"@semantic-release/npm": "^5.1.9",
"eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.0",
"husky": "^2.4.1",
"prettier": "^1.18.2",
"semantic-release": "^15.13.24"
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@semantic-release/changelog": "^3.0.6",
"@semantic-release/git": "^7.0.18",
"@semantic-release/npm": "^5.3.5",
"git-user-name": "^2.0.0",
"git-user-email": "git://github.com/codejamninja/git-user-email.git#npm",
"husky": "^4.2.3",
"npm-run-all": "^4.1.5",
"semantic-release": "^15.14.0"
},
"husky": {
"hooks": {
Expand All @@ -53,10 +53,10 @@
]
},
"scripts": {
"testbuild": "node bin/generate.js --test --name foo --dir ods-foo",
"destroybuild": "rm -rf ods-foo",
"testbuild": "node bin/generate.js --test --name foo --dir ./ods-foo",
"sweep": "rm -rf ods-foo",
"blanktest": "echo \"Error: no test specified\" && exit 0",
"test": "npm run testbuild || npm run destroybuild"
"test": "npm run testbuild"
},
"publishConfig": {
"access": "public"
Expand All @@ -66,10 +66,6 @@
"name": "Dale Sande",
"email": "dale.sande@alaskaair.com"
},
{
"name": "Kevin Sonnichsen",
"email": "kevin.sonnichsen@alaskaair.com"
},
{
"name": "Zach Newton",
"email": "zach.newton@alaskaair.com"
Expand Down Expand Up @@ -105,32 +101,5 @@
],
"@semantic-release/github"
]
},
"prettier": {
"singleQuote": true,
"trailingComma": "es5"
},
"eslintConfig": {
"extends": [
"eslint:recommended"
],
"plugins": [
"prettier"
],
"parserOptions": {
"ecmaVersion": 2018
},
"env": {
"node": true,
"jest": true,
"es6": true
},
"rules": {
"global-require": "off",
"semi": "warn",
"no-undef": "error",
"no-unused-vars": "warn",
"no-console": "warn"
}
}
}
7 changes: 1 addition & 6 deletions template/.travis.temp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ notifactions:

before_script:
- npm run buildTokens
- gulp processSrc
- gulp processImportsCanonical
- gulp processImportsVariable
- npm run stylefluxCanonical
- npm run stylefluxVariable
- gulp reprocessClean
- npm run processSrc
- npm run distTokens
- npm run sassRender
- npm run distJS
Expand Down
8 changes: 5 additions & 3 deletions template/demo/sass/style.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Import Auro tokens
@import "./node_modules/@alaskaairux/orion-design-tokens/dist/tokens/SCSSVariables";
@import "./node_modules/@alaskaairux/orion-design-tokens/dist/tokens/SassCustomProperties";

// Import generated Design Token variables
@import "./demo/sass/tokenVariables";
@import "./demo/sass/tokenProperties";
// Import deprecated Design Token variables to support Orion values
@import "./node_modules/@alaskaairux/orion-design-tokens/dist/tokens/tokenVariables";

// Import baseline library dependencies
// Mixins
Expand Down
128 changes: 14 additions & 114 deletions template/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,8 @@ const gulp = require('gulp'),
gulpautoprefixer = require('gulp-autoprefixer'),
postcssCustomProperties = require('postcss-custom-properties'),
postcss = require('gulp-postcss'),
removeSelectors = require('postcss-remove-selectors'),
StyleDictionary = require('style-dictionary'),
copyfiles = require('copyfiles'),
selectorReplace = require('postcss-selector-replace');

// task to copy font files from the OWCSS npm to the local project
// resources are NOT to be committed to version control
gulp.task('copyFonts', function(cb) {
copyfiles(
[
'./node_modules/@alaskaairux/orion-web-core-style-sheets/dist/fonts/*.*',
'./demo/fonts/',
],
true,
cb
);
cb();
});
removeRules = require('postcss-remove-rules'),
StyleDictionary = require('style-dictionary');

// task to build CSS/Sass resources from Token JSON files
gulp.task('buildTokens', function(cb) {
Expand Down Expand Up @@ -101,9 +85,11 @@ gulp.task('processSrc', function() {
preserve: true,
}),

removeSelectors({
selectors: [':root'],
}),
removeRules({
rulesToRemove: {
':root': '*'
}
})
])
)

Expand All @@ -112,76 +98,6 @@ gulp.task('processSrc', function() {
);
});

// task for Production Sass processing and legacy support
gulp.task('processImportsCanonical', function() {
// set path to where Sass files are located to be processed
return (
gulp
.src('./src/*.scss')

// Sass pipeline
.pipe(
gulpSass({
errLogToConsole: true,
outputStyle: 'compressed', //alt options: nested, compact, compressed, expanded
})
)

// Post Sass to CSS process for addressing proprietary prefixes
//.pipe(gulpautoprefixer({ browsers: ['last 4 versions'], cascade: false }))

// PostCss polyfill pipeline for CSS Custom Properties (CSS variables)
.pipe(
postcss([
// Boolean flag determines if CSS Custom Property code is in final output
// or only outputs legacy supported version CSS
postcssCustomProperties({
preserve: false,
}),

removeSelectors({
selectors: [':root'],
}),
])
)

// Output final CSS in destination
.pipe(gulp.dest('./altImports/canonical/'))
);
});

// task for Production Sass processing and legacy support
gulp.task('processImportsVariable', function() {
// set path to where Sass files are located to be processed
return (
gulp
.src('./src/*.scss')

// Sass pipeline
.pipe(
gulpSass({
errLogToConsole: true,
outputStyle: 'compressed', //alt options: nested, compact, compressed, expanded
})
)

// Post Sass to CSS process for addressing proprietary prefixes
//.pipe(gulpautoprefixer({ browsers: ['last 4 versions'], cascade: false }))

// PostCss polyfill pipeline for CSS Custom Properties (CSS variables)
.pipe(
postcss([
removeSelectors({
selectors: [':root'],
}),
])
)

// Output final CSS in destination
.pipe(gulp.dest('./altImports/variable/'))
);
});

// task for Development Sass processing
gulp.task('processDev', function() {
// set path to where Sass files are located to be processed
Expand All @@ -200,9 +116,11 @@ gulp.task('processDev', function() {
// PostCss polyfill pipeline for CSS Custom Properties (CSS variables)
.pipe(
postcss([
removeSelectors({
selectors: [':root'],
}),
removeRules({
rulesToRemove: {
':root': '*'
}
})
])
)

Expand All @@ -211,24 +129,6 @@ gulp.task('processDev', function() {
);
});

// task for Development Sass processing
gulp.task('reprocessClean', function() {
// set path to where Sass files are located to be processed
return gulp.src('./altImports/**/*.scss')

// PostCss polyfill pipeline for CSS Custom Properties (CSS variables)
.pipe(postcss([

selectorReplace({
before: [":host", "&(:not(.is-touching))", "&(.focus-visible)"],
after: ["&", "&:not(.is-touching)", "&.focus-visible"],
})
]))

// Output final CSS in destination
.pipe(gulp.dest('./altImports/'));
});

// Sass watcher
gulp.task('sassWatch', function() {
gulp.watch(
Expand All @@ -242,13 +142,13 @@ gulp.task('sassWatch', function() {
gulp.task(
'build',
gulp.series(
gulp.parallel('copyFonts', 'buildTokens', 'processDemo', 'processSrc')
gulp.parallel('buildTokens', 'processDemo', 'processSrc')
)
);

gulp.task(
'dev',
gulp.series(
gulp.parallel('copyFonts', 'buildTokens', 'processDemo', 'processDev','sassWatch')
gulp.parallel('buildTokens', 'processDemo', 'processDev','sassWatch')
)
);
Loading