mirror of
https://github.com/danog/dart-sass.git
synced 2024-12-02 09:37:49 +01:00
Use the embedded protocol from the Sass language repo (#1966)
This commit is contained in:
parent
cb039c7efd
commit
eb18526913
4
.github/util/initialize/action.yml
vendored
4
.github/util/initialize/action.yml
vendored
@ -26,9 +26,9 @@ runs:
|
|||||||
- uses: bufbuild/buf-setup-action@v1.13.1
|
- uses: bufbuild/buf-setup-action@v1.13.1
|
||||||
with: {github_token: "${{ inputs.github-token }}"}
|
with: {github_token: "${{ inputs.github-token }}"}
|
||||||
|
|
||||||
- name: Check out embedded Sass protocol
|
- name: Check out the language repo
|
||||||
uses: sass/clone-linked-repo@v1
|
uses: sass/clone-linked-repo@v1
|
||||||
with: {repo: sass/embedded-protocol, path: build/embedded-protocol}
|
with: {repo: sass/sass, path: build/language}
|
||||||
|
|
||||||
- name: Generate Dart from protobuf
|
- name: Generate Dart from protobuf
|
||||||
run: dart run grinder protobuf
|
run: dart run grinder protobuf
|
||||||
|
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
@ -162,15 +162,14 @@ jobs:
|
|||||||
uses: sass/clone-linked-repo@v1
|
uses: sass/clone-linked-repo@v1
|
||||||
with: {repo: sass/embedded-host-node}
|
with: {repo: sass/embedded-host-node}
|
||||||
|
|
||||||
- name: Check out the JS API definition
|
- name: Check out the language repo
|
||||||
uses: sass/clone-linked-repo@v1
|
uses: sass/clone-linked-repo@v1
|
||||||
with: {repo: sass/sass, path: language}
|
with: {repo: sass/sass, path: build/language}
|
||||||
|
|
||||||
- name: Initialize embedded host
|
- name: Initialize embedded host
|
||||||
run: |
|
run: |
|
||||||
npm install
|
npm install
|
||||||
npm run init -- --protocol-path=../build/embedded-protocol \
|
npm run init -- --compiler-path=.. --language-path=../build/language
|
||||||
--compiler-path=.. --api-path=../language
|
|
||||||
npm run compile
|
npm run compile
|
||||||
mv {`pwd`/,dist/}lib/src/vendor/dart-sass
|
mv {`pwd`/,dist/}lib/src/vendor/dart-sass
|
||||||
working-directory: embedded-host-node
|
working-directory: embedded-host-node
|
||||||
@ -185,7 +184,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm run js-api-spec -- --sassPackage ../embedded-host-node --sassSassRepo ../language
|
run: npm run js-api-spec -- --sassPackage ../embedded-host-node --sassSassRepo ../build/language
|
||||||
working-directory: sass-spec
|
working-directory: sass-spec
|
||||||
|
|
||||||
dart_tests:
|
dart_tests:
|
||||||
|
@ -316,7 +316,7 @@ Dart Sass includes an implementation of the compiler side of the [Embedded Sass
|
|||||||
protocol]. It's designed to be embedded in a host language, which then exposes
|
protocol]. It's designed to be embedded in a host language, which then exposes
|
||||||
an API for users to invoke Sass and define custom functions and importers.
|
an API for users to invoke Sass and define custom functions and importers.
|
||||||
|
|
||||||
[Embedded Sass protocol]: https://github.com/sass/sass-embedded-protocol/blob/master/README.md#readme
|
[Embedded Sass protocol]: https://github.com/sass/sass/blob/main/spec/embedded-protocol.md
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
version: v1
|
version: v1
|
||||||
directories: [build/embedded-protocol]
|
directories: [build/language/spec]
|
||||||
|
@ -58,15 +58,16 @@ void main(List<String> args) {
|
|||||||
"${pkg.githubReleaseNotes.defaultValue}";
|
"${pkg.githubReleaseNotes.defaultValue}";
|
||||||
|
|
||||||
pkg.environmentConstants.fn = () {
|
pkg.environmentConstants.fn = () {
|
||||||
if (!Directory('build/embedded-protocol').existsSync()) {
|
if (!Directory('build/language').existsSync()) {
|
||||||
fail('Run `dart run grinder protobuf` before building Dart Sass '
|
fail('Run `dart run grinder protobuf` before building Dart Sass '
|
||||||
'executables.');
|
'executables.');
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...pkg.environmentConstants.defaultValue,
|
...pkg.environmentConstants.defaultValue,
|
||||||
"protocol-version":
|
"protocol-version": File('build/language/spec/EMBEDDED_PROTOCOL_VERSION')
|
||||||
File('build/embedded-protocol/VERSION').readAsStringSync().trim(),
|
.readAsStringSync()
|
||||||
|
.trim(),
|
||||||
"compiler-version": pkg.pubspec.version!.toString(),
|
"compiler-version": pkg.pubspec.version!.toString(),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -202,7 +203,8 @@ dart run protoc_plugin "\$@"
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Platform.environment['UPDATE_SASS_PROTOCOL'] != 'false') {
|
if (Platform.environment['UPDATE_SASS_PROTOCOL'] != 'false') {
|
||||||
cloneOrCheckout("https://github.com/sass/embedded-protocol.git", "main");
|
cloneOrCheckout("https://github.com/sass/sass.git", "main",
|
||||||
|
name: 'language');
|
||||||
}
|
}
|
||||||
|
|
||||||
await runAsync("buf",
|
await runAsync("buf",
|
||||||
|
Loading…
Reference in New Issue
Block a user