Skip to content

Commit 307226a

Browse files
stofnex3
andauthored
Publish a @sass/types package with the types of the shared JS API (#2639)
Co-authored-by: Natalie Weizenbaum <[email protected]>
1 parent edfe90d commit 307226a

File tree

9 files changed

+66
-7
lines changed

9 files changed

+66
-7
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,38 @@ jobs:
9999
- run: git tag sass-api-${{ steps.sass-api-version.outputs.version }}
100100
- run: git push --tag
101101

102+
deploy_sass_types:
103+
name: Deploy @sass/types
104+
runs-on: ubuntu-latest
105+
106+
steps:
107+
- uses: actions/checkout@v5
108+
with:
109+
token: ${{ secrets.GH_TOKEN }}
110+
# Set up .npmrc file to publish to npm
111+
- uses: actions/setup-node@v4
112+
with:
113+
node-version: 'lts/*'
114+
check-latest: true
115+
registry-url: 'https://registry.npmjs.org'
116+
- name: Get Dart Sass version
117+
id: dart-sass-version
118+
run: echo "version=${{ github.ref_name }}" | tee --append "$GITHUB_OUTPUT"
119+
- name: Check out the language repo
120+
uses: actions/checkout@v5
121+
with: {repository: sass/sass, path: build/language}
122+
- name: Copy types from the language repo
123+
run: cp -r build/language/js-api-doc pkg/sass-types/types
124+
- name: Copy LICENSE file
125+
run: cp LICENSE pkg/sass-types/
126+
- name: Set the version of @sass/types
127+
run: npm pkg set version='{{ steps.dart-sass-version.outputs.version }}'
128+
working-directory: pkg/sass-types/
129+
- run: npm publish
130+
env:
131+
NODE_AUTH_TOKEN: '${{ secrets.NPM_TOKEN }}'
132+
working-directory: pkg/sass-types/
133+
102134
deploy_sass_parser:
103135
name: Deploy sass-parser
104136
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
## 1.92.2-dev
1+
## 1.93.0
22

33
* Fix a crash when a style rule contains a nested `@import`, and the loaded file
44
`@use`s a user-defined module as well as `@include`s a top-level mixin which
55
emits top-level declarations.
66

7+
### JavaScript API
8+
9+
* Release a `@sass/types` package which contains the type annotations used by
10+
both the `sass` and `sass-embedded` package without any additional code or
11+
dependencies.
12+
713
## 1.92.1
814

915
* Fix a bug where variable definitions from one imported, forwarded module

pkg/sass-parser/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 0.4.29-dev
1+
## 0.4.29
22

33
* No user-visible changes.
44

pkg/sass-parser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sass-parser",
3-
"version": "0.4.29-dev",
3+
"version": "0.4.29",
44
"description": "A PostCSS-compatible wrapper of the official Sass parser",
55
"repository": "sass/sass",
66
"author": "Google Inc.",

pkg/sass-types/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# @sass/types
2+
3+
This package is a dual-publish of the [Sass JS API](https://sass-lang.com/documentation/js-api/)
4+
types. The `sass` and `sass-embedded` packages **still contain types**. This package is for
5+
users who _only_ need the Sass JS types (such as for `@types/gulp-sass`). It is published
6+
alongside every release of `sass` and `sass-embedded`, so you can always use the same version.

pkg/sass-types/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@sass/types",
3+
"version": "auto",
4+
"description": "A standalone types package for the Sass JS API",
5+
"repository": "sass/sass",
6+
"author": "Google Inc.",
7+
"license": "MIT",
8+
"exports": {
9+
"types": "./types/index.d.ts"
10+
},
11+
"types": "types/index.d.ts",
12+
"files": [
13+
"types/**/*.d.ts"
14+
]
15+
}

pkg/sass_api/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 15.11.1-dev
1+
## 15.12.0
22

33
* No user-visible changes.
44

pkg/sass_api/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ name: sass_api
22
# Note: Every time we add a new Sass AST node, we need to bump the *major*
33
# version because it's a breaking change for anyone who's implementing the
44
# visitor interface(s).
5-
version: 15.11.1-dev
5+
version: 15.12.0
66
description: Additional APIs for Dart Sass.
77
homepage: https://github.com/sass/dart-sass
88

99
environment:
1010
sdk: ">=3.6.0 <4.0.0"
1111

1212
dependencies:
13-
sass: 1.92.2
13+
sass: 1.93.0
1414

1515
dev_dependencies:
1616
dartdoc: ^8.0.14

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sass
2-
version: 1.92.2-dev
2+
version: 1.93.0
33
description: A Sass implementation in Dart.
44
homepage: https://github.com/sass/dart-sass
55

0 commit comments

Comments
 (0)