Skip to content

Commit 4fa5a02

Browse files
authoredSep 11, 2024··
Use a file: dependency for sass-parser -> sass (#2340)
This makes it harder to accidentally test against the wrong version, and ensures CI doesn't break when the repo's Sass version number is unreleased.
1 parent 05e1691 commit 4fa5a02

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed
 

‎.github/workflows/release.yml

+5
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ jobs:
134134
version: 'lts/*'
135135
check-latest: true
136136
registry-url: 'https://registry.npmjs.org'
137+
138+
# The repo package has a file dependency, but the released version needs
139+
# a real dependency on the released version of Sass.
140+
- run: npm install sass@${{ steps.version.outputs.version }}
141+
137142
- run: npm publish
138143
env:
139144
NODE_AUTH_TOKEN: '${{ secrets.NPM_TOKEN }}'

‎.github/workflows/test.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,8 @@ jobs:
344344

345345
- run: dart run grinder pkg-npm-dev
346346
env: {UPDATE_SASS_SASS_REPO: false}
347-
- run: npm link
348-
working-directory: build/npm
349347
- run: npm install
350348
working-directory: pkg/sass-parser/
351-
- run: npm link sass
352-
working-directory: pkg/sass-parser/
353349
- name: Run tests
354350
run: npm test
355351
working-directory: pkg/sass-parser/
@@ -362,6 +358,13 @@ jobs:
362358
- uses: actions/checkout@v4
363359
- uses: actions/setup-node@v4
364360
with: {node-version: 'lts/*'}
361+
- uses: ./.github/util/initialize
362+
with: {github-token: "${{ github.token }}"}
363+
364+
- run: dart run grinder pkg-npm-dev
365+
env: {UPDATE_SASS_SASS_REPO: false}
366+
- run: npm install
367+
working-directory: build/npm/
365368
- run: npm install
366369
working-directory: pkg/sass-parser/
367370
- name: Run static analysis

‎pkg/sass-parser/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
"dependencies": {
3434
"postcss": ">=8.4.41 <8.5.0",
35-
"sass": "1.78.0"
35+
"sass": "file:../../build/npm"
3636
},
3737
"devDependencies": {
3838
"@types/jest": "^29.5.12",

‎test/double_check_test.dart

-8
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,6 @@ void main() {
111111
() => expect(packageJson["version"].toString(),
112112
matchesChangelogVersion(_changelogVersion("pkg/sass-parser"))));
113113

114-
test("depends on the current sass version", () {
115-
if (_isDevVersion(sassPubspec.version!)) return;
116-
117-
var dependencies = packageJson["dependencies"] as Map<String, Object?>;
118-
expect(
119-
dependencies, containsPair("sass", sassPubspec.version.toString()));
120-
});
121-
122114
test(
123115
"increments along with the sass version",
124116
() => _checkVersionIncrementsAlong('sass-parser', sassPubspec,

0 commit comments

Comments
 (0)
Please sign in to comment.