Remove experimental- from theme.json & include in .org build (#3956)

* Rename bb theme to make it not experimental

* Include theme.json files in dot org packaging

* Renamed all BCB Family Themes theme.json file

* Add font size to site title block.

Co-authored-by: Jeff Ong <jonger4@gmail.com>
This commit is contained in:
Jason Crist 2021-05-27 11:06:59 -04:00 committed by GitHub
parent 64c33303f8
commit a65ef3200a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 11 additions and 82 deletions

View file

@ -1,57 +0,0 @@
const fs = require( 'fs' );
const chokidar = require( 'chokidar' );
const merge = require( 'deepmerge' );
const childThemeName = process.argv[ 2 ];
const watch = 'watch' === process.argv[ 3 ];
const parentThemeJsonFileName = __dirname + '/experimental-theme.json';
const childThemeJsonFileName =
__dirname + '/../' + childThemeName + '/child-experimental-theme.json';
const overwriteMerge = ( destinationArray, sourceArray, options ) =>
sourceArray;
const buildChildTheme = () => {
try {
const parentThemeJsonFile = fs.readFileSync(
parentThemeJsonFileName,
'utf8'
),
childThemeJsonFile = fs.readFileSync(
childThemeJsonFileName,
'utf8'
),
parentThemeJson = JSON.parse( parentThemeJsonFile ),
childThemeJson = JSON.parse( childThemeJsonFile ),
mergedThemeJson = merge( parentThemeJson, childThemeJson, {
arrayMerge: overwriteMerge,
} );
fs.writeFile(
'../' + childThemeName + '/experimental-theme.json',
JSON.stringify( mergedThemeJson, null, '\t' ),
'utf8',
() => {
console.log(
'\x1b[32m' +
childThemeName +
'/experimental-theme.json created successfully.'
);
}
);
} catch ( error ) {
console.error( '\x1b[31m' + error );
}
};
if ( ! fs.existsSync( childThemeJsonFileName ) ) {
console.log( '\x1b[31m' + childThemeJsonFileName + ' not found :(' );
return;
}
if ( watch ) {
chokidar
.watch( [ parentThemeJsonFileName, childThemeJsonFileName ] )
.on( 'all', buildChildTheme );
} else {
buildChildTheme();
}

View file

@ -34,10 +34,6 @@
],
"scripts": {
"start": "chokidar \"sass/**/*.scss\" -c \"npm run build\" --initial",
"start:child": "run-p start \"build:child -- {@} watch\" --",
"start:all": "chokidar \"sass/**/*.scss\" \"experimental-theme.json\" -c \"npm run build:all\" --initial",
"build": "node-sass --importer node_modules/node-sass-package-importer/dist/cli.js sass/ponyfill.scss assets/ponyfill.css --output-style expanded --indent-type tab --indent-width 1 --source-map true",
"build:child": "node build.js",
"build:all": "npm run build && sh ./rebuild-child-themes.sh"
"build": "node-sass --importer node_modules/node-sass-package-importer/dist/cli.js sass/ponyfill.scss assets/ponyfill.css --output-style expanded --indent-type tab --indent-width 1 --source-map true"
}
}

View file

@ -1,10 +0,0 @@
#!/bin/bash
declare -a ChildThemes=( "mayland-blocks" "seedlet-blocks" "quadrat" )
for child in ${ChildThemes[@]}; do
cd '../'${child}
echo 'Rebulding '${child}
npm run build
done

View file

@ -3,9 +3,9 @@ const chokidar = require( 'chokidar' );
const merge = require( 'deepmerge' );
const childThemeName = process.argv[ 2 ];
const watch = 'watch' === process.argv[ 3 ];
const parentThemeJsonFileName = __dirname + '/experimental-theme.json';
const parentThemeJsonFileName = __dirname + '/theme.json';
const childThemeJsonFileName =
__dirname + '/../' + childThemeName + '/child-experimental-theme.json';
__dirname + '/../' + childThemeName + '/child-theme.json';
const overwriteMerge = ( destinationArray, sourceArray, options ) =>
sourceArray;
@ -27,14 +27,14 @@ const buildChildTheme = () => {
} );
fs.writeFile(
'../' + childThemeName + '/experimental-theme.json',
'../' + childThemeName + '/theme.json',
JSON.stringify( mergedThemeJson, null, '\t' ),
'utf8',
() => {
console.log(
'\x1b[32m' +
childThemeName +
'/experimental-theme.json created successfully.'
'/theme.json created successfully.'
);
}
);

View file

@ -11,7 +11,7 @@
"node-sass-package-importer": "^5.3.2"
},
"scripts": {
"start": "chokidar \"**/*.scss\" child-experimental-theme.json ../blockbase/experimental-theme.json -c \"npm run build\" --initial",
"start": "chokidar \"**/*.scss\" child-theme.json ../blockbase/theme.json -c \"npm run build\" --initial",
"build": "npm run build:theme && npm run build:scss",
"build:theme": "node ../blockbase/build.js mayland-blocks",
"build:scss": "node-sass --importer node_modules/node-sass-package-importer/dist/cli.js sass/theme.scss assets/theme.css --output-style expanded --indent-type tab --indent-width 1 --source-map true"

View file

@ -6,7 +6,7 @@ if [[ "$1" != "" ]]; then
find $THEME/assets/sass/*.scss -type f -exec sed -i '' 's/, jetpack-global-styles//g' {} \;
cd $THEME && npm run build;
mkdir $THEME;
rsync -avz --exclude $THEME --exclude-from '../dotorg-exclude.txt' ./ $THEME
rsync -avz --include='theme.json' --exclude $THEME --exclude-from '../dotorg-exclude.txt' ./ $THEME
find $THEME -type f -name '*.map' -delete # for some reason rsync won't exclude map files
rm -rf $THEME/$THEME
zip -r -X $THEME.zip $THEME

View file

@ -14,7 +14,7 @@
"postcss-cli": "^8.3.1"
},
"scripts": {
"start": "chokidar \"**/*.scss\" child-experimental-theme.json ../blockbase/experimental-theme.json -c \"npm run build\" --initial",
"start": "chokidar \"**/*.scss\" child-theme.json ../blockbase/theme.json -c \"npm run build\" --initial",
"build": "npm run build:theme && npm run build:scss",
"build:theme": "node ../blockbase/build.js quadrat",
"build:scss": "node-sass --importer node_modules/node-sass-package-importer/dist/cli.js sass/theme.scss --output-style expanded --indent-type tab --indent-width 1 | postcss --use autoprefixer --output assets/theme.css --map"

View file

@ -4,7 +4,7 @@
<!-- wp:site-logo {"align":"center","width":128} /-->
<!-- wp:site-title {"textAlign":"center"} /-->
<!-- wp:site-title {"textAlign":"center","style":{"typography":{"fontSize":"55px"}}} /-->
<!-- wp:site-tagline {"textAlign":"center","fontSize":"small"} /-->

View file

@ -11,7 +11,7 @@
"node-sass-package-importer": "^5.3.2"
},
"scripts": {
"start": "chokidar \"**/*.scss\" child-experimental-theme.json ../blockbase/experimental-theme.json -c \"npm run build\" --initial",
"start": "chokidar \"**/*.scss\" child-theme.json ../blockbase/theme.json -c \"npm run build\" --initial",
"build": "npm run build:theme && npm run build:scss",
"build:theme": "node ../blockbase/build.js seedlet-blocks",
"build:scss": "node-sass --importer node_modules/node-sass-package-importer/dist/cli.js sass/theme.scss assets/theme.css --output-style expanded --indent-type tab --indent-width 1 --source-map true"

View file

@ -434,7 +434,7 @@
},
"core/site-title": {
"typography": {
"fontSize": "60px",
"fontSize": "var(--wp--preset--font-size--normal)",
"fontWeight": 700
},
"color": {