Comparing version 0.16.0 to 0.16.1
@@ -0,1 +1,4 @@ | ||
## 0.16.1 | ||
- Support for PostCSS 8 | ||
## 0.16.0 | ||
@@ -2,0 +5,0 @@ - Parted up PostCSS plugin. |
@@ -1,2 +0,2 @@ | ||
import { ReboostConfig, ReboostPlugin } from '../index'; | ||
import { ReboostPlugin } from '../index'; | ||
declare type Modes = 'local' | 'global' | 'pure'; | ||
@@ -12,5 +12,4 @@ interface ModuleOptions { | ||
} | ||
export declare const postcssError: (pluginName: string, error: any, config: ReboostConfig) => Error; | ||
export declare const PluginName = "core-css-plugin"; | ||
export declare const CSSPlugin: (options?: CSSPluginOptions) => ReboostPlugin; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CSSPlugin = exports.PluginName = exports.postcssError = void 0; | ||
exports.CSSPlugin = exports.PluginName = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -54,15 +54,3 @@ const postcss_1 = tslib_1.__importDefault(require("postcss")); | ||
`; | ||
exports.postcssError = (pluginName, error, config) => { | ||
let errorMessage = `${pluginName}: Error while processing "${path_1.default.relative(config.rootDir, error.file)}"\n`; | ||
errorMessage += `${error.reason} on line ${error.line} at column ${error.column}\n\n`; | ||
errorMessage += code_frame_1.codeFrameColumns(error.source, { | ||
start: { | ||
line: error.line, | ||
column: error.column | ||
} | ||
}, { | ||
message: error.reason | ||
}); | ||
return new Error(errorMessage); | ||
}; | ||
const isCssSyntaxError = (e) => e.name === 'CssSyntaxError'; | ||
exports.PluginName = 'core-css-plugin'; | ||
@@ -98,5 +86,6 @@ exports.CSSPlugin = (options = {}) => { | ||
}), | ||
postcss_1.default.plugin('import-export-extractor', () => (root) => { | ||
extractedICSS = icss_utils_1.extractICSS(root, true); | ||
}) | ||
{ | ||
postcssPlugin: 'icss extractor', | ||
Once(root) { extractedICSS = icss_utils_1.extractICSS(root, true); } | ||
}, | ||
]).process(css, { | ||
@@ -158,3 +147,19 @@ from: filePath, | ||
}, (err) => { | ||
resolve(exports.postcssError('CSSPlugin', err, this.config)); | ||
if (isCssSyntaxError(err)) { | ||
let errorMessage = `CSSPlugin: Error while processing "${path_1.default.relative(this.config.rootDir, err.file)}"\n`; | ||
errorMessage += `${err.reason} on line ${err.line} at column ${err.column}\n\n`; | ||
errorMessage += code_frame_1.codeFrameColumns(err.source, { | ||
start: { | ||
line: err.line, | ||
column: err.column | ||
} | ||
}, { | ||
message: err.reason | ||
}); | ||
resolve(new Error(errorMessage)); | ||
} | ||
else { | ||
console.error(err); | ||
resolve(); | ||
} | ||
}); | ||
@@ -161,0 +166,0 @@ }); |
{ | ||
"name": "reboost", | ||
"version": "0.16.0", | ||
"version": "0.16.1", | ||
"description": "A super fast dev server for rapid web development", | ||
@@ -52,3 +52,3 @@ "main": "./dist/node/index.js", | ||
"esbuild": "^0.7.16", | ||
"icss-utils": "^4.1.1", | ||
"icss-utils": "^5.0.0", | ||
"koa": "^2.13.0", | ||
@@ -62,8 +62,7 @@ "koa-proxies": "^0.11.0", | ||
"portfinder": "^1.0.28", | ||
"postcss": "^7.0.34", | ||
"postcss-load-config": "^2.1.0", | ||
"postcss-modules-extract-imports": "^2.0.0", | ||
"postcss-modules-local-by-default": "^3.0.3", | ||
"postcss-modules-scope": "^2.2.0", | ||
"postcss-modules-values": "^3.0.0", | ||
"postcss": "^8.1.1", | ||
"postcss-modules-extract-imports": "^3.0.0", | ||
"postcss-modules-local-by-default": "^4.0.0", | ||
"postcss-modules-scope": "^3.0.0", | ||
"postcss-modules-values": "^4.0.0", | ||
"source-map": "^0.7.3", | ||
@@ -75,3 +74,2 @@ "tslib": "^2.0.3", | ||
"@types/babel__code-frame": "^7.0.2", | ||
"@types/icss-utils": "^4.1.0", | ||
"@types/jest": "^26.0.14", | ||
@@ -81,7 +79,2 @@ "@types/koa-send": "^4.1.2", | ||
"@types/node": "^14.11.10", | ||
"@types/postcss-load-config": "^2.0.1", | ||
"@types/postcss-modules-extract-imports": "^2.0.0", | ||
"@types/postcss-modules-local-by-default": "^1.2.0", | ||
"@types/postcss-modules-scope": "^1.1.0", | ||
"@types/postcss-modules-values": "^3.0.0", | ||
"@types/puppeteer": "^3.0.2", | ||
@@ -94,3 +87,3 @@ "@types/ws": "^7.2.7", | ||
}, | ||
"gitHead": "4cdccf71429d9eebfcc9040f69f6db8e98b05309" | ||
"gitHead": "7e1ba07eebde0b6aaa369ab00a13284ee8af1500" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
161461
31
11
3363
+ Addedicss-utils@5.1.0(transitive)
+ Addednanoid@3.3.7(transitive)
+ Addedpostcss@8.4.47(transitive)
+ Addedpostcss-modules-extract-imports@3.1.0(transitive)
+ Addedpostcss-modules-local-by-default@4.0.5(transitive)
+ Addedpostcss-modules-scope@3.2.0(transitive)
+ Addedpostcss-modules-values@4.0.0(transitive)
+ Addedsource-map-js@1.2.1(transitive)
- Removedpostcss-load-config@^2.1.0
- Removedargparse@1.0.10(transitive)
- Removedcaller-callsite@2.0.0(transitive)
- Removedcaller-path@2.0.0(transitive)
- Removedcallsites@2.0.0(transitive)
- Removedcosmiconfig@5.2.1(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedesprima@4.0.1(transitive)
- Removedicss-utils@4.1.1(transitive)
- Removedimport-cwd@2.1.0(transitive)
- Removedimport-fresh@2.0.0(transitive)
- Removedimport-from@2.1.0(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedis-directory@0.3.1(transitive)
- Removedjs-yaml@3.14.1(transitive)
- Removedjson-parse-better-errors@1.0.2(transitive)
- Removedparse-json@4.0.0(transitive)
- Removedpicocolors@0.2.1(transitive)
- Removedpostcss@7.0.39(transitive)
- Removedpostcss-load-config@2.1.2(transitive)
- Removedpostcss-modules-extract-imports@2.0.0(transitive)
- Removedpostcss-modules-local-by-default@3.0.3(transitive)
- Removedpostcss-modules-scope@2.2.0(transitive)
- Removedpostcss-modules-values@3.0.0(transitive)
- Removedresolve-from@3.0.0(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedsprintf-js@1.0.3(transitive)
Updatedicss-utils@^5.0.0
Updatedpostcss@^8.1.1
Updatedpostcss-modules-scope@^3.0.0