Skip to content

Commit e1f5997

Browse files
committed
Publish a @sass/types package with the types of the shared JS API
1 parent ff1847b commit e1f5997

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
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

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+
}

0 commit comments

Comments
 (0)