File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ const markdownItAnchor = require('markdown-it-anchor');
88const { split} = require ( 'sentence-splitter' ) ;
99
1010const EXTENSIONS_SRC = path . resolve ( __dirname , '..' , 'amphtml/extensions' ) ;
11+ const COMPONENTS_SRC = path . resolve ( __dirname , '..' , 'amphtml/src/bento/components' ) ;
1112const COMPONENTS_DEST = path . resolve ( __dirname , '..' , 'site/en/components' ) ;
1213const IGNORED_COMPONENTS = new Set ( [ 'bento-iframe' ] ) ;
1314const md = markdownIt ( {
@@ -146,7 +147,10 @@ function _parseComponentName(content) {
146147}
147148
148149async function importComponents ( ) {
149- const filePaths = await fg ( path . join ( EXTENSIONS_SRC , '**/1.0/README.md' ) ) ;
150+ const filePaths = await fg ( [
151+ path . join ( EXTENSIONS_SRC , '**/1.0/README.md' ) ,
152+ path . join ( COMPONENTS_SRC , '**/1.0/README.md' ) ,
153+ ] ) ;
150154 if ( ! filePaths . length ) {
151155 console . error (
152156 chalk . dim ( '[Import components]' ) ,
Original file line number Diff line number Diff line change @@ -4,15 +4,19 @@ const fg = require('fast-glob');
44const chalk = require ( 'chalk' ) ;
55
66const EXTENSIONS_SRC = path . resolve ( __dirname , '..' , 'amphtml/extensions' ) ;
7+ const COMPONENTS_SRC = path . resolve ( __dirname , '..' , 'amphtml/src/bento/components' ) ;
78const EXAMPLES_DEST = path . resolve (
89 __dirname ,
910 '..' ,
1011 'assets/iframes/hero-examples'
1112) ;
12- const PATH_COMPONENT_NAME_PATTERN = / a m p h t m l \/ e x t e n s i o n s \/ ( .* ?) \/ / m;
13+ const PATH_COMPONENT_NAME_PATTERN = / a m p h t m l \/ (?: e x t e n s i o n s ) | (?: s r c \/ b e n t o \/ c o m p o n e n t s ) \/ ( .* ?) \/ / m;
1314
1415async function importHeroExamples ( ) {
15- const filePaths = await fg ( path . join ( EXTENSIONS_SRC , '**/1.0/example/**/*' ) ) ;
16+ const filePaths = await fg ( [
17+ path . join ( EXTENSIONS_SRC , '**/1.0/example/**/*' ) ,
18+ path . join ( COMPONENTS_SRC , '**/1.0/example/**/*' ) ,
19+ ] ) ;
1620 if ( ! filePaths . length ) {
1721 console . error (
1822 chalk . dim ( '[Import hero examples]' ) ,
You can’t perform that action at this time.
0 commit comments