-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a separate babel build process for helper functions in metamask…
… snap and removed helper functions from /core
- Loading branch information
1 parent
ff7bc3c
commit 5ea2fa4
Showing
33 changed files
with
341 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
|
||
/dist | ||
/coverage | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,48 @@ | ||
{ | ||
"name": "sei-js", | ||
"version": "1.1.5", | ||
"license": "MIT", | ||
"scripts": { | ||
"build:all": "nx run-many --target=build", | ||
"build:since": "nx affected --target=build", | ||
"lint:all": "nx run-many --target=lint", | ||
"lint:since": "nx affected --target=lint", | ||
"test:all": "nx run-many --target=test", | ||
"test:since": "nx affected --target=test", | ||
"test:coverage": "nx affected:test --all --coverage --skip-nx-cache", | ||
"release": "yarn build:all && changeset publish", | ||
"release:internal": "yarn build:all && yarn changeset && yarn changeset version --snapshot internal && yarn changeset publish --no-git-tag --snapshot --tag internal", | ||
"postrelease": "git push --follow-tags" | ||
}, | ||
"private": true, | ||
"dependencies": { | ||
"@changesets/cli": "^2.26.0" | ||
}, | ||
"devDependencies": { | ||
"@nrwl/eslint-plugin-nx": "15.5.1", | ||
"@nrwl/nx-cloud": "latest", | ||
"@nrwl/workspace": "15.5.1", | ||
"@types/jest": "^29.5.5", | ||
"@types/node": "20.8.2", | ||
"@typescript-eslint/eslint-plugin": "^5.50.0", | ||
"@typescript-eslint/parser": "^5.50.0", | ||
"eslint": "^8.33.0", | ||
"eslint-config-prettier": "8.1.0", | ||
"eslint-plugin-import": "2.26.0", | ||
"eslint-plugin-jsx-a11y": "6.6.1", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-react": "7.31.11", | ||
"eslint-plugin-react-hooks": "4.6.0", | ||
"jest": "29.7.0", | ||
"jest-environment-jsdom": "28.1.1", | ||
"nx": "15.5.1", | ||
"prettier": "^2.6.2", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "29.1.1", | ||
"ts-node": "10.9.1", | ||
"typescript": "~4.8.4" | ||
}, | ||
"workspaces": [ | ||
"packages/*" | ||
] | ||
"name": "sei-js", | ||
"version": "1.1.5", | ||
"private": true, | ||
"license": "MIT", | ||
"workspaces": [ | ||
"packages/*" | ||
], | ||
"scripts": { | ||
"build:all": "nx run-many --target=build", | ||
"build:since": "nx affected --target=build", | ||
"lint:all": "nx run-many --target=lint", | ||
"lint:since": "nx affected --target=lint", | ||
"release": "yarn build:all && changeset publish", | ||
"postrelease": "git push --follow-tags", | ||
"release:internal": "yarn build:all && yarn changeset && yarn changeset version --snapshot internal && yarn changeset publish --no-git-tag --snapshot --tag internal", | ||
"test:all": "nx run-many --target=test", | ||
"test:coverage": "nx affected:test --all --coverage --skip-nx-cache", | ||
"test:since": "nx affected --target=test" | ||
}, | ||
"dependencies": { | ||
"@changesets/cli": "^2.26.0" | ||
}, | ||
"devDependencies": { | ||
"@nrwl/eslint-plugin-nx": "15.5.1", | ||
"@nrwl/nx-cloud": "latest", | ||
"@nrwl/workspace": "15.5.1", | ||
"@types/jest": "^29.5.5", | ||
"@types/node": "20.8.2", | ||
"@typescript-eslint/eslint-plugin": "^5.50.0", | ||
"@typescript-eslint/parser": "^5.50.0", | ||
"eslint": "^8.33.0", | ||
"eslint-config-prettier": "8.1.0", | ||
"eslint-plugin-import": "2.26.0", | ||
"eslint-plugin-jsx-a11y": "6.6.1", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-react": "7.31.11", | ||
"eslint-plugin-react-hooks": "4.6.0", | ||
"jest": "29.7.0", | ||
"jest-environment-jsdom": "28.1.1", | ||
"nx": "15.5.1", | ||
"prettier": "^2.6.2", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "29.1.1", | ||
"ts-node": "10.9.1", | ||
"typescript": "~4.8.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,41 @@ | ||
{ | ||
"name": "@sei-js/core", | ||
"version": "3.1.1", | ||
"version": "0.0.0-internal-20231129052901", | ||
"private": false, | ||
"description": "TypeScript library for front end integrations with Sei", | ||
"keywords": [ | ||
"sei", | ||
"javascript", | ||
"typescript" | ||
], | ||
"homepage": "https://github.com/sei-protocol/sei-js#readme", | ||
"repository": "[email protected]:sei-protocol/sei-js.git", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"exports": { | ||
".": { | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/cjs/index.js", | ||
"browser": { | ||
"import": "./dist/esm/index-browser.js", | ||
"require": "./dist/cjs/index-browser.js" | ||
}, | ||
"types": "./dist/types/index.d.ts" | ||
} | ||
}, | ||
"main": "./dist/cjs/index.js", | ||
"module": "./dist/esm/index.js", | ||
"browser": "./dist/esm/index-browser.js", | ||
"sideEffects": false, | ||
"types": "./dist/types/index.d.ts", | ||
"scripts": { | ||
"prebuild": "rimraf dist", | ||
"build": "yarn build:types && yarn build:cjs && yarn build:esm && yarn build:prettier", | ||
"build:types": "tsc --project tsconfig.declarations.json", | ||
"build:cjs": "BABEL_ENV=cjs babel src --out-dir dist/cjs --extensions '.js,.jsx,.ts,.tsx' --source-maps --copy-files --no-copy-ignored", | ||
"build:esm": "BABEL_ENV=esm babel src --out-dir dist/esm --extensions '.js,.jsx,.ts,.tsx' --source-maps --copy-files --no-copy-ignored", | ||
"build:prettier": "prettier --write 'dist/**/*.js'", | ||
"build:types": "tsc --project tsconfig.declarations.json", | ||
"test": "jest" | ||
}, | ||
"homepage": "https://github.com/sei-protocol/sei-js#readme", | ||
"keywords": [ | ||
"sei", | ||
"javascript", | ||
"typescript" | ||
], | ||
"repository": "[email protected]:sei-protocol/sei-js.git", | ||
"license": "MIT", | ||
"private": false, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"@cosmjs/amino": "^0.29.5", | ||
"@cosmjs/cosmwasm-stargate": "^0.29.5", | ||
|
@@ -58,15 +66,7 @@ | |
"@types/elliptic": "^6.4.14", | ||
"@types/sha.js": "^2.4.1" | ||
}, | ||
"exports": { | ||
".": { | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/cjs/index.js", | ||
"browser": { | ||
"import": "./dist/esm/index-browser.js", | ||
"require": "./dist/cjs/index-browser.js" | ||
}, | ||
"types": "./dist/types/index.d.ts" | ||
} | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
export * from './queryClient'; | ||
export * from './signingClient'; | ||
export * from './snaps'; | ||
export * from './wallet'; | ||
export * from './utils'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,16 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es6", | ||
"module": "es6", | ||
"declaration": true, | ||
"outDir": "./dist/types", | ||
"strict": true, | ||
"moduleResolution": "node", | ||
"allowSyntheticDefaultImports": true, | ||
"skipLibCheck": true, | ||
"noImplicitAny": false, | ||
"lib": [ | ||
"ES6", | ||
"DOM" | ||
] | ||
}, | ||
"include": ["src"], | ||
"exclude": [ | ||
"node_modules", | ||
"**/*.spec.ts", | ||
"**/*.test.ts", | ||
"**/__tests__/**/*" | ||
] | ||
"compilerOptions": { | ||
"target": "es6", | ||
"module": "es6", | ||
"declaration": true, | ||
"outDir": "./dist/types", | ||
"strict": true, | ||
"moduleResolution": "node", | ||
"allowSyntheticDefaultImports": true, | ||
"skipLibCheck": true, | ||
"noImplicitAny": false, | ||
"lib": ["ES6", "DOM"] | ||
}, | ||
"include": ["src"], | ||
"exclude": ["node_modules", "**/*.spec.ts", "**/*.test.ts", "**/__tests__/**/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module.exports = (api) => { | ||
const babelEnv = process.env.BABEL_ENV || 'esm'; | ||
|
||
api.cache(() => babelEnv); | ||
|
||
const isESM = babelEnv === 'esm'; | ||
|
||
const commonjsPresets = [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
modules: 'commonjs' | ||
} | ||
], | ||
'@babel/preset-typescript' | ||
]; | ||
|
||
const esmPresets = ['@babel/preset-env', '@babel/preset-typescript']; | ||
|
||
return { | ||
presets: isESM ? esmPresets : commonjsPresets, | ||
plugins: ['@babel/plugin-transform-runtime'], | ||
ignore: ['**/*.spec.ts', '**/*.spec.tsx', '**/*.spec.js', '**/*.spec.jsx', '**/__tests__/**/*', '**/__mocks__/**/*'] | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
node_modules | ||
dist | ||
snap | ||
lib | ||
|
||
**/tests/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"root": true, | ||
"rules": { | ||
"no-case-declarations": "off" | ||
} | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"root": true, | ||
"rules": { | ||
"no-case-declarations": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'jsdom', | ||
testPathIgnorePatterns: ['node_modules', 'dist', 'src/lib/__tests__/snapWallet.spec.ts'] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.