Skip to content

Commit

Permalink
feat: upgrade for auro components
Browse files Browse the repository at this point in the history
- Remove CSS post processing #11
- update styles and templates to support the Auro namespace
- dynamic user info addition to package.json
- update wc-generator package.json dependencies
  • Loading branch information
blackfalcon committed Feb 22, 2020
1 parent aa6cb17 commit 365f7d9
Show file tree
Hide file tree
Showing 14 changed files with 916 additions and 512 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules
ods-foo
auro-test
73 changes: 37 additions & 36 deletions bin/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const parseArgs = () => {
const test = args['--test'];
const name = args['--name'] || 'no-name-given';
const dir = path.resolve(
args['--dir'] || `./OrionStatelessComponents__ods-${lowerKebabCase(name)}`
args['--dir'] || `./auro-${lowerKebabCase(name)}`
);

return {
Expand All @@ -81,12 +81,16 @@ 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 Expand Up @@ -191,8 +195,8 @@ const generateFromTemplate = async () => {
else {
await makeFolder(params.dir);
await copyAllFiles(paths.self.template, params.dir, params, {
'ods-[name].test.js': `ods-${lowerKebabCase(params.name)}.test.js`,
'ods-[name].js': `ods-${lowerKebabCase(params.name)}.js`,
'auro-[name].test.js': `auro-${lowerKebabCase(params.name)}.test.js`,
'auro-[name].js': `auro-${lowerKebabCase(params.name)}.js`,
'package.temp': 'package.json',
'.npmignore.temp': '.npmignore',
'.gitignore.temp': '.gitignore',
Expand Down Expand Up @@ -224,36 +228,33 @@ const generateFromTemplate = async () => {
}
isNodeSassRebuilt = true;

log(
`
█████╗ ██╗ ██╗██████╗ ██████╗
██╔══██╗██║ ██║██╔══██╗██╔═══██╗
███████║██║ ██║██████╔╝██║ ██║
██╔══██║██║ ██║██╔══██╗██║ ██║
██║ ██║╚██████╔╝██║ ██║╚██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝
██████╗ ███████╗███████╗██╗ ██████╗ ███╗ ██╗
██╔══██╗██╔════╝██╔════╝██║██╔════╝ ████╗ ██║
██║ ██║█████╗ ███████╗██║██║ ███╗██╔██╗ ██║
██║ ██║██╔══╝ ╚════██║██║██║ ██║██║╚██╗██║
██████╔╝███████╗███████║██║╚██████╔╝██║ ╚████║
╚═════╝ ╚══════╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝
███████╗██╗ ██╗███████╗████████╗███████╗███╗ ███╗
██╔════╝╚██╗ ██╔╝██╔════╝╚══██╔══╝██╔════╝████╗ ████║
███████╗ ╚████╔╝ ███████╗ ██║ █████╗ ██╔████╔██║
╚════██║ ╚██╔╝ ╚════██║ ██║ ██╔══╝ ██║╚██╔╝██║
███████║ ██║ ███████║ ██║ ███████╗██║ ╚═╝ ██║
╚══════╝ ╚═╝ ╚══════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝
Creating a Design System People Love.
`)
log('\n')
log(' . . ')
log(' * *')
log('')
log(' * * *')
log(' !')
log(' * * ')
log('')
log(" ██████╗ ██████╗ ██╗ ██████╗ ███╗ ██╗")
log("██╔═══██╗██╔══██╗██║██╔═══██╗████╗ ██║")
log("██║ ██║██████╔╝██║██║ ██║██╔██╗ ██║")
log("██║ ██║██╔══██╗██║██║ ██║██║╚██╗██║")
log("╚██████╔╝██║ ██║██║╚██████╔╝██║ ╚████║")
log(" ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝")
log('')
log("██████╗ ███████╗███████╗██╗ ██████╗ ███╗ ██╗")
log("██╔══██╗██╔════╝██╔════╝██║██╔════╝ ████╗ ██║")
log("██║ ██║█████╗ ███████╗██║██║ ███╗██╔██╗ ██║")
log("██║ ██║██╔══╝ ╚════██║██║██║ ██║██║╚██╗██║")
log("██████╔╝███████╗███████║██║╚██████╔╝██║ ╚████║")
log("╚═════╝ ╚══════╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝")
log('')
log("███████╗██╗ ██╗███████╗████████╗███████╗███╗ ███╗")
log("██╔════╝╚██╗ ██╔╝██╔════╝╚══██╔══╝██╔════╝████╗ ████║")
log("███████╗ ╚████╔╝ ███████╗ ██║ █████╗ ██╔████╔██║")
log("╚════██║ ╚██╔╝ ╚════██║ ██║ ██╔══╝ ██║╚██╔╝██║")
log("███████║ ██║ ███████║ ██║ ███████╗██║ ╚═╝ ██║")
log("╚══════╝ ╚═╝ ╚══════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝")
log('\n')
log(chalk.green(`Well done! The new HTML Custom Element ods-${params.name} has been created!
log(chalk.green(`Well done! The new HTML Custom Element auro-${params.name} has been created!
\nDir: ${params.dir}
\nODS-WC: v${pjson.version}
\n`));
Expand Down
Loading

0 comments on commit 365f7d9

Please sign in to comment.