Browse Source

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>
Jason Crist 4 years ago
parent
commit
a65ef3200a

+ 0 - 57
blank-canvas-blocks/build.js

@@ -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();
-}

+ 1 - 5
blank-canvas-blocks/package.json

@@ -34,10 +34,6 @@
   ],
   ],
   "scripts": {
   "scripts": {
     "start": "chokidar \"sass/**/*.scss\" -c \"npm run build\" --initial",
     "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"
   }
   }
 }
 }

+ 0 - 10
blank-canvas-blocks/rebuild-child-themes.sh

@@ -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
-

+ 0 - 0
blank-canvas-blocks/experimental-theme.json → blank-canvas-blocks/theme.json


+ 4 - 4
blockbase/build.js

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

+ 0 - 0
blockbase/experimental-theme.json → blockbase/theme.json


+ 0 - 0
mayland-blocks/child-experimental-theme.json → mayland-blocks/child-theme.json


+ 1 - 1
mayland-blocks/package.json

@@ -11,7 +11,7 @@
 		"node-sass-package-importer": "^5.3.2"
 		"node-sass-package-importer": "^5.3.2"
 	},
 	},
 	"scripts": {
 	"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": "npm run build:theme && npm run build:scss",
 		"build:theme": "node ../blockbase/build.js mayland-blocks",
 		"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"
 		"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"

+ 0 - 0
mayland-blocks/experimental-theme.json → mayland-blocks/theme.json


+ 1 - 1
package-dotorg.sh

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

+ 0 - 0
quadrat/child-experimental-theme.json → quadrat/child-theme.json


+ 1 - 1
quadrat/package.json

@@ -14,7 +14,7 @@
     "postcss-cli": "^8.3.1"
     "postcss-cli": "^8.3.1"
   },
   },
   "scripts": {
   "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": "npm run build:theme && npm run build:scss",
     "build:theme": "node ../blockbase/build.js quadrat",
     "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"
     "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"

+ 0 - 0
quadrat/experimental-theme.json → quadrat/theme.json


+ 1 - 1
seedlet-blocks/block-template-parts/header.html

@@ -4,7 +4,7 @@
 
 
 <!-- wp:site-logo {"align":"center","width":128} /-->
 <!-- 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"} /-->
 <!-- wp:site-tagline {"textAlign":"center","fontSize":"small"} /-->
 
 

+ 0 - 0
seedlet-blocks/child-experimental-theme.json → seedlet-blocks/child-theme.json


+ 1 - 1
seedlet-blocks/package.json

@@ -11,7 +11,7 @@
     "node-sass-package-importer": "^5.3.2"
     "node-sass-package-importer": "^5.3.2"
   },
   },
   "scripts": {
   "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": "npm run build:theme && npm run build:scss",
     "build:theme": "node ../blockbase/build.js seedlet-blocks",
     "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"
     "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"

+ 1 - 1
seedlet-blocks/experimental-theme.json → seedlet-blocks/theme.json

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