Skip to content
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
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist
/docs
examples
node_modules
types/demo
42 changes: 42 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"extends": ["prettier", "eslint:recommended"],
"settings": {
"import/extensions": ["", ".js", ".ejs", ".json", ".yml", ".jsx"],
"import/ignore": [".ejs$", ".yml$", ".jsx", "node_modules"]
},
"rules": {
"no-console": "off",
"import/no-unresolved": "off",
"no-param-reassign": "off",
"filenames/match-regex": "off",
"lines-between-class-members": "off",
"global-require": "off"
},
"globals": {
"window": true,
"$": true
},
"parserOptions": {
"ecmaVersion": 13,
"requireConfigFile": false,
"sourceType": "module"
},
"env": {
"node": true,
"es6": true
},
"overrides": [
{
"files": ["**/*.ts"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module"
},
"rules": {
"no-undef": "off"
}
}
]
}
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-node@v7
with:
node-version: 24
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just install install-styleguide build test
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just install build test
# node-compatibility checks that the build version of the app can be imported
# and used on older versions of node
node-compatibility:
Expand All @@ -30,7 +30,7 @@ jobs:
- uses: actions/setup-node@v7
with:
node-version: 24
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just install install-styleguide build
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just install build
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
Expand All @@ -48,7 +48,7 @@ jobs:
cd types/demo
npm install
cd ../../
just install install-styleguide typescript
just install typescript
lint:
runs-on: ubuntu-latest
steps:
Expand All @@ -57,7 +57,7 @@ jobs:
- uses: actions/setup-node@v7
with:
node-version: 24
- run: just install install-styleguide build lint
- run: just install build lint
coverage:
runs-on: ubuntu-latest
steps:
Expand All @@ -66,7 +66,7 @@ jobs:
- uses: actions/setup-node@v7
with:
node-version: 24
- run: just install install-styleguide build
- run: just install build
- run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 just coverage
- name: Coverage
if: github.ref == 'refs/heads/master'
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ docs
Icon
node_modules
npm-debug.log
/.eslintrc
/.eslintignore
/.prettierrc.yml
/.prettierignore
15 changes: 15 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.golangci.yml
.mypy_cache
.nyc_output
cassettes
composer.json
composer.lock
coverage
dist/
/docs
examples
official/fixtures/
package-lock.json
style_guides/
vendor/
venv/
3 changes: 3 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
trailingComma: all
singleQuote: true
printWidth: 100
2 changes: 2 additions & 0 deletions audit-ci.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
"GHSA-7r86-cg39-jmmj",
"GHSA-mh99-v99m-4gvg",
"GHSA-rgw5-rvv9-x895",
"GHSA-5p4m-2wfm-xmqj",
"GHSA-7p8r-x3mc-p8w7",
],
}
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@
"docs": "jsdoc src/models src/services src/errors src/utils -d docs",
"format": "prettier --write .",
"formatCheck": "prettier --check .",
"lint": "eslint --ext .js,.ts .",
"lintFix": "eslint --ext .js,.ts --fix .",
"lint": "eslint --ext .js,.ts --ignore-pattern 'examples/**' .",
"lintFix": "eslint --ext .js,.ts --ignore-pattern 'examples/**' --fix .",
"prepublishOnly": "npm run clean && npm run build && npm run test && npm run lint && npm run formatCheck",
"scan": "npx audit-ci -m --config ./audit-ci.jsonc",
"test": "cross-env NODE_ENV=test vitest run",
"test:node-compatibility": "cross-env NODE_ENV=test node ./test/node_compatibility",
"typescript": "npx tsc",
"typescript": "npm run typescript:declarations && npm run typescript:source",
"typescript:declarations": "npx tsc -p tsconfig.json",
"typescript:source": "npx tsc -p tsconfig.build.json",
"watch": "vite build --watch"
},
"dependencies": {
Expand Down
11 changes: 11 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"target": "es5",
"module": "nodenext",
"strict": true,
"ignoreDeprecations": "5.0",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
}
}
11 changes: 11 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"checkJs": false,
"declaration": true,
"noEmit": true
},
"include": ["src/**/*.js", "src/**/*.ts", "test/**/*.js", "test/**/*.ts"],
"exclude": ["dist/**", "docs/**", "coverage/**", "node_modules/**"]
}
8 changes: 2 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"target": "es5",
"module": "nodenext",
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true
"noEmit": true
},
"include": ["types"]
}