-
Notifications
You must be signed in to change notification settings - Fork 1
Update module #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
robfr77
wants to merge
13
commits into
samtgarson:master
Choose a base branch
from
robfr77:Update-Module
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8ddeaac
update to module-template
robfr77 e32190a
update plugin-muse process.client over deprecated context.isClient
robfr77 c4ac219
set up jest, remove husky
robfr77 7e0ff6b
remove husky commitlint
robfr77 fa5197d
simplify test
robfr77 03db102
add self as contributor
robfr77 af874eb
use config mode universal in test
robfr77 446e707
remove unecessary config setting
robfr77 cfba0ae
test: update tests and fix nuxt-edge version
112ca48
fix contributors
0a8aad8
Merge branch 'pi0-fix/Update-Module' into Update-Module
robfr77 d109c98
keep contributors as original
robfr77 dd8fc71
update package.json, syntax
robfr77 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,30 +1,38 @@ | ||
| # Javascript Node CircleCI 2.0 configuration file | ||
| # | ||
| # Check https://circleci.com/docs/2.0/language-javascript/ for more details | ||
| # | ||
| version: 2 | ||
| jobs: | ||
| build: | ||
| docker: | ||
| # specify the version you desire here | ||
| - image: circleci/node:8.4 | ||
|
|
||
| - image: circleci/node | ||
| steps: | ||
| # Checkout repository | ||
| - checkout | ||
|
|
||
| # Download and cache dependencies | ||
| # Restore cache | ||
| - restore_cache: | ||
| keys: | ||
| - v1-dependencies-{{ checksum "package.json" }} | ||
| # fallback to using the latest cache if no exact match is found | ||
| - v1-dependencies- | ||
| key: yarn-cache-{{ checksum "yarn.lock" }} | ||
|
|
||
| - run: yarn install | ||
| # Install dependencies | ||
| - run: | ||
| name: Install Dependencies | ||
| command: NODE_ENV=dev yarn | ||
|
|
||
| # Keep cache | ||
| - save_cache: | ||
| key: yarn-cache-{{ checksum "yarn.lock" }} | ||
| paths: | ||
| - node_modules | ||
| key: v1-dependencies-{{ checksum "package.json" }} | ||
| - "node_modules" | ||
|
|
||
| # Lint | ||
| - run: | ||
| name: Lint | ||
| command: yarn lint | ||
|
|
||
| # Tests | ||
| - run: | ||
| name: Tests | ||
| command: yarn jest | ||
|
|
||
| # run tests! | ||
| - run: yarn test | ||
| # Coverage | ||
| - run: | ||
| name: Coverage | ||
| command: yarn codecov |
This file contains hidden or 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,8 @@ | ||
| # Common | ||
| node_modules | ||
| dist | ||
| .nuxt | ||
| coverage | ||
|
|
||
| # Plugin | ||
| lib/plugin.js |
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -4,6 +4,6 @@ node_modules | |
| *.log* | ||
| .nuxt | ||
| .vscode | ||
| .DS_STORE | ||
| .DS_Store | ||
| coverage | ||
| dist | ||
| dist | ||
This file contains hidden or 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
This file contains hidden or 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,12 @@ | ||
| module.exports = { | ||
| presets: [ | ||
| [ | ||
| '@babel/preset-env', { | ||
| targets: { | ||
| esmodules: true, | ||
| node: 'current' | ||
| } | ||
| } | ||
| ] | ||
| ] | ||
| } |
This file contains hidden or 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
File renamed without changes.
This file contains hidden or 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,3 @@ | ||
| export const state = () => ({ | ||
| token: "" | ||
| }) |
This file contains hidden or 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,14 @@ | ||
| module.exports = { | ||
| testEnvironment: 'node', | ||
| collectCoverage: false, | ||
| moduleNameMapper: { | ||
| '^~/(.*)$': '<rootDir>/lib/$1', | ||
| '^~~$': '<rootDir>', | ||
| '^@@$': '<rootDir>', | ||
| '^@/(.*)$': '<rootDir>/example/$1' | ||
| }, | ||
| transform: { | ||
| "^.+\\.js$": "<rootDir>/node_modules/babel-jest", | ||
| ".*\\.(vue)$": "<rootDir>/node_modules/vue-jest" | ||
| } | ||
| } |
This file contains hidden or 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
This file contains hidden or 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,19 @@ | ||
| import middleware from '@/.nuxt/middleware' | ||
|
|
||
| const moduleName = 'csrf' | ||
|
|
||
| export default async function (context) { | ||
| const initStore = context => { | ||
| if (process.client) return | ||
| context.store.registerModule(moduleName, { | ||
| namespaced: true, | ||
| state: { | ||
| token: (context.req && context.req.csrfToken) | ||
| } | ||
| }) | ||
| } | ||
|
|
||
| middleware.csrf = async context => { | ||
| initStore(context) | ||
| } | ||
| } |
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,6 +1,6 @@ | ||
| { | ||
| "name": "nuxt-csrf", | ||
| "version": "0.0.0", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this package is at 1.0 yet—it would be misleading to suggest it's been battle tested for a stable release. |
||
| "version": "1.0.0", | ||
| "description": "Add some good old CSRF to your Nuxt app", | ||
| "license": "MIT", | ||
| "contributors": [ | ||
|
|
@@ -14,30 +14,39 @@ | |
| "access": "public" | ||
| }, | ||
| "scripts": { | ||
| "dev": "nuxt example", | ||
| "lint": "eslint lib test", | ||
| "test": "npm run lint && jest", | ||
robfr77 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "test": "jest", | ||
| "release": "standard-version && git push --follow-tags && npm publish" | ||
| }, | ||
| "eslintIgnore": [ | ||
robfr77 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "lib/templates/*.*" | ||
| ], | ||
| "files": [ | ||
| "lib" | ||
| ], | ||
| "jest": { | ||
robfr77 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "testEnvironment": "node", | ||
| "coverageDirectory": "./coverage/", | ||
| "collectCoverage": true, | ||
| "collectCoverageFrom": [ | ||
| "lib", | ||
| "test" | ||
| ] | ||
| }, | ||
| "dependencies": { | ||
| "client-sessions": "^0.8.0", | ||
| "csrf": "^3.0.6" | ||
| }, | ||
| "devDependencies": { | ||
| "nuxt-module-builder": "latest" | ||
| "@babel/core": "latest", | ||
| "@babel/preset-env": "latest", | ||
| "@nuxtjs/eslint-config": "latest", | ||
| "babel-eslint": "latest", | ||
| "babel-jest": "latest", | ||
| "codecov": "latest", | ||
| "eslint": "latest", | ||
| "eslint-config-standard": "latest", | ||
| "eslint-plugin-import": "latest", | ||
| "eslint-plugin-jest": "latest", | ||
| "eslint-plugin-node": "latest", | ||
| "eslint-plugin-promise": "latest", | ||
| "eslint-plugin-standard": "latest", | ||
| "eslint-plugin-vue": "latest", | ||
| "get-port": "latest", | ||
| "jest": "latest", | ||
| "node-fetch": "^2.3.0", | ||
| "nuxt-edge": "^2.6.0-25901287.3eec1152", | ||
| "request": "latest", | ||
| "standard-version": "latest", | ||
| "vue-jest": "latest" | ||
| } | ||
| } | ||
This file contains hidden or 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,5 @@ | ||
| { | ||
| "extends": [ | ||
| "@nuxtjs" | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.