-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: typescript rewrite * chore: change minimum supported node version to 12 * chore: istanbul ignore * fix: ignore istanbul
- Loading branch information
1 parent
bab21a7
commit 0c6a034
Showing
25 changed files
with
1,528 additions
and
702 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -5,4 +5,4 @@ dist | |
coverage | ||
|
||
# Plugin | ||
lib/plugin.js | ||
templates/plugin.js |
This file contains 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/eslint-config-typescript" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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 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 |
---|---|---|
|
@@ -7,3 +7,5 @@ node_modules | |
.DS_Store | ||
coverage | ||
dist | ||
sw.* | ||
.env |
This file contains 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,5 +1,4 @@ | ||
module.exports = { | ||
collectCoverage: true, | ||
collectCoverageFrom: ['lib/**/*.js', '!lib/plugin.js'], | ||
testEnvironment: 'node' | ||
preset: '@nuxt/test-utils', | ||
collectCoverageFrom: ['src/**'] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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 |
---|---|---|
|
@@ -8,26 +8,35 @@ | |
"Sebastien Chopin <[email protected]>", | ||
"Ricardo Gobbo de Souza <[email protected]>" | ||
], | ||
"main": "lib/module.js", | ||
"main": "./dist/module.js", | ||
"types": "./dist/module.d.ts", | ||
"files": [ | ||
"lib" | ||
"dist" | ||
], | ||
"scripts": { | ||
"dev": "nuxt test/fixture/ok", | ||
"lint": "eslint --ext .js,.vue .", | ||
"release": "yarn test && standard-version && git push --follow-tags && npm publish", | ||
"test": "yarn lint && jest" | ||
"build": "siroc build", | ||
"prepublishOnly": "yarn build", | ||
"dev": "nuxt dev test/fixture/ok", | ||
"lint": "eslint --ext .js,.ts,.vue .", | ||
"release": "yarn test && yarn build && standard-version && git push --follow-tags && npm publish", | ||
"test": "yarn lint && yarn jest" | ||
}, | ||
"dependencies": { | ||
"consola": "^2.15.3" | ||
"consola": "^2.15.3", | ||
"defu": "^3.2.2" | ||
}, | ||
"devDependencies": { | ||
"@nuxtjs/eslint-config": "latest", | ||
"@nuxtjs/module-test-utils": "latest", | ||
"@babel/preset-typescript": "latest", | ||
"@nuxt/test-utils": "latest", | ||
"@nuxt/types": "latest", | ||
"@nuxtjs/eslint-config-typescript": "latest", | ||
"@types/jest": "latest", | ||
"@types/node": "latest", | ||
"del": "latest", | ||
"eslint": "latest", | ||
"husky": "latest", | ||
"jest": "latest", | ||
"nuxt-edge": "latest", | ||
"nuxt": "latest", | ||
"siroc": "latest", | ||
"standard-version": "latest" | ||
}, | ||
"publishConfig": { | ||
|
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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,13 @@ | ||
import { setupTest, get } from '@nuxt/test-utils' | ||
|
||
describe('custom-file-path', () => { | ||
setupTest({ | ||
server: true, | ||
fixture: 'fixture/custom-file-path' | ||
}) | ||
|
||
test('render', async () => { | ||
const { body } = await get('/') | ||
expect(body).toContain('Hello server') | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains 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,24 @@ | ||
import { setupTest } from '@nuxt/test-utils' | ||
|
||
const mockReporter = { | ||
warn: jest.fn() | ||
} | ||
|
||
jest.mock('consola', () => ({ | ||
info: jest.fn(), | ||
success: jest.fn(), | ||
debug: jest.fn(), | ||
warn: jest.fn(), | ||
withTag: jest.fn().mockImplementation(() => mockReporter) | ||
})) | ||
|
||
describe('fail', () => { | ||
setupTest({ | ||
build: true, | ||
fixture: 'fixture/fail' | ||
}) | ||
|
||
test('should warn if not found the router file', () => { | ||
expect(mockReporter.warn).toHaveBeenCalledWith(expect.stringMatching(/^No `(.*)` file found in `(.*)`.$/)) | ||
}) | ||
}) |
This file contains 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 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 @@ | ||
module.exports = { | ||
export default { | ||
rootDir: __dirname, | ||
buildModules: [ | ||
{ handler: require('../../../') } | ||
'../../../src/module.ts' | ||
] | ||
} |
This file contains 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 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 @@ | ||
module.exports = { | ||
export default { | ||
rootDir: __dirname, | ||
buildModules: [ | ||
{ handler: require('../../../') } | ||
'../../../src/module.ts' | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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,13 @@ | ||
import { setupTest, get } from '@nuxt/test-utils' | ||
|
||
describe('keep-default-router', () => { | ||
setupTest({ | ||
server: true, | ||
fixture: 'fixture/keep-default-router' | ||
}) | ||
|
||
test('render', async () => { | ||
const { body } = await get('/some/foo') | ||
expect(body).toContain('Hello page') | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file contains 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,13 @@ | ||
import { setupTest, get } from '@nuxt/test-utils' | ||
|
||
describe('ok', () => { | ||
setupTest({ | ||
server: true, | ||
fixture: 'fixture/ok' | ||
}) | ||
|
||
test('render', async () => { | ||
const { body } = await get('/') | ||
expect(body).toContain('Hello server') | ||
}) | ||
}) |
This file contains 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,17 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ESNext", | ||
"module": "ESNext", | ||
"moduleResolution": "Node", | ||
"resolveJsonModule": true, | ||
"strict": false, | ||
"types": [ | ||
"node", | ||
"jest" | ||
] | ||
}, | ||
"exclude": [ | ||
"node_modules", | ||
"dist" | ||
] | ||
} |
Oops, something went wrong.