Skip to content

Commit

Permalink
2.0.0 (#36)
Browse files Browse the repository at this point in the history
Implements a new major version of Edge-CSRF (2.0.0) with several breaking changes:
* Splits functionality into three separate public packages:
  * `@edge-csrf/nextjs` - Next.js integration library
  * `@edge-csrf/sveltekit` - SvelteKit integration library
  * `@edge-csrf/core` - Core API
* The integration libraries each offer high-level and low-level integration methods:
  * A method for creating drop-in middleware (e.g. `createCsrfMiddleware()`, `createCsrfHandle()`)
  * A method for creating functions that can be used inside middleware (e.g. `createCsrfProtect()`)
* Internally the code was re-organized into a monorepo structure with three public packages and a private package for shared code using pnpm workspaces for management
* It should be easy to add new framework integrations with the new repo structure
  • Loading branch information
amorey authored Apr 21, 2024
1 parent 4b4cbba commit 0d7007b
Show file tree
Hide file tree
Showing 150 changed files with 6,301 additions and 29,368 deletions.
15 changes: 11 additions & 4 deletions .eslintrc.json → .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
module.exports = {
"root": true,
"plugins": [
"@typescript-eslint"
],
"extends": [
"airbnb",
"airbnb-typescript",
"airbnb-base",
"airbnb-typescript/base",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
Expand All @@ -14,11 +14,18 @@
},
"ignorePatterns": [],
"rules": {
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-explicit-any": "off",
"import/extensions": "off",
"import/no-extraneous-dependencies": ["error", {
"packageDir": [".", __dirname] // This tells ESLint to check both the local and root package.json files
}],
"import/prefer-default-export": "off",
"max-classes-per-file": "off",
"max-len": "off",
"no-await-in-loop": "off",
"no-restricted-syntax": "off",
"no-underscore-dangle": "off",
"object-curly-newline": "off"
}
}
};
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
version: 8
- run: pnpm install
- run: pnpm lint
- run: pnpm -r lint

test:
runs-on: ubuntu-latest
Expand All @@ -30,7 +30,10 @@ jobs:
with:
version: 8
- run: pnpm install
- run: pnpm test run
- run: pnpm -r test run -- --environment node
- run: pnpm -r test run -- --environment edge-runtime
- run: pnpm -r build # only necessary for miniflare
- run: pnpm -r test run -- --environment miniflare

build:
runs-on: ubuntu-latest
Expand All @@ -43,4 +46,4 @@ jobs:
with:
version: 8
- run: pnpm install
- run: pnpm build
- run: pnpm -r build
8 changes: 6 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
packages: write
contents: read
steps:
- name: Get tag name
uses: olegtarasov/[email protected]
id: tagName
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
Expand All @@ -21,7 +24,8 @@ jobs:
with:
version: 8
- run: pnpm install
- run: pnpm build
- run: pnpm publish --no-git-checks --access public
- run: pnpm -r build
- run: /bin/bash set-version.sh ${{ steps.tagName.outputs.tag }}
- run: pnpm -r publish --no-git-checks --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,32 @@
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
.DS_Store
*~
\#*
node_modules
.next
.env
.env*.local
.env.*
!.env.example
dist
build
.vscode

# vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

# sveltkit
.svelte-kit

# vercel
.vercel

# wrangler files
.wrangler
.dev.vars

# lerna
.nx
Loading

0 comments on commit 0d7007b

Please sign in to comment.