Skip to content

Commit

Permalink
perf(labs): remove auroLabs functionality #339
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This commit will remove all functionality related
to the use of AuroLabs as a concept.

Changes to be committed:
modified:   bin/generate.js
modified:   componentDocs/README.md
modified:   componentDocs/README_v4.md
deleted:    componentDocs/partials/labsDisclaimer.md
deleted:    template/.github/settings__labs.yml
modified:   template/scripts/generateDocs.js
  • Loading branch information
blackfalcon committed May 9, 2023
1 parent a4eba9a commit f32d69f
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 201 deletions.
44 changes: 1 addition & 43 deletions bin/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const paths = require('../util/paths');
const log = require('../util/log');
const inquirer = require('inquirer');
let npm = '';
let labs = false;

const lowerKebabCase = str => str.toLowerCase().replace(' ', '-');
const upperCamelCase = str =>
Expand Down Expand Up @@ -147,26 +146,6 @@ const copyFile = async (sourcePath, targetPath, params, replacements, fileRename
}
};

// function will replace the settings.yml if the project is auroLabs
const labsOverride__Settings = async (targetPath) => {
if (labs) {
fs.copyFile(`${targetPath}/.github/settings__labs.yml`, `${targetPath}/.github/settings.yml`, (err) => {
if (err) {
console.log("Error Found:", err);
process.exit(0);
}
});

log(`${chalk.green('auroLabs settings applied to new repo.')}: ${targetPath}`);
}

try {
fs.unlinkSync(`${targetPath}/.github/settings__labs.yml`)
} catch(err) {
console.error(err)
}
}

const getVersionData = async () => {
const { devDependencies, dependencies, peerDependencies } = require('../template/package.json');

Expand All @@ -190,14 +169,6 @@ const question = async () => {
if (pjson.version === latestPublishedVersion) {
if (!params.test) {
const questions = [
{
type: 'confirm',
name: 'auroLabs',
message: 'Is this an AuroLabs project?',
when: function (answers) {
return !readDocs('auroLabs')(answers);
},
},
{
type: 'confirm',
name: 'governance',
Expand Down Expand Up @@ -234,10 +205,6 @@ const question = async () => {

inquirer.prompt(questions).then((answers) => {

if (answers.auroLabs === true) {
labs = true;
}

if (answers.governance === false) {
console.log(`\nNot reviewed the Contributing Guidelines?\nPlease review ${chalk.underline.yellow(`https://auro.alaskaair.com/contributing`)} before submitting any new work\nto ensure that you will be in compliance with our expectations.\n`);
}
Expand All @@ -247,7 +214,7 @@ const question = async () => {
}

if (answers.cssConventions === false) {
console.log(`\nNot familiar with Auro\'s CSS conventions?\nPlease review ${chalk.underline.yellow(`https://auro.alaskaair.com/webcorestylesheets/custom-element-css`)} before starting a new project.\n`);
console.log(`\nNot familiar with Auro\'s CSS conventions?\nPlease review ${chalk.underline.yellow(`https://auro.alaskaair.com/css/conventions`)} before starting a new project.\n`);
}

if (answers.governance === true
Expand Down Expand Up @@ -291,10 +258,6 @@ const getReplacements = async ({ name, namespace, npm }) => {
const minNodeVersion = pjson.engines.node.replace(/[^0-9,.]+/g,'');
const abstractNodeVersion = minNodeVersion.split('.')[0] + '.x';

if (labs) {
npm = `@aurolabs`
}

const nameReplacements = [
{ regex: /\[genVersion\]/g, value: pjson.version },
{ regex: /\[genVersionDash\]/g, value: pjson.version.split('.').join("-") },
Expand Down Expand Up @@ -423,7 +386,6 @@ Creating Web Components People Love.
'.npmignore.temp': '.npmignore',
'.gitignore.temp': '.gitignore'
});
await labsOverride__Settings(params.dir);
log(chalk.green('\nCopied all files!'));

let areDependenciesInstalled = false;
Expand Down Expand Up @@ -511,10 +473,6 @@ Creating Web Components People Love.
log(chalk.green(`Well done! The new HTML Custom Element auro-${params.name} has been created!\n\nDir: ${params.dir}\nBuilt using WC-Generator: v${pjson.version}\n`));

log(chalk.yellow(`\nMore questions about Auro? Be sure to check out\n${chalk.underline.yellow(`https://auro.alaskaair.com/auro-support`)}\nfor more information and answers to frequently asked questions.\n`));

if (labs) {
log(chalk.yellow(`\nYou are building an element for AuroLabs! Awesome!\n\nBe sure to check out all the information we have to go\nfrom the minors to the majors with your new custom element!\n${chalk.underline.yellow(`https://auro.alaskaair.com/aurolabs`)}\n\n`));
}
}
}
};
Expand Down
3 changes: 0 additions & 3 deletions componentDocs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ The following sections are editable by making changes to the following files:

# [Name]

<!-- AUROLABS-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/labsDisclaimer.md) -->
<!-- AUROLABS-GENERATED-CONTENT:END -->

<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/description.md) -->
<!-- AURO-GENERATED-CONTENT:END -->

Expand Down
3 changes: 0 additions & 3 deletions componentDocs/README_v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ The following sections are editable by making changes to the following files:

# [Name]

<!-- AUROLABS-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/labsDisclaimer.md) -->
<!-- AUROLABS-GENERATED-CONTENT:END -->

<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/description.md) -->
<!-- AURO-GENERATED-CONTENT:END -->

Expand Down
1 change: 0 additions & 1 deletion componentDocs/partials/labsDisclaimer.md

This file was deleted.

126 changes: 0 additions & 126 deletions template/.github/settings__labs.yml

This file was deleted.

25 changes: 0 additions & 25 deletions template/scripts/generateDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,35 +91,12 @@ function formatApiTableContents(content, destination) {
});
}

/**
* If auroLabs project, include auroLabs documentation in `./README.md`
*/

function processLabsReadmeContent() {
let nameExtractionData = nameExtraction();

if (nameExtractionData.npm === '@aurolabs') {
const callbackAurolabs = function(updatedContent, outputConfig) {
console.log('Readme updated to reference AuroLabs content.');
};

const configAurolabs = {
matchWord: 'AUROLABS-GENERATED-CONTENT'
};

const markdownPathAurolabs = path.join(__dirname, '../README.md');

markdownMagic(markdownPathAurolabs, configAurolabs, callbackAurolabs);
}
}

/**
* Compiles `./docTemplates/README.md` -> `./README.md`
*/

function processReadme() {
const callback = function(updatedContent, outputConfig) {
processLabsReadmeContent()

if (fs.existsSync('./README.md')) {
fs.readFile('./README.md', 'utf8', function(err, data) {
Expand All @@ -138,8 +115,6 @@ function processReadme() {
const markdownPath = path.join(__dirname, '../docTemplates/README.md');

markdownMagic(markdownPath, config, callback);

processLabsReadmeContent();
}

/**
Expand Down

0 comments on commit f32d69f

Please sign in to comment.