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

feat(sdk): remove i18next dependency #1135

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/devnext/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const nextConfig = withExpo({
'@expo/vector-icons',
'@metamask/sdk-communication-layer',
'@metamask/sdk',
'@metamask/sdk-install-modal-web',
'@metamask/sdk-react',
'@metamask/sdk-react-ui',
'@metamask/sdk-ui',
Expand Down
1 change: 0 additions & 1 deletion packages/devnext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"@metamask/providers": "16.1.0",
"@metamask/sdk": "workspace:^",
"@metamask/sdk-communication-layer": "workspace:^",
"@metamask/sdk-install-modal-web": "workspace:^",
"@metamask/sdk-lab": "workspace:^",
"@metamask/sdk-react": "workspace:^",
"@metamask/sdk-react-ui": "workspace:^",
Expand Down
3 changes: 0 additions & 3 deletions packages/devnext/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
"@metamask/sdk-communication-layer": [
"../sdk-communication-layer/src"
],
"@metamask/sdk-install-modal-web": [
"../sdk-install-modal-web/src"
],
"@metamask/sdk-react": [
"../sdk-react/src"
],
Expand Down
1 change: 0 additions & 1 deletion packages/devreact/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"typeRoots": ["./types", "./node_modules/@types"],
"paths": {
"@metamask/sdk-communication-layer": ["../sdk-communication-layer/src"],
"@metamask/sdk-install-modal-web": ["../sdk-install-modal-web/src"],
"@metamask/sdk-react": ["../sdk-react/src"],
"@metamask/sdk-react-ui": ["../sdk-react-ui/src"],
"@metamask/sdk": ["../sdk/src"],
Expand Down
2 changes: 1 addition & 1 deletion packages/examples/react-demo/sdk-copy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cp -rf $SDK_DIR/package.json node_modules/@metamask/sdk/package.json
cp -rf $SDK_REACT_DIR/dist node_modules/@metamask/sdk-react/dist
cp -rf $SDK_REACT_DIR/package.json node_modules/@metamask/sdk-react/package.json

cp -rf $SDK_INSTALL_MODAL_WEB_DIR/dist node_modules/@metamask/sdk-install-modal-web/dist
cp -rf $SDK_INSTALL_MODAL_WEB_DIR/dist node_modules/@metamask/sdk-install-modal-web
cp -rf $SDK_INSTALL_MODAL_WEB_DIR/package.json node_modules/@metamask/sdk-install-modal-web/package.json

# Remove vite cache
Expand Down
3 changes: 3 additions & 0 deletions packages/sdk-install-modal-web/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ module.exports = {
'**/coverage/**',
'postcss.config.js',
'jest-preload.js',
'loader',
'.stencil',
'stencil.config.ts',
],

parserOptions: {
Expand Down
29 changes: 29 additions & 0 deletions packages/sdk-install-modal-web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,32 @@ node_modules/
# lock files
yarn.lock
package-lock.json

# == Stencil ==
dist/
www/
loader/

*~
*.sw[mnpcod]
*.log
*.lock
*.tmp
*.tmp.*
log.txt
*.sublime-project
*.sublime-workspace

.stencil/
.idea/
.vscode/
.sass-cache/
.versions/
node_modules/
$RECYCLE.BIN/

.DS_Store
Thumbs.db
UserInterfaceState.xcuserstate
.env
# ====
84 changes: 39 additions & 45 deletions packages/sdk-install-modal-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,43 @@
},
"author": "MetaMask",
"packageManager": "yarn@3.5.0",
"main": "dist/cjs/index.js",
"module": "dist/es/index.js",
"unpkg": "dist/umd/index.js",
"browser": "dist/es/index.js",
"types": "dist/types/src/index.d.ts",
"main": "dist/components/index.js",
"module": "dist/components/index.js",
"types": "dist/components/index.d.ts",
"files": [
"/dist"
"./dist"
],
"exports": {
".": {
"import": "./dist/components/index.js",
"types": "./dist/components/index.d.ts"
},
"./components/mm-install-modal": {
"import": "./dist/components/mm-install-modal.js",
"types": "./dist/components/mm-install-modal.d.ts"
},
"./components/mm-pending-modal": {
"import": "./dist/components/mm-pending-modal.js",
"types": "./dist/components/mm-pending-modal.d.ts"
},
"./components/mm-select-modal": {
"import": "./dist/components/mm-select-modal.js",
"types": "./dist/components/mm-select-modal.d.ts"
}
},
"scripts": {
"allow-scripts": "",
"generate": "stencil generate",
"build:types": "tsc --project tsconfig.json --emitDeclarationOnly --outDir dist/types",
"build:clean": "yarn clean && yarn build",
"build": "yarn build:types && rollup -c --bundleConfigAsCjs",
"build:dev": "yarn build:types && NODE_ENV=dev rollup -c --bundleConfigAsCjs",
"build": "stencil build --prod",
"build:dev": "stencil build --debug --dev",
"build:tsc": "tsc --build tsconfig.json --verbose",
"build:watch": "webpack-cli --watch",
"build:watch": "stencil build --watchAll",
"build:post-tsc": "echo 'N/A'",
"build:pre-tsc": "echo 'N/A'",
"size": "size-limit",
"build:release": "yarn version && webpack-cli --mode production",
"clean": "rimraf ./dist",
"build:release": "yarn version && stencil build",
"clean": "rimraf ./dist && rimraf ./loader",
"lint": "yarn lint:eslint && yarn lint:misc --check",
"lint:changelog": "../../scripts/validate-changelog.sh @metamask/sdk-install-modal-web",
"lint:eslint": "eslint . --cache --ext js,ts",
Expand All @@ -41,23 +58,22 @@
"prepack": "../../scripts/prepack.sh",
"publish:preview": "yarn npm publish --tag preview",
"reset": "yarn clean && rimraf ./node_modules/",
"start": "webpack-dev-server",
"test": "echo \"Running tests for version $npm_package_version...\"",
"start": "stencil build --dev --watch --serve",
"test": "stencil test --spec --e2e",
"test:watch": "stencil test --spec --e2e --watchAll",
"test:ci": "jest --coverage --passWithNoTests --setupFilesAfterEnv ./jest-preload.js",
"preversion": "yarn test",
"postversion": "git push --tags && yarn publish . --tag $npm_package_version && git push && echo \"Successfully released version $npm_package_version!\""
},
"devDependencies": {
"@lavamoat/allow-scripts": "^2.3.1",
"@metamask/auto-changelog": "3.1.0",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-terser": "^0.4.1",
"@rollup/plugin-typescript": "^11.1.1",
"@size-limit/preset-big-lib": "^11.0.2",
"@stencil/core": "^4.22.2",
"@types/i18n": "^0.13.12",
"@types/jest": "^29.5.14",
"@types/node": "^22.9.0",
"@types/prettier": "^2",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@typescript-eslint/eslint-plugin": "^5.56.0",
"@typescript-eslint/parser": "^5.56.0",
"eslint": "^8.36.0",
Expand All @@ -68,39 +84,17 @@
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.32.2",
"i18next": "23.11.5",
"jest": "^29.6.4",
"postcss": "^8.4.35",
"jest": "^29.7.0",
"jest-cli": "^29.7.0",
"prettier": "^2.8.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"puppeteer": "^23.8.0",
"rimraf": "^5.0.0",
"rollup": "^4.26.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-sizes": "^1.0.6",
"rollup-plugin-typescript2": "^0.36.0",
"rollup-plugin-visualizer": "^5.12.0",
"size-limit": "^11.0.2",
"typescript": "^5.6.3"
},
"peerDependencies": {
"i18next": "23.11.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-native": "*"
},
"peerDependenciesMeta": {
"react": {
"optional": true
},
"react-dom": {
"optional": true
},
"react-native": {
"optional": true
}
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
Expand Down
3 changes: 0 additions & 3 deletions packages/sdk-install-modal-web/postcss.config.js

This file was deleted.

88 changes: 0 additions & 88 deletions packages/sdk-install-modal-web/rollup.config.js

This file was deleted.

Loading
Loading