Skip to content

Commit

Permalink
Merge pull request #175 from rileyajones/add-bento-components-dir
Browse files Browse the repository at this point in the history
Update build paths to include src/bento/components
  • Loading branch information
sebastianbenz authored Feb 11, 2022
2 parents d3ca1a7 + f4d22ad commit 64ea200
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion gulpfile.js/importDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const markdownItAnchor = require('markdown-it-anchor');
const {split} = require('sentence-splitter');

const EXTENSIONS_SRC = path.resolve(__dirname, '..', 'amphtml/extensions');
const COMPONENTS_SRC = path.resolve(__dirname, '..', 'amphtml/src/bento/components');
const COMPONENTS_DEST = path.resolve(__dirname, '..', 'site/en/components');
const IGNORED_COMPONENTS = new Set(['bento-iframe']);
const md = markdownIt({
Expand Down Expand Up @@ -146,7 +147,10 @@ function _parseComponentName(content) {
}

async function importComponents() {
const filePaths = await fg(path.join(EXTENSIONS_SRC, '**/1.0/README.md'));
const filePaths = await fg([
path.join(EXTENSIONS_SRC, '**/1.0/README.md'),
path.join(COMPONENTS_SRC, '**/1.0/README.md'),
]);
if (!filePaths.length) {
console.error(
chalk.dim('[Import components]'),
Expand Down
8 changes: 6 additions & 2 deletions gulpfile.js/importHeroExamples.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ const fg = require('fast-glob');
const chalk = require('chalk');

const EXTENSIONS_SRC = path.resolve(__dirname, '..', 'amphtml/extensions');
const COMPONENTS_SRC = path.resolve(__dirname, '..', 'amphtml/src/bento/components');
const EXAMPLES_DEST = path.resolve(
__dirname,
'..',
'assets/iframes/hero-examples'
);
const PATH_COMPONENT_NAME_PATTERN = /amphtml\/extensions\/(.*?)\//m;
const PATH_COMPONENT_NAME_PATTERN = /amphtml\/(?:extensions)|(?:src\/bento\/components)\/(.*?)\//m;

async function importHeroExamples() {
const filePaths = await fg(path.join(EXTENSIONS_SRC, '**/1.0/example/**/*'));
const filePaths = await fg([
path.join(EXTENSIONS_SRC, '**/1.0/example/**/*'),
path.join(COMPONENTS_SRC, '**/1.0/example/**/*'),
]);
if (!filePaths.length) {
console.error(
chalk.dim('[Import hero examples]'),
Expand Down

0 comments on commit 64ea200

Please sign in to comment.