Skip to content

Commit

Permalink
Add react-native-svg compatible package (#548)
Browse files Browse the repository at this point in the history
* Disable workflow push trigger while developing

* Disable publishing on push during development

* Set up alpha test package

* Initial commit of react-native-icons package to test in workflow

* Add native flag to svgr

* Don't update readme versions for now

* Try to fix unspecified token. Use the default which should be github.token

* Skip building some libaries while developing react-native-icons

* Copy over react-icon utils for now

* Add missed files.

* Use default token for publish

* set a token for npm-publish

* Publish our test package to github packages

* Workflow yaml

* Update workflow yaml

* Update workflow

* Update workflow

* Figuring out params to get workflow to publish

* Release 1.1.191

* Update workflow command args

* Update package version

* Release 1.1.191

* Release 1.1.191

* Release 1.1.191

* convert to rnsvg

* Package versions

* Package versioning

* Release 0.0.5

* Add command line option for react native svgr

* Path joining ../../assets and ./intermediate doesn't seem to do the intended thing of placing the path within the intermediate directory.

* update

* missed files

* classname is unused here, remove it

* Add rect to import

* Add import for rnsvg element only if present in chunk.

* Better substring for rnsvg element detection

* Add react preset for babel

* Release 0.0.6

* Set rnsvg dependency to ^12.3.0

* Release 0.0.7

* Modify react-native version and types version

* yarn.lock

* Release 0.0.8

* Import * from react rather than react-native because apparently that is where createElement is.

* Release 0.0.9

* Update svgr to no longer output 1em when icon is true

* Upgraded svgr version

* Whitespace

* Release 0.0.10

* spread props at the end so overrides can be passed in

* Release 0.0.11

* See if the previous version of svgr work with size changing now that we spread the properties at the end.

* yarn lock

* Just use the latest svgr, no reason not to.

* Go back to 6.5.0 template syntax

* Go back to 6.5.0 file template syntax

* Release 0.0.12

* Update publish.yml

* Update publish.yml

* Release 0.0.13

* Removing stray folder

* Update ignore file to ignore intermediate output

* delete intermediates

* delete intermediates

* Use much more robust regex for detecting what imports should be made in a chunk

* Release 0.0.14

* Add back some of the rest of the workflow to make sure it still works

* whitespace

* Use our own secret instead of the upstream repo secret

* Disable flutter step

* Release 1.1.193

* Release 1.1.194

* Dump latest ios assets from upstream

* This path joining didnt work locally but lets see if it works in the workflow

* Release 1.1.195

* This isn't working locally. Print out some info to the log to see what its doing in the workflow and whats different.

* Delete stray files. Gotta find out why it ended up here

* Release 1.1.196

* Log paths here to examine behavior in workflow

* Log args

* Delete stray package output

* Add logging to determine behavior in workflow

* Add more logging

* More logging

* Remove a path.relative call while generting a path.

* Release 1.1.197

* Delete stray packages

* Delete stray package

* Fix bad merge of these assets

* Disable pushing of new package into the repo for less noise while iterating

* Remove extra logging now that we found the issue was detecting / to cut up paths doesn't work in windows

* Whitespace

* Clean up

* Add a new package to publish a react-native-svg version of this icon package. This is a modified version of the react-icons package designed to output a package compatible with react-native-svg.

To accomplish this we we need to use a later version of SVGR which has some changes with file templates and possibly sizing output that are incompatible with the current react-icons code.

Ideally we might want to produce some common code between the two but I don't want to risk breaking anything in react-icons with this additional package.

* Add React-native-svg package for fluent icons

    Add a new package to publish a react-native-svg version of this icon package. This is a modified version of the react-icons package designed to output a package compatible with react-native-svg.

    To accomplish this we we need to use a later version of SVGR which has some changes with file templates and possibly sizing output that are incompatible with the current react-icons code.

    Ideally we might want to produce some common code between the two but I don't want to risk breaking anything in react-icons with this additional package.

* Update README.md

* Revert "Add a new package to publish a react-native-svg version of this icon package. This is a modified version of the react-icons package designed to output a package compatible with react-native-svg."

This reverts commit 35729cf.

* These files shouldnt be needed for the rnsvg package

* Remove BundleIcon refernce

* These files shouldnt be needed for the rnsvg package

* Remove BundleIcon refernce

* Remove font related processing

* Update publish.yml

* Update publish.yml

* yarn lock

* package-lock.json and yan.lock update

* Fix merge

* Fix merge of publish.yml

* Whitespace in cocoapods-publish.yml

* Whitespace in cocoapods-publish.yml

* Whitespace in publish.yml

* More whitespace

Using the git web editor isn't the best.

---------

Co-authored-by: Fluent Build System <[email protected]>
  • Loading branch information
warren-ms and fluentCI authored Mar 30, 2023
1 parent c445142 commit 14164ca
Show file tree
Hide file tree
Showing 22 changed files with 21,287 additions and 9,440 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ jobs:
os.system(f'echo \"REACT_VERSION={major}.{minor}.{int(asset) + 1}\" >> \$GITHUB_ENV')
"""
# Needs to be "-E" instead of "-r" on macOS
- name: Replace version number in react-native-icons/package.json
run: |
sed -i.bk -r "s/\"version\": \"[0-9]+\.[0-9]+\.[0-9]+(-beta\.[0-9]+)?(-rc\.[0-9]+)?\"/\"version\": \"$REACT_VERSION\"/g" packages/react-native-icons/package.json
rm packages/react-native-icons/package.json.bk
- name: Use Node 18
uses: actions/setup-node@v1
with:
Expand Down Expand Up @@ -101,7 +107,7 @@ jobs:
rm flutter/pubspec.yaml.bk
# Needs to be "-E" instead of "-r" on macOS
- name: Replace version number in svg-icons/package.json
- name: Replace version number in package.json
run: |
sed -i.bk -r "s/\"version\": \"[0-9]+\.[0-9]+\.[0-9]+\"/\"version\": \"$NEW_VERSION\"/g" packages/svg-icons/package.json
rm packages/svg-icons/package.json.bk
Expand Down Expand Up @@ -147,17 +153,22 @@ jobs:
npm run build
working-directory: packages/react-icons-font-subsetting-webpack-plugin

- name: Build React-Native library
run: |
npm run build
working-directory: packages/react-native-icons

- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
package: packages/svg-icons/package.json
package: packages/svg-sprites/package.json

- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
token: ${{ secrets.NPM_TOKEN }}
access: public
package: packages/svg-sprites/package.json
package: packages/react-native-icons/package.json

- uses: JS-DevTools/npm-publish@v1
with:
Expand All @@ -171,6 +182,17 @@ jobs:
access: public
package: packages/react-icons-font-subsetting-webpack-plugin/package.json

- name: Build React-Native library
run: |
npm run build
working-directory: packages/react-native-icons

- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: public
package: packages/react-native-icons/package.json

## Android
- name: Run Android generate script
env:
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ packages/react-icons/src/index.tsx
packages/react-icons/yarn.lock
packages/react-icons/package-lock.json

packages/react-native-icons/intermediate
packages/react-native-icons/react-icons-test/
packages/react-native-icons/lib/
packages/react-native-icons/lib-cjs/
packages/react-native-icons/src/icons
packages/react-native-icons/src/sizedIcons
packages/react-native-icons/src/index.tsx
packages/react-native-icons/yarn.lock
packages/react-native-icons/package-lock.json

# Some Fluent tooling generates this for internal tracking assistance. Make sure it doesn't get committed.
SvgList.txt

Expand Down
2 changes: 1 addition & 1 deletion importer/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function processFolder(srcPath, destPath, folderDepth) {
}

if (stat.isDirectory()) {
const folderName = srcFile.substring(srcFile.lastIndexOf('/') + 1)
const folderName = path.basename(srcFile)
let locPath = destPath
if (KEEP_DIRS) {
if (folderName !== EXTENSION.toUpperCase()) {
Expand Down
Loading

0 comments on commit 14164ca

Please sign in to comment.