Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
37 changes: 24 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ jobs:
uses: actions/checkout@v4

- name: Set up node
uses: actions/setup-node@v3
uses: actions/setup-node@v4

- name: Install dependencies
run: yarn install

- name: Compile
run: yarn && yarn build
run: yarn build

test:
runs-on: ubuntu-latest
Expand All @@ -24,34 +27,42 @@ jobs:
uses: actions/checkout@v4

- name: Set up node
uses: actions/setup-node@v3
uses: actions/setup-node@v4

- name: Compile
run: yarn && yarn test
- name: Install dependencies
run: yarn install

- name: Test
run: yarn test

publish:
needs: [ compile, test ]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
id-token: write # Required for OIDC
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up node
uses: actions/setup-node@v3
uses: actions/setup-node@v4

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build

- name: Publish to npm
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
publish() { # use latest npm to ensure OIDC support
npx -y npm@latest publish "$@"
}
if [[ ${GITHUB_REF} == *alpha* ]]; then
npm publish --access public --tag alpha
publish --access public --tag alpha
elif [[ ${GITHUB_REF} == *beta* ]]; then
npm publish --access public --tag beta
publish --access public --tag beta
else
npm publish --access public
fi
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
publish --access public
fi
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ tests
.github
.fernignore
.prettierrc.yml
biome.json
tsconfig.json
yarn.lock
yarn.lock
pnpm-lock.yaml
2 changes: 0 additions & 2 deletions .prettierrc.yml

This file was deleted.

74 changes: 74 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"$schema": "https://biomejs.dev/schemas/2.3.1/schema.json",
"root": true,
"vcs": {
"enabled": false
},
"files": {
"ignoreUnknown": true,
"includes": [
"**",
"!!dist",
"!!**/dist",
"!!lib",
"!!**/lib",
"!!_tmp_*",
"!!**/_tmp_*",
"!!*.tmp",
"!!**/*.tmp",
"!!.tmp/",
"!!**/.tmp/",
"!!*.log",
"!!**/*.log",
"!!**/.DS_Store",
"!!**/Thumbs.db"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 4,
"lineWidth": 120
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
},
"linter": {
"rules": {
"style": {
"useNodejsImportProtocol": "off"
},
"suspicious": {
"noAssignInExpressions": "warn",
"noUselessEscapeInString": {
"level": "warn",
"fix": "none",
"options": {}
},
"noThenProperty": "warn",
"useIterableCallbackReturn": "warn",
"noShadowRestrictedNames": "warn",
"noTsIgnore": {
"level": "warn",
"fix": "none",
"options": {}
},
"noConfusingVoidType": {
"level": "warn",
"fix": "none",
"options": {}
}
}
}
}
}
29 changes: 25 additions & 4 deletions jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,29 @@
export default {
preset: "ts-jest",
testEnvironment: "node",
moduleNameMapper: {
"^(\.{1,2}/.*)\.js$": "$1",
},
setupFilesAfterEnv: ["<rootDir>/tests/mock-server/setup.ts"],
projects: [
{
displayName: "unit",
preset: "ts-jest",
testEnvironment: "node",
moduleNameMapper: {
"^(\.{1,2}/.*)\.js$": "$1",
},
roots: ["<rootDir>/tests"],
testPathIgnorePatterns: ["/tests/wire/"],
setupFilesAfterEnv: [],
},
{
displayName: "wire",
preset: "ts-jest",
testEnvironment: "node",
moduleNameMapper: {
"^(\.{1,2}/.*)\.js$": "$1",
},
roots: ["<rootDir>/tests/wire"],
setupFilesAfterEnv: ["<rootDir>/tests/mock-server/setup.ts"],
},
],
workerThreads: false,
passWithNoTests: true,
};
31 changes: 18 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
{
"name": "webflow-api",
"version": "3.2.2",
"version": "3.3.0",
"private": false,
"repository": "https://github.com/webflow/js-webflow-api",
"repository": "github:webflow/js-webflow-api",
"main": "./index.js",
"types": "./index.d.ts",
"scripts": {
"format": "prettier . --write --ignore-unknown",
"format": "biome format --write --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
"format:check": "biome format --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
"lint": "biome lint --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
"lint:fix": "biome lint --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
"check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
"check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
"build": "tsc",
"prepack": "cp -rv dist/. .",
"test": "jest tests/unit --passWithNoTests",
"test:wire": "jest tests/wire --passWithNoTests",
"wire:test": "yarn test:wire"
"test": "jest --config jest.config.mjs",
"test:unit": "jest --selectProjects unit",
"test:wire": "jest --selectProjects wire"
},
"dependencies": {
"url-join": "4.0.1",
"form-data": "^4.0.0",
"form-data": "^4.0.4",
"formdata-node": "^6.0.3",
"node-fetch": "^2.7.0",
"qs": "^6.13.1",
"readable-stream": "^4.5.2",
"js-base64": "3.7.7",
"crypto-browserify": "^3.12.1"
},
"devDependencies": {
"@types/url-join": "4.0.1",
"@types/qs": "^6.9.17",
"@types/node-fetch": "^2.6.12",
"@types/readable-stream": "^4.0.18",
"webpack": "^5.97.1",
Expand All @@ -37,17 +37,22 @@
"jest-environment-jsdom": "^29.7.0",
"msw": "2.11.2",
"@types/node": "^18.19.70",
"prettier": "^3.4.2",
"typescript": "~5.7.2",
"@biomejs/biome": "2.3.1",
"jest-fetch-mock": "^3.0.3"
},
"browser": {
"fs": false,
"os": false,
"path": false,
"stream": false,
"crypto": false
},
"packageManager": "yarn@1.22.22",
"engines": {
"node": ">=18.0.0"
},
"sideEffects": false,
"resolutions": {
"pbkdf2": "^3.1.3",
"@types/babel__traverse": "7.20.6"
Expand Down
Loading
Loading