-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: support vue 3 only simplify babel preset, only typescript and env preset upgrade postcss to 8
- Loading branch information
Showing
24 changed files
with
1,869 additions
and
1,323 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
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,4 +1 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true | ||
} | ||
"@egoist/prettier-config" |
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,9 +1,9 @@ | ||
module.exports = { | ||
testEnvironment: 'node', | ||
transform: { | ||
'^.+\\.tsx?$': 'ts-jest' | ||
'^.+\\.tsx?$': '@sucrase/jest-plugin', | ||
}, | ||
testRegex: '(/__test__/.*|(\\.|/)(test|spec))\\.tsx?$', | ||
testPathIgnorePatterns: ['/node_modules/', '/dist/', '/types/'], | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'] | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], | ||
} |
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 |
---|---|---|
|
@@ -23,47 +23,47 @@ | |
"author": "egoist <[email protected]>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@babel/core": "^7.0.0", | ||
"@babel/preset-typescript": "^7.0.0", | ||
"@vue/component-compiler-utils": "^3.0.0", | ||
"babel-preset-minimal": "^0.1.2", | ||
"cac": "^6.5.2", | ||
"chalk": "^2.4.1", | ||
"debug": "^4.1.1", | ||
"fast-glob": "^3.0.3", | ||
"find-babel-config": "^1.1.0", | ||
"fs-extra": "^8.1.0", | ||
"is-binary-path": "^2.0.0", | ||
"joycon": "^2.1.2", | ||
"postcss": "^7.0.6", | ||
"postcss-load-config": "^2.0.0", | ||
"resolve": "^1.8.1", | ||
"@babel/core": "^7.13.15", | ||
"@babel/plugin-syntax-typescript": "^7.12.13", | ||
"@babel/preset-env": "^7.13.15", | ||
"@babel/preset-typescript": "^7.13.0", | ||
"@vue/compiler-sfc": "^3.0.11", | ||
"cac": "^6.7.2", | ||
"chalk": "^4.1.0", | ||
"debug": "^4.3.1", | ||
"fast-glob": "^3.2.5", | ||
"fs-extra": "^9.1.0", | ||
"is-binary-path": "^2.1.0", | ||
"joycon": "^3.0.1", | ||
"postcss": "^8.2.10", | ||
"postcss-load-config": "^3.0.1", | ||
"resolve": "^1.20.0", | ||
"resolve-from": "^5.0.0", | ||
"stringify-attributes": "^2.0.0", | ||
"vue-template-compiler": "^2.6.10" | ||
"stringify-attributes": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@egoist/prettier-config": "^0.1.0", | ||
"@sucrase/jest-plugin": "^2.1.0", | ||
"@types/debug": "^4.1.4", | ||
"@types/fs-extra": "^8.0.0", | ||
"@types/is-binary-path": "^2.1.0", | ||
"@types/jest": "^26.0.14", | ||
"@types/node-sass": "^4.11.0", | ||
"@types/stringify-attributes": "^2.0.0", | ||
"@typescript-eslint/eslint-plugin": "^4.4.0", | ||
"@typescript-eslint/parser": "^4.4.0", | ||
"eslint": "^7.10.0", | ||
"eslint-config-prettier": "^6.12.0", | ||
"@typescript-eslint/eslint-plugin": "^4.22.0", | ||
"@typescript-eslint/parser": "^4.22.0", | ||
"eslint": "^7.24.0", | ||
"eslint-config-prettier": "^8.2.0", | ||
"eslint-config-rem": "^4.0.0", | ||
"eslint-config-xo-typescript": "^0.33.0", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"eslint-config-xo-typescript": "^0.38.0", | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"husky": "^4.3.0", | ||
"jest": "^24.8.0", | ||
"lint-staged": "^10.4.0", | ||
"prettier": "^1.18.2", | ||
"prettier": "^2.2.1", | ||
"stylus": "^0.54.5", | ||
"ts-jest": "^26.4.1", | ||
"typescript": "^4.0.3", | ||
"vue": "^2.6.10" | ||
"typescript": "^4.2.4", | ||
"vue": "^3.0.11" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
|
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
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,36 +1,45 @@ | ||
import { SFCBlock } from '@vue/component-compiler-utils' | ||
import { SFCStyleBlock } from '@vue/compiler-sfc' | ||
import { notSupportedLang } from './utils' | ||
|
||
export const compileStyles = async ( | ||
styles: SFCBlock[], | ||
{ filename }: { filename: string } | ||
): Promise<SFCBlock[]> => { | ||
styles: SFCStyleBlock[], | ||
{ filename }: { filename: string }, | ||
): Promise<SFCStyleBlock[]> => { | ||
return Promise.all( | ||
styles.map(async style => { | ||
styles.map(async (style) => { | ||
// Do not handle "src" import | ||
// Until we figure out how to handle it | ||
if (style.src) return style | ||
|
||
const { content } = style | ||
|
||
if (style.lang === 'stylus') { | ||
style.content = await require('./style-compilers/stylus').compile(content, { | ||
filename | ||
}) | ||
style.content = await require('./style-compilers/stylus').compile( | ||
content, | ||
{ | ||
filename, | ||
}, | ||
) | ||
} else if (!style.lang || style.lang === 'postcss') { | ||
style.content = await require('./style-compilers/postcss').compile(content, { | ||
filename | ||
}) | ||
style.content = await require('./style-compilers/postcss').compile( | ||
content, | ||
{ | ||
filename, | ||
}, | ||
) | ||
} else if (style.lang === 'scss' || style.lang === 'sass') { | ||
style.content = await require('./style-compilers/sass').compile(content, { | ||
filename, | ||
indentedSyntax: style.lang === 'sass' | ||
}) | ||
style.content = await require('./style-compilers/sass').compile( | ||
content, | ||
{ | ||
filename, | ||
indentedSyntax: style.lang === 'sass', | ||
}, | ||
) | ||
} else if (style.lang) { | ||
throw new Error(notSupportedLang(style.lang, 'style')) | ||
} | ||
|
||
return style | ||
}) | ||
}), | ||
) | ||
} |
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,3 +1,4 @@ | ||
import { SFCBlock } from '@vue/component-compiler-utils' | ||
import { SFCTemplateBlock } from '@vue/compiler-sfc' | ||
|
||
export const compileTemplate = <T = SFCBlock | null>(template: T): T => template | ||
export const compileTemplate = <T = SFCTemplateBlock | null>(template: T): T => | ||
template |
Oops, something went wrong.