Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo cleanup #132

Merged
merged 19 commits into from Mar 27, 2024
Merged

Repo cleanup #132

merged 19 commits into from Mar 27, 2024

Conversation

tbradsha
Copy link
Contributor

The existing repo setup has several shortcomings. This is a proposed cleanup of the repo and tooling.

Full details here: pf4qpu-kI-p2

@tbradsha tbradsha self-assigned this Mar 15, 2024
Copy link
Contributor

@anomiex anomiex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave it a once-over.

Feel free to disagree with any of my comments, of course. 🙂

tools/build Outdated Show resolved Hide resolved
tools/build-react Show resolved Hide resolved
cp "$src_react_dir"/*.jsx "$dest_react_dir"

# JSX -> JS
npx babel --quiet --presets @babel/preset-env,@babel/preset-react,minify --out-dir "$dest_react_dir" "$dest_react_dir"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I note there's no check for if this command fails.

The simplest thing might be to put set -eo pipefail at the top of the script. It's not perfect, but for simple scripts like these it should work fine to have the script auto-fail if some subcommand fails.

Same in the other scripts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed; I thought I mentioned that I hadn't added much in way of failsafe logic in the P2 post but apparently I left that out. This is something I want to do after it's in place on the monorepo side.

tools/build-react Outdated Show resolved Hide resolved
tools/svg-optimize Outdated Show resolved Hide resolved
tools/svg-to-font.js Outdated Show resolved Hide resolved
tools/svg-to-php Show resolved Hide resolved
tools/svg-to-php Outdated Show resolved Hide resolved
tools/svg-to-sprite Show resolved Hide resolved
tools/svg-to-sprite Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about generating a minified CSS file as well, since we'll need one in Jetpack?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or will Jetpack's webpack config wind up bundling and minifying it anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should defer this decision until we hook it all up with the monorepo.

tools/svg-to-font.js Outdated Show resolved Hide resolved
tools/svg-to-font.js Outdated Show resolved Hide resolved
Copy link
Contributor

@anomiex anomiex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go ahead with this and iterate if necessary.

@tbradsha tbradsha merged commit babf2e9 into trunk Mar 27, 2024
@tbradsha tbradsha deleted the try/social_logos_rebuild branch March 27, 2024 22:09
matticbot pushed a commit that referenced this pull request May 23, 2024
* Initial commit

* Updating the readme with some basic text

* Updating readme

* Adding initial files

- Illustrator document
- SVGs
- exporter script

* Updating readme

* Update README.md

* Update README.md

* Update README.md

* Updates

- Fixing typos
- Adding more resources

* Adding one more resource

* Renaming file

* Updating google plus logos

* Fixing error with svg

* Update README.md

* Adding reddit brand page

* Adding reddit logo

* Adds Grunt Build Script
This makes it work in the simular way that the current gridicon grunt buil script works.

* Add a number of fixes to the grunt process

- Fix typo in package.json
- Remove invisible rectangle from Illustrator file, this is auto inserted by the grunt script and breaks other things if present
- Add circle around alternate G+ logo to adhere with guidelines
- Properly compound Path, Tumblr and a few other icons that actually featured white fills instead of negative space

* Added Icon font build scripts

* Add png files build script

* Add all the missing logos from Genericons

Also grunt it.

* Remove PNG files and the build script part that creats them from repo

* Remove PHP function that displays the icons in the svg format

* Add WhatsApp, Telegram, mail, update print

Also grunt the lot.

* Grunt: Fix typo in sprite build script.

The closing head tag wasn't closing.

* Add codepoints to match the current grenericons

* React: Update the react component output to be more consistant and fix typos

* Remove the alt versions for facebook and linkedin

* Version bump

* React: Remove logo- part from the icon input

* Add SVG font format

* Add SVG font format

* Add base64 for crossdomain workaround

This PR adds base64 encoding to the WOFF font, as modern IE and Firefox both block fonts loading from a separate domain, which will often happen due to CDNs and whatnot. The best way to fix it is to add headers to the domains to allow this, but users of this in a plugin will probably not know to do that. Base64 encoding sidesteps this entirely, as it includes the font in the stylesheet, so the font will always be loaded on the same domain as the stylesheet.

Also rename the font name from "social-logo" to "social-logos", plural.

* Add Share icon.

* Rename files

* Grunt rebuild

* Remove SVG min logo prefixed svg files

* Update the glyph of the share button to match genericons

* Update react to remove the logo prefix once more.

* Add pixel-grid information to README.md

Update README to include information on the best dimensions to use Social Logos in.

* added twitter alt logo to illustrator file

* ran grunt with newly added twitter logo svg

* updated gruntfile to correspond to new twitter logos

* ran grunt on new gruntfile

* removed space from gruntfile and ran grunt

* updated unicode character for twitter-alt logo

* ran grunt task

* Add Medium icon

As requested by a user.

* Update Medium to omit Style tag and Grunt to remove IDs

This commit changes the Gruntfile to clean up IDs, which are useless in a minimized SVG file. In addition to this I noticed a style tag inside the Medium icon source file, which was there because I saved the file wrong from Illustrator. Both of those are fixed.

Incidentally this changes the icon font again since the icon file changed. Visually it won't make a difference.

* Fix issue where Amazon and Medium had redundant <g>s.

* 2nd take at removing SVG font

Fixes #14. Was easier than rebasing.

* Adding Ghost logo to .ai file

* Exporting svg file for Ghost

* Running grunt

* Rename logo-ghost to ghost.

* Move to external codepoints file for persistence

Previously, a few codepoints were defined for persistence in the gruntfile. However any new icon added after that would have a randomly assigned codepoint which would not be persistent.

By moving to an external codepoints.json file, all codepoints for added icons are baked into that file when grunted, and this keeps them persistent even as new icons are added.

Aside from keeping the codepoints persistent, I converted the existing list of codepoints from hexadecimal unicode to decimal codepoints, in order to stay persistent.

* Adding svg for Behance

* Adding logo to .ai file

* Exporting using script

* Revert "Adding logo to .ai file"

This reverts commit ccc8783.

* Revert "Exporting using script"

This reverts commit c35df3e.

* exporting svg using script

* Grunting

* Fixing .ai file

Several issues with the file:

- incorrect layer names
- missing icons
- duplicate layers
- incorrect artwork

Adding new share icon

* exporting svgs

* grunting

* Removing digg icon and grunting

* Removing digg from min folder and grunting

* Grunting icon font.

* Add GPL license

Fixes #32.

This PR adds the GPL license file to the repo. It also adds a COPYING.md file, which clarifies that though this set of logos is GPL, the logos themselves retain their trademarks. This is taken almost verbatim from the file bundled with Genericons.

* Add Instagram link

* Updating Instagram logo

* Adding 2 google logos

* Save .ai file

* Update grunt task to rename kabob-case attributes to camelCase (#41)

* Publish SocialLogo react component to npm (#42)

* Publish SocialLogo component to npm
* Relax npmignore to publish the icon-font and svg-sprite
* Update readme to clarify pixel units
* Bump version to 1.0.0

* Remove classname peer dependency (#43)

* Add peer dependencies
* Remove classname dependency requirement
* remove comments from minified component
* remove unneeded npm bin call
* avoid classname duplication, and destructure props
* add prepublish, do not check in generated files
* use npm run build for prepublish
* Move generated index file to build dir
* update readme
* export both component and example
* Bump to 1.0.1

* Build: add back svg-min files (#45)

* Use React.PureComponent, prop-types npm (#51)

For React 16 compat. Also, add `prop-types` to package.json `peerDependencies`. Require >=15.5 for both (`prop-types` [only exists since 15.5](https://github.com/facebook/prop-types/blob/master/CHANGELOG.md#before-1550)).

Bump version to 2.0.0, since we're removing React 0.14 compat.

* Update handlebars dependency.

This updates the handlebars dependency to 4.0.

To test, please checkout this PR, run `npm install` (make sure you already have font-forge installed), and verify that both SVGs and the icon font build correctly.

* Remove handlebars entirely

* Build: refactor build system to align to Gridicons' (#58)

* Build: refactor to align to Gridicons
* Build: added dependency-less webfont generation

* Ignore package-lock.json (#61)

* Add WooCommerce icon (#63)

* Add WooCommerce icon

* Tweak bubble dimensions

* Updates the WooCommerce icon

Radii now matches the soclal-logos grid.

* Update WooCommerce bubble icon

* Build all the things

* Include SVG spritemap in NPM package.

In Calypso, this will allow us to transition away from the SVG-in-JS
icons to a better approach, making use of the spritemap with SVG external
content.

* Remove Path Logos

* Build

* Update Facebook logo, and add .DS_Store to gitignore

This PR does two things.

1. It updates the Facebook logo to respect new brand guidelines from https://en.facebookbrand.com.
2. It adds .DS_Store files to the .gitignore.

* Try another build on latest npm.

* Fix build JSX header

* Bump package version

* Update dependencies

* Include `package-lock.json`

* Include React exports

* Lock PDF assets

Fixes #93.

* Include updated icon font

* Update transpiler

* Update SVG minifier

* Fix demo

* Bump package version

* Bump package version

* Update dependencies

* Include Patreon icon

Drawn by @pablohoneyhoney. Closes #101.

* Bump package version

* Fix GitHub Pages build

* Include TikTok icons

Drawn by @davewhitley. Closes #102.

* Update Medium icon

Drawn by @davewhitley. Closes #69 and #71.

* Add alternative Medium icon

Closes #71.

* Bump package version

* Add react 17

* use more clear version range

* Tweak readme to rebuild website

* Fix link to gallery in README (#108)

* Update FB logo guidelines (#103)

This part of the readme is outdated because of updated guidelines from FB. FB now has a circle shape logo.

* Update dependencies (#110)

* Fix PDF generation issue

* Update dependencies

* Update generated files

* Add charset to demo file

* Update to v2.4.0

* Added copy post url button. (#113)

* Added copy post url icon using gridicons.

* Upgraded version to 2.5.0-alpha.1

* Upgraded version to 2.5.0

* Allow React 18 as a peer dep

* Update version to 2.5.1-alpha.1 (and add missing 2.5.0 changelog entry)

* Release 2.5.1

* New Logo: Mastodon (#115)

Co-authored-by: "tim.nolte" <tim.nolte@ndigitals.com>

* Icon Fonts: switch to a new dependency to build fonts (#117)

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>

* Add Fediverse Logo (#120)

* New Logo: Nextdoor (#119)

Co-authored-by: Jeremy Herve <jeremy@jeremy.hu>

* Update changelog

* Add Threads Logo (#122)

* Add X Logo (#126)

* Icons: update label name for X icon. (#127)

* Remove aria label (#128)

* Patreon: update logo (#129)

Patreon's logo is changing: https://news.patreon.com/articles/patreon-reimagined
Our logos should change too.

* Add new Bluesky logo (#130)

Fixes #124

* Logos: add new SMS logo (#131)

* Repo cleanup (#132)

* Repo rewrite

* Small tweaks

* Remove fake SVG

* Quote paths

* Add const keyword

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Whitespace tweaks

* Fix indent

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* echo → printf

* Make scripts executable

* Use cwd-agnostic paths

* Set LC_COLLATE  for consistent sort

* Remove now-unneeded <rect>

* Override default TTF timestamp

* Adjust indent

* execSync → spawnSync

* Update .gitignore

* Update files to include in npm package

* Update the readme

---------

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Move social-logos package into place for monorepo

* Update pnpm-lock.yaml

* Add composer.json

* Remove package-lock.json

* Add changelog

* Update package refs

* More ref updates

* Add .gitkeep to changelog

* Add .gitattributes with standard items

* Create index.jsx to export components

* Remove .js files

* Add jsconfig.json

* Remove non-existent tests script for now

* Update changelog format

* Fix up version

* Rerename package

* Add Phan config due to generated PHP file

* Linting

* Add homepage

* Remove unneeded file

* Add `npmjs-autopublish`

* Add "bugs" URL

* Switch shebang for lint-project-structure.sh

* Include mirror-repo data

* Tweak and rebuild

* Add build step

* Remove build folder

* Add .gitignore file

* Don't ignore React files

* Generate codepoint file with tab indent and EOL newline

* Add .eslintignore

* Add missing semicolon and newlines

* Remove empty baseline

* Update primary changelog entry

* Delete .phan dir altogether

* Remove unneeded files

* Link to LICENSE.txt

* Remove redundant line

* Clean up README a bit

* Shuffle files a bit

* Commit social-logo-data.jsx to src

* Remove and ignore files in build

* Remove untrue comment

* Adjust scripts

* Delint social-logo-data.jsx

* Adjust package.json

* Update dependencies

* Fixed lockfile

* Exclude build folder, not just files in the folder

* Update projects/js-packages/social-logos/package.json

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* pnpm dedupe

* Fix version

* Update projects/js-packages/social-logos/.gitattributes

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Add simple check to verify built data matches committed data

* Provide most likely failure reason

* Use dev build as default

* Only check current dir for changes

* Show debug line temporarily

* Remove debug and use .

* Add debug line again

* More debugging

* Remove debug

* Confirm test is working

* Remove purposeful breakage

* Remove now-irrelevant sections from README.me

* Print changed files if relevant

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

* Add changelog entries

* Fix dependency ref

* Bump components version

* Tweak changelog entries

---------

Co-authored-by: Dave Whitley <drw158@gmail.com>
Co-authored-by: Enej Bajgoric <enej.bajgoric@gmail.com>
Co-authored-by: Joen Asmussen <joen@automattic.com>
Co-authored-by: alternatekev <alternatekev@me.com>
Co-authored-by: Kerry Liu <gwwar@users.noreply.github.com>
Co-authored-by: Bernie Reiter <ockham@raz.or.at>
Co-authored-by: Joen Asmussen <asmussen@gmail.com>
Co-authored-by: Davide Casali <folletto.id@gmail.com>
Co-authored-by: James Koster <james@jameskoster.co.uk>
Co-authored-by: Sérgio Gomes <mail@sgomes.com>
Co-authored-by: Dominik Porada <dominik@porada.co>
Co-authored-by: Noah Allen <noahtallen@gmail.com>
Co-authored-by: Colin Dellow <cldellow@gmail.com>
Co-authored-by: Dave Whitley <dw@automattic.com>
Co-authored-by: Siddarthan Sarumathi Pandian <siddarthan@outlook.com>
Co-authored-by: Brad Jorsch <brad.jorsch@automattic.com>
Co-authored-by: Jeremy Herve <jeremy@jeremy.hu>
Co-authored-by: "tim.nolte" <tim.nolte@ndigitals.com>
Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
Co-authored-by: Paul Bunkham <paul@dobit.co.uk>
Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/9210649533

Upstream-Ref: Automattic/jetpack@abe33ba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants