Skip to content

Commit

Permalink
fix: icons package
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Jun 10, 2022
1 parent 6801c3d commit 4df06c1
Show file tree
Hide file tree
Showing 15 changed files with 105 additions and 69 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
packages/*/coverage
packages/*/coverage
webpack.config.js
2 changes: 1 addition & 1 deletion .github/workflows/mobile.build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Ruby Setup for Fastlane
uses: ruby/setup-ruby@v1
- name: Install dependencies
run: yarn install && yarn run init
run: yarn install
- name: Set ssh connection to Github
uses: webfactory/ssh-agent@v0.4.1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mobile.build-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
run:
echo "PACKAGE_VERSION=$(grep '"version"' package.json | cut -d '"' -f 4)" >> $GITHUB_ENV
- name: Install dependencies
run: yarn install && yarn run init
run: yarn install
- name: Set ssh connection to Github
uses: webfactory/ssh-agent@v0.4.1
with:
Expand Down
1 change: 0 additions & 1 deletion packages/desktop/.nvmrc

This file was deleted.

2 changes: 1 addition & 1 deletion packages/desktop/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = function (api) {
'@babel/preset-env',
{
targets: {
electron: 9,
electron: 17,
},
},
],
Expand Down
1 change: 0 additions & 1 deletion packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"@svgr/webpack": "^6.2.1",
"babel-loader": "^8.2.5",
"babel-plugin-transform-runtime": "^6.23.0",
"copy-webpack-plugin": "^11.0.0",
"prettier": "*",
"react": "^18.1.0",
"react-dom": "^18.1.0",
Expand Down
14 changes: 2 additions & 12 deletions packages/icons/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const path = require('path')
module.exports = () => {
return {
entry: './src/index.ts',
Expand All @@ -9,6 +8,8 @@ module.exports = () => {
},
output: {
filename: 'index.js',
libraryTarget: 'umd',
umdNamedDefine: true,
},
resolve: {
fallback: {
Expand All @@ -31,16 +32,5 @@ module.exports = () => {
},
],
},
plugins: [
new (require('copy-webpack-plugin'))({
patterns: [
{
from: '**/*.svg',
to: 'mobile-exports',
context: path.resolve(__dirname, 'src', 'Icons'),
},
],
}),
],
}
}
2 changes: 1 addition & 1 deletion packages/mobile/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint', 'prettier'],
ignorePatterns: ['.eslintrc.js'],
ignorePatterns: ['.eslintrc.js', 'metro.config.js'],
overrides: [
{
files: ['*.ts', '*.tsx'],
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This is a React Native implementation of Standard Notes. React Native allows us
4. Install project dependencies via:

```shell
yarn run init
yarn install
```

We have two flavors of the app:
Expand Down
2 changes: 1 addition & 1 deletion packages/mobile/app.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "StandardNotes",
"displayName": "StandardNotes"
}
}
4 changes: 2 additions & 2 deletions packages/mobile/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ PODS:
- React-RCTImage
- RNSearchBar (3.5.1):
- React-Core
- RNShare (7.6.0):
- RNShare (7.6.1):
- React-Core
- RNStoreReview (0.2.1):
- React-Core
Expand Down Expand Up @@ -744,7 +744,7 @@ SPEC CHECKSUMS:
RNReanimated: 46cdb89ca59ab7181334f4ed05a70e82ddb36751
RNScreens: 40a2cb40a02a609938137a1e0acfbf8fc9eebf19
RNSearchBar: 5ed8e13ba8a6c701fbd2afdfe4164493d24b2aee
RNShare: 5972e774cd69eec879131b5283f883c1b93fc91c
RNShare: d0257bcf7aaf75d9502cea73496661c8d68f3cfc
RNStoreReview: e05edbbf426563070524cec384ac0b8df69be801
RNSVG: 302bfc9905bd8122f08966dc2ce2d07b7b52b9f8
RNVectorIcons: 7923e585eaeb139b9f4531d25a125a1500162a0b
Expand Down
25 changes: 21 additions & 4 deletions packages/mobile/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,24 @@
* https://stackoverflow.com/a/65231261/2504429
* @format
*/
const { getDefaultConfig } = require('metro-config');
const path = require('path')
const { getDefaultConfig } = require('metro-config')

const extraNodeModules = {
common: path.resolve(__dirname + '../..'),
}

module.exports = (async () => {
const {
resolver: { sourceExts, assetExts },
} = await getDefaultConfig();
} = await getDefaultConfig()

return {
watchFolders: [
__dirname,
path.resolve(__dirname, '../icons'),
path.resolve(__dirname, '../styles'),
],
transformer: {
getTransformOptions: async () => ({
transform: {
Expand All @@ -25,6 +36,12 @@ module.exports = (async () => {
resolver: {
assetExts: assetExts.filter(ext => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg'],
extraNodeModules: new Proxy(extraNodeModules, {
get: (target, name) => {
const result = name in target ? target[name] : path.join(process.cwd(), `node_modules/${name}`)
return result
},
}),
},
};
})();
}
})()
8 changes: 4 additions & 4 deletions packages/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
"ios-dev": "react-native run-ios --scheme StandardNotesDev",
"ios-prod": "react-native run-ios --scheme StandardNotes",
"clear-cache": "watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-*",
"init": "pod-install ios",
"lint": "yarn lint:eslint && yarn lint:prettier",
"lint:eslint": "yarn eslint . --ext .ts,.tsx --fix --quiet",
"lint:prettier": "prettier ./src --write",
"tsc": "tsc --noEmit",
"start": "react-native start",
"postinstall": "patch-package",
"postinstall": "patch-package && yarn pod-install ios",
"android:bundle": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/build/intermediates/res/merged/release/",
"upgrade:snjs": "ncu -u '@standardnotes/*' && yarn"
},
Expand Down Expand Up @@ -83,7 +82,7 @@
"devDependencies": {
"@babel/core": "^7.17.9",
"@babel/preset-typescript": "^7.16.7",
"@babel/runtime": "^7.17.9",
"@babel/runtime": "^7.18.3",
"@react-native-community/eslint-config": "^3.0.1",
"@standardnotes/config": "^2.4.3",
"@types/detox": "^18.1.0",
Expand All @@ -103,17 +102,18 @@
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-prettier": "^4.0.0",
"faker": "^6.6.6",
"get-yarn-workspaces": "^1.0.2",
"jest": "^27.5.1",
"jest-circus": "^27.5.1",
"metro-react-native-babel-preset": "^0.70.1",
"npm-check-updates": "^12.5.9",
"patch-package": "^6.4.7",
"pod-install": "^0.1.33",
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.6.0",
"prettier-plugin-organize-imports": "^2.3.4",
"react-devtools": "^4.24.6",
"react-devtools-core": "^4.24.6",
"react-native-monorepo-tools": "^1.1.4",
"react-native-pager-view": "^5.4.15",
"react-test-renderer": "17.0.2",
"replace-in-file": "^6.3.2",
Expand Down
55 changes: 28 additions & 27 deletions packages/mobile/src/Components/SnIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
import ArchiveIcon from '@standardnotes/icons/dist/mobile-exports/ic-archive.svg'
import AttachmentFileIcon from '@standardnotes/icons/dist/mobile-exports/ic-attachment-file.svg'
import AuthenticatorIcon from '@standardnotes/icons/dist/mobile-exports/ic-authenticator.svg'
import ClearCircleFilledIcon from '@standardnotes/icons/dist/mobile-exports/ic-clear-circle-filled.svg'
import CodeIcon from '@standardnotes/icons/dist/mobile-exports/ic-code.svg'
import FileDocIcon from '@standardnotes/icons/dist/mobile-exports/ic-file-doc.svg'
import FileImageIcon from '@standardnotes/icons/dist/mobile-exports/ic-file-image.svg'
import FileMovIcon from '@standardnotes/icons/dist/mobile-exports/ic-file-mov.svg'
import FileMusicIcon from '@standardnotes/icons/dist/mobile-exports/ic-file-music.svg'
import FileOtherIcon from '@standardnotes/icons/dist/mobile-exports/ic-file-other.svg'
import FilePdfIcon from '@standardnotes/icons/dist/mobile-exports/ic-file-pdf.svg'
import FilePptIcon from '@standardnotes/icons/dist/mobile-exports/ic-file-ppt.svg'
import FileXlsIcon from '@standardnotes/icons/dist/mobile-exports/ic-file-xls.svg'
import FileZipIcon from '@standardnotes/icons/dist/mobile-exports/ic-file-zip.svg'
import LockFilledIcon from '@standardnotes/icons/dist/mobile-exports/ic-lock-filled.svg'
import MarkdownIcon from '@standardnotes/icons/dist/mobile-exports/ic-markdown.svg'
import NotesIcon from '@standardnotes/icons/dist/mobile-exports/ic-notes.svg'
import OpenInIcon from '@standardnotes/icons/dist/mobile-exports/ic-open-in.svg'
import PencilOffIcon from '@standardnotes/icons/dist/mobile-exports/ic-pencil-off.svg'
import PinFilledIcon from '@standardnotes/icons/dist/mobile-exports/ic-pin-filled.svg'
import SpreadsheetsIcon from '@standardnotes/icons/dist/mobile-exports/ic-spreadsheets.svg'
import TasksIcon from '@standardnotes/icons/dist/mobile-exports/ic-tasks.svg'
import PlainTextIcon from '@standardnotes/icons/dist/mobile-exports/ic-text-paragraph.svg'
import RichTextIcon from '@standardnotes/icons/dist/mobile-exports/ic-text-rich.svg'
import TrashFilledIcon from '@standardnotes/icons/dist/mobile-exports/ic-trash-filled.svg'
import UserAddIcon from '@standardnotes/icons/dist/mobile-exports/ic-user-add.svg'
import FilesIllustration from '@standardnotes/icons/dist/mobile-exports/il-files.svg'
import ArchiveIcon from '@standardnotes/icons/src/Icons/ic-archive.svg'
import AttachmentFileIcon from '@standardnotes/icons/src/Icons/ic-attachment-file.svg'
import AuthenticatorIcon from '@standardnotes/icons/src/Icons/ic-authenticator.svg'
import ClearCircleFilledIcon from '@standardnotes/icons/src/Icons/ic-clear-circle-filled.svg'
import CodeIcon from '@standardnotes/icons/src/Icons/ic-code.svg'
import FileDocIcon from '@standardnotes/icons/src/Icons/ic-file-doc.svg'
import FileImageIcon from '@standardnotes/icons/src/Icons/ic-file-image.svg'
import FileMovIcon from '@standardnotes/icons/src/Icons/ic-file-mov.svg'
import FileMusicIcon from '@standardnotes/icons/src/Icons/ic-file-music.svg'
import FileOtherIcon from '@standardnotes/icons/src/Icons/ic-file-other.svg'
import FilePdfIcon from '@standardnotes/icons/src/Icons/ic-file-pdf.svg'
import FilePptIcon from '@standardnotes/icons/src/Icons/ic-file-ppt.svg'
import FileXlsIcon from '@standardnotes/icons/src/Icons/ic-file-xls.svg'
import FileZipIcon from '@standardnotes/icons/src/Icons/ic-file-zip.svg'
import LockFilledIcon from '@standardnotes/icons/src/Icons/ic-lock-filled.svg'
import MarkdownIcon from '@standardnotes/icons/src/Icons/ic-markdown.svg'
import NotesIcon from '@standardnotes/icons/src/Icons/ic-notes.svg'
import OpenInIcon from '@standardnotes/icons/src/Icons/ic-open-in.svg'
import PencilOffIcon from '@standardnotes/icons/src/Icons/ic-pencil-off.svg'
import PinFilledIcon from '@standardnotes/icons/src/Icons/ic-pin-filled.svg'
import SpreadsheetsIcon from '@standardnotes/icons/src/Icons/ic-spreadsheets.svg'
import TasksIcon from '@standardnotes/icons/src/Icons/ic-tasks.svg'
import PlainTextIcon from '@standardnotes/icons/src/Icons/ic-text-paragraph.svg'
import RichTextIcon from '@standardnotes/icons/src/Icons/ic-text-rich.svg'
import TrashFilledIcon from '@standardnotes/icons/src/Icons/ic-trash-filled.svg'
import UserAddIcon from '@standardnotes/icons/src/Icons/ic-user-add.svg'
import FilesIllustration from '@standardnotes/icons/src/Icons/il-files.svg'

import { IconType } from '@standardnotes/snjs'
import React, { FC, useContext } from 'react'
import { SvgProps } from 'react-native-svg'
Expand Down
51 changes: 40 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ __metadata:
languageName: node
linkType: hard

"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.17.9, @babel/runtime@npm:^7.18.2, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.9.2":
"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.18.2, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.9.2":
version: 7.18.3
resolution: "@babel/runtime@npm:7.18.3"
dependencies:
Expand Down Expand Up @@ -4446,7 +4446,7 @@ __metadata:
dependencies:
"@babel/core": ^7.17.9
"@babel/preset-typescript": ^7.16.7
"@babel/runtime": ^7.17.9
"@babel/runtime": ^7.18.3
"@expo/react-native-action-sheet": ^3.13.0
"@react-native-community/async-storage": 1.12.1
"@react-native-community/eslint-config": ^3.0.1
Expand Down Expand Up @@ -4483,6 +4483,7 @@ __metadata:
eslint-plugin-flowtype: ^8.0.3
eslint-plugin-prettier: ^4.0.0
faker: ^6.6.6
get-yarn-workspaces: ^1.0.2
jest: ^27.5.1
jest-circus: ^27.5.1
js-base64: ^3.7.2
Expand All @@ -4491,7 +4492,6 @@ __metadata:
npm-check-updates: ^12.5.9
patch-package: ^6.4.7
pod-install: ^0.1.33
postinstall-postinstall: ^2.1.0
prettier: ^2.6.0
prettier-plugin-organize-imports: ^2.3.4
react: 17.0.2
Expand All @@ -4510,6 +4510,7 @@ __metadata:
react-native-image-picker: ^4.7.3
react-native-keychain: ^8.0.0
react-native-mail: "standardnotes/react-native-mail#fd26119e67a2ffc5eaa95a9c17049743e39ce2d3"
react-native-monorepo-tools: ^1.1.4
react-native-pager-view: ^5.4.15
react-native-privacy-snapshot: "standardnotes/react-native-privacy-snapshot#653e904c90fc6f2b578da59138f2bfe5d7f942fe"
react-native-reanimated: ^2.8.0
Expand Down Expand Up @@ -11074,6 +11075,13 @@ __metadata:
languageName: node
linkType: hard

"find-root@npm:^1.1.0":
version: 1.1.0
resolution: "find-root@npm:1.1.0"
checksum: b2a59fe4b6c932eef36c45a048ae8f93c85640212ebe8363164814990ee20f154197505965f3f4f102efc33bfb1cbc26fd17c4a2fc739ebc51b886b137cbefaf
languageName: node
linkType: hard

"find-up@npm:5.0.0, find-up@npm:^5.0.0":
version: 5.0.0
resolution: "find-up@npm:5.0.0"
Expand Down Expand Up @@ -11157,6 +11165,13 @@ __metadata:
languageName: node
linkType: hard

"flatten@npm:^1.0.2":
version: 1.0.3
resolution: "flatten@npm:1.0.3"
checksum: 5c57379816f1692aaa79fbc6390e0a0644e5e8442c5783ed57c6d315468eddbc53a659eaa03c9bb1e771b0f4a9bd8dd8a2620286bf21fd6538a7857321fdfb20
languageName: node
linkType: hard

"flow-parser@npm:0.*":
version: 0.180.0
resolution: "flow-parser@npm:0.180.0"
Expand Down Expand Up @@ -11604,6 +11619,17 @@ __metadata:
languageName: node
linkType: hard

"get-yarn-workspaces@npm:^1.0.2":
version: 1.0.2
resolution: "get-yarn-workspaces@npm:1.0.2"
dependencies:
find-root: ^1.1.0
flatten: ^1.0.2
glob: ^7.1.2
checksum: 884a6fcb141b1a68fb0d93fdd5cbae3ef552156c1a9d35cde11bd9c706a153e1cb3b5f88314554c802c528bd2e1c69cc48fa542891db286e47ae89c85dc091ae
languageName: node
linkType: hard

"getpass@npm:^0.1.1":
version: 0.1.7
resolution: "getpass@npm:0.1.7"
Expand Down Expand Up @@ -11723,7 +11749,7 @@ __metadata:
languageName: node
linkType: hard

"glob@npm:^7.0.0, glob@npm:^7.0.3, glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6, glob@npm:^7.2.0":
"glob@npm:^7.0.0, glob@npm:^7.0.3, glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6, glob@npm:^7.1.7, glob@npm:^7.2.0":
version: 7.2.3
resolution: "glob@npm:7.2.3"
dependencies:
Expand Down Expand Up @@ -17647,13 +17673,6 @@ __metadata:
languageName: node
linkType: hard

"postinstall-postinstall@npm:^2.1.0":
version: 2.1.0
resolution: "postinstall-postinstall@npm:2.1.0"
checksum: e1d34252cf8d2c5641c7d2db7426ec96e3d7a975f01c174c68f09ef5b8327bc8d5a9aa2001a45e693db2cdbf69577094d3fe6597b564ad2d2202b65fba76134b
languageName: node
linkType: hard

"pre-push@npm:^0.1.2":
version: 0.1.2
resolution: "pre-push@npm:0.1.2"
Expand Down Expand Up @@ -18391,6 +18410,16 @@ __metadata:
languageName: node
linkType: hard

"react-native-monorepo-tools@npm:^1.1.4":
version: 1.1.4
resolution: "react-native-monorepo-tools@npm:1.1.4"
dependencies:
find-root: ^1.1.0
glob: ^7.1.7
checksum: 474ec7e5aaa4e28dac0ea96fd81d47acc5371b3e268b84ef9bd356b9db244f91d11dcf4b39616f527fa2e95fa6c94e4857b01a433357bd062761a4e90ba1f980
languageName: node
linkType: hard

"react-native-pager-view@npm:^5.4.15":
version: 5.4.24
resolution: "react-native-pager-view@npm:5.4.24"
Expand Down

0 comments on commit 4df06c1

Please sign in to comment.