Skip to content

Commit dbad8f5

Browse files
authored
refactor: build chain to rollup (#104)
1 parent c95cbc6 commit dbad8f5

File tree

190 files changed

+6564
-10381
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+6564
-10381
lines changed

.eslintrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"rules": {
33
"@typescript-eslint/ban-ts-ignore": ["off"],
4+
"@typescript-eslint/ban-ts-comment": ["off"],
45
"@typescript-eslint/camelcase": ["off"],
56
"@typescript-eslint/explicit-function-return-type": ["off"],
67
"@typescript-eslint/interface-name-prefix": ["off"],
@@ -13,6 +14,8 @@
1314
"comma-dangle": ["error", "always-multiline"],
1415
"no-async-promise-executor": ["off"],
1516
"no-empty-pattern": ["off"],
17+
"no-use-before-define": ["off"],
18+
"prefer-regex-literals": ["off"],
1619
"no-undef": ["error"],
1720
"no-var": ["error"],
1821
"object-curly-spacing": ["error", "always"],
@@ -33,7 +36,8 @@
3336
"standard",
3437
"eslint:recommended",
3538
"plugin:@typescript-eslint/eslint-recommended",
36-
"plugin:@typescript-eslint/recommended"
39+
"plugin:@typescript-eslint/recommended",
40+
"prettier"
3741
],
3842
"parser": "@typescript-eslint/parser",
3943
"parserOptions": {

.github/workflows/build.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
on: push
2+
3+
name: CI Checks
4+
5+
jobs:
6+
ci:
7+
name: CI
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
test-prefix:
12+
- misc/logger
13+
- misc/encoding
14+
- misc/keyvaluestorage
15+
- misc/time
16+
- misc/heartbeat
17+
- misc/history
18+
- misc/environment
19+
- misc/cacao
20+
- misc/identity-keys
21+
- misc/events
22+
- misc/did-jwt
23+
- misc/safe-json
24+
- crypto/ecies-25519
25+
- crypto/crypto
26+
- crypto/randombytes
27+
- jsonrpc/types
28+
- jsonrpc/provider
29+
- jsonrpc/utils
30+
- jsonrpc/http-connection
31+
- jsonrpc/ws-connection
32+
- browser/window-getters
33+
- browser/window-metadata
34+
- relay/relay-api
35+
- relay/relay-auth
36+
steps:
37+
- uses: actions/checkout@v3
38+
- uses: actions/setup-node@v3
39+
with:
40+
node-version: 16
41+
42+
- name: Check node_modules cache
43+
id: cache-node-modules
44+
uses: actions/cache@v3
45+
with:
46+
path: |
47+
node_modules
48+
*/*/node_modules
49+
key: ${{ runner.os }}-nodemodules-${{ hashFiles('**/package-lock.json') }}
50+
restore-keys: |
51+
${{ runner.os }}-nodemodules-
52+
53+
- name: Install NPM Dependencies
54+
run: npm install
55+
56+
- name: Bootstrap packages
57+
run: npm run bootstrap
58+
59+
- name: Prettier
60+
run: npm run prettier --prefix=${{ matrix.test-prefix }} --if-present
61+
62+
- name: Lint
63+
run: npm run lint --prefix=${{ matrix.test-prefix }} --if-present
64+
65+
- name: Build
66+
run: npm run build
67+
68+
- name: Test
69+
run: npm run test --prefix=${{ matrix.test-prefix }} --if-present
70+
env:
71+
TEST_PROJECT_ID: ${{ secrets.TEST_PROJECT_ID }}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ zip
3030
.nyc_output
3131
tsconfig.tsbuildinfo
3232

33-
.vscode

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"tabWidth": 2,
33
"useTabs": false,
44
"trailingComma": "all",
5-
"printWidth": 100
5+
"printWidth": 100,
6+
"arrowParens": "always"
67
}

.vscode/settings.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.formatOnSave": true,
4+
"prettier.configPath": ".prettierrc",
5+
"[javascript]": {
6+
"editor.defaultFormatter": "esbenp.prettier-vscode"
7+
},
8+
"[typescript]": {
9+
"editor.defaultFormatter": "esbenp.prettier-vscode"
10+
},
11+
"[jsx]": {
12+
"editor.defaultFormatter": "esbenp.prettier-vscode"
13+
},
14+
"[tsx]": {
15+
"editor.defaultFormatter": "esbenp.prettier-vscode"
16+
},
17+
"eslint.workingDirectories": ["./"]
18+
}

browser/window-getters/package.json

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
"files": [
1515
"dist"
1616
],
17-
"main": "dist/cjs/index.js",
18-
"types": "dist/cjs/index.d.ts",
19-
"unpkg": "dist/umd/index.min.js",
17+
"main": "dist/index.cjs.js",
18+
"module": "dist/index.es.js",
19+
"browser": "dist/index.es.js",
20+
"unpkg": "dist/index.umd.js",
21+
"types": "dist/types/index.d.ts",
2022
"homepage": "https://github.com/walletconnect/walletconnect-utils",
2123
"repository": {
2224
"type": "git",
@@ -27,37 +29,25 @@
2729
},
2830
"scripts": {
2931
"clean": "rm -rf dist",
30-
"build:cjs": "tsc -p tsconfig.cjs.json",
31-
"build:esm": "tsc -p tsconfig.esm.json",
32-
"build:umd": "webpack",
33-
"build": "run-s clean build:cjs build:esm build:umd ",
32+
"build:pre": "npm run clean",
33+
"build:types": "tsc",
34+
"build:source": "rollup --config rollup.config.js",
35+
"build": "npm run build:pre; npm run build:source; npm run build:types",
3436
"test": "env TS_NODE_PROJECT=\"tsconfig.cjs.json\" mocha --timeout 5000 --exit -r ts-node/register ./test/**/*.test.ts",
3537
"lint": "eslint -c '../../.eslintrc' --fix './src/**/*.ts'",
3638
"npm-publish:latest": "npm publish --access public --tag latest",
3739
"npm-publish:canary": "npm publish --access public --tag canary",
38-
"prepublishOnly": "npm run test && npm run build"
40+
"prepublishOnly": "npm run test && npm run build",
41+
"prettier": "prettier --config ../../.prettierrc --check {src,test}/**/*.ts",
42+
"format": "prettier --config ../../.prettierrc --write {src,test}/**/*.ts"
3943
},
4044
"devDependencies": {
4145
"@types/bn.js": "4.11.6",
4246
"@types/jest": "^26.0.15",
4347
"@types/node": "^14.14.7",
44-
"husky": "^4.3.0",
4548
"typescript": "^4.9.5",
4649
"webpack": "^4.41.6",
4750
"webpack-cli": "^3.3.11"
4851
},
49-
"husky": {
50-
"hooks": {
51-
"pre-commit": "run-s lint"
52-
}
53-
},
54-
"prettier": {
55-
"printWidth": 80,
56-
"semi": true,
57-
"singleQuote": false,
58-
"trailingComma": "es5"
59-
},
60-
"dependencies": {
61-
"tslib": "1.14.1"
62-
}
52+
"dependencies": {}
6353
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { name, dependencies } from "./package.json";
2+
import createConfig from "../../rollup.config";
3+
4+
export default createConfig(name, Object.keys(dependencies));

browser/window-getters/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export function getFromWindow<T>(name: string): T | undefined {
2-
let res: T | undefined = undefined;
2+
let res: T | undefined;
33
if (typeof window !== "undefined" && typeof window[name] !== "undefined") {
44
res = window[name];
55
}

browser/window-getters/tsconfig.esm.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)