Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/javascript/packages/build-sass/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Unreleased
## 2.0.0

### Breaking Changes

Expand All @@ -10,6 +10,10 @@

- Prevent situations where overridden output stylesheets may be temporarily emptied during parallel builds.

### Miscellaneous

- Update dependencies to latest versions.

## 1.3.0

### Improvements
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/packages/build-sass/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { basename, join } from 'node:path';
import { createWriteStream } from 'node:fs';
import { Readable } from 'node:stream';
import { pipeline } from 'node:stream/promises';
import sass from 'sass-embedded';
import { compile as sassCompile } from 'sass-embedded';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was to address a deprecation which was causing some output from the build command:

`import sass from 'sass'` is deprecated.
Please use `import * as sass from 'sass'` instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rename from compile to sassCompile is just for readability, not a collision, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rename from compile to sassCompile is just for readability, not a collision, right?

Correct, since we use a couple different processing tools (Sass, LightningCSS), I wanted to avoid potential ambiguity of what "compile" refers to, and follow the convention I'd introduced on the following line of with lightningTransform ➡️ toolOperation ➡️ sassCompile.

import { transform as lightningTransform, browserslistToTargets } from 'lightningcss';
import browserslist from 'browserslist';

Expand Down Expand Up @@ -30,7 +30,7 @@ const TARGETS = browserslistToTargets(
*/
export async function buildFile(file, options) {
const { outDir, optimize, loadPaths = [], ...sassOptions } = options;
const sassResult = sass.compile(file, {
const sassResult = sassCompile(file, {
style: optimize ? 'compressed' : 'expanded',
...sassOptions,
loadPaths: [...loadPaths, 'node_modules'],
Expand Down
8 changes: 4 additions & 4 deletions app/javascript/packages/build-sass/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@18f/identity-build-sass",
"version": "1.3.0",
"version": "2.0.0",
"private": false,
"description": "Stylesheet compilation utility with reasonable defaults and fast performance.",
"type": "module",
Expand All @@ -26,9 +26,9 @@
"dependencies": {
"@aduth/is-dependency": "^1.0.0",
"@pkgjs/parseargs": "^0.11.0",
"browserslist": "^4.21.5",
"browserslist": "^4.22.1",
"chokidar": "^3.5.3",
"lightningcss": "^1.16.1",
"sass-embedded": "^1.56.1"
"lightningcss": "^1.22.0",
"sass-embedded": "^1.69.2"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@babel/register": "^7.15.3",
"babel-loader": "^9.1.0",
"babel-plugin-polyfill-corejs3": "^0.5.2",
"browserslist": "^4.21.5",
"browserslist": "^4.22.1",
"cleave.js": "^1.6.0",
"core-js": "^3.21.1",
"fast-glob": "^3.2.7",
Expand Down
Loading