Skip to content

Commit

Permalink
Bump gts from 5.3.1 to 6.0.2 in /pkg/sass-parser (#2415)
Browse files Browse the repository at this point in the history
* Bump gts from 5.3.1 to 6.0.2 in /pkg/sass-parser

Bumps [gts](https://github.com/google/gts) from 5.3.1 to 6.0.2.
- [Release notes](https://github.com/google/gts/releases)
- [Changelog](https://github.com/google/gts/blob/main/CHANGELOG.md)
- [Commits](google/gts@v5.3.1...v6.0.2)

---
updated-dependencies:
- dependency-name: gts
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Run `npm run fix` after updating gts on sass-parser

* Disable useDefineForClassFields, it is being enabled by gts v6+

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Carlos Israel Ortiz García <goodwine@google.com>
  • Loading branch information
dependabot[bot] and Goodwine authored Oct 30, 2024
1 parent be0b42a commit df77b66
Show file tree
Hide file tree
Showing 63 changed files with 568 additions and 549 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.80.6-dev

* No user-visible changes.

## 1.80.5

### Embedded Host
Expand Down
4 changes: 4 additions & 0 deletions pkg/sass-parser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.4.3-dev

* No user-visible changes.

## 0.4.2

* Add support for parsing variable declarations.
Expand Down
2 changes: 1 addition & 1 deletion pkg/sass-parser/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class _Syntax implements Syntax {

return new Root(
undefined,
sassInternal.parse(css.toString(), this.#syntax, opts?.from)
sassInternal.parse(css.toString(), this.#syntax, opts?.from),
);
}

Expand Down
45 changes: 23 additions & 22 deletions pkg/sass-parser/lib/src/configuration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('a configuration map', () => {
describe('empty', () => {
function describeNode(
description: string,
create: () => Configuration
create: () => Configuration,
): void {
describe(description, () => {
beforeEach(() => (node = create()));
Expand All @@ -35,12 +35,12 @@ describe('a configuration map', () => {

describeNode(
'parsed as SCSS',
() => (scss.parse('@use "foo"').nodes[0] as UseRule).configuration
() => (scss.parse('@use "foo"').nodes[0] as UseRule).configuration,
);

describeNode(
'parsed as Sass',
() => (sass.parse('@use "foo"').nodes[0] as UseRule).configuration
() => (sass.parse('@use "foo"').nodes[0] as UseRule).configuration,
);

describe('constructed manually', () => {
Expand All @@ -50,22 +50,22 @@ describe('a configuration map', () => {

describeNode(
'variables record',
() => new Configuration({variables: {}})
() => new Configuration({variables: {}}),
);
});

describeNode(
'constructed from props',
() =>
new UseRule({useUrl: 'foo', configuration: {variables: []}})
.configuration
.configuration,
);
});

describe('with a variable', () => {
function describeNode(
description: string,
create: () => Configuration
create: () => Configuration,
): void {
describe(description, () => {
beforeEach(() => (node = create()));
Expand All @@ -86,14 +86,14 @@ describe('a configuration map', () => {
'parsed as SCSS',
() =>
(scss.parse('@use "foo" with ($bar: "baz")').nodes[0] as UseRule)
.configuration
.configuration,
);

describeNode(
'parsed as Sass',
() =>
(sass.parse('@use "foo" with ($bar: "baz")').nodes[0] as UseRule)
.configuration
.configuration,
);

describe('constructed manually', () => {
Expand All @@ -104,12 +104,13 @@ describe('a configuration map', () => {
variables: [
{variableName: 'bar', expression: {text: 'baz', quotes: true}},
],
})
}),
);

describeNode(
'variables record',
() => new Configuration({variables: {bar: {text: 'baz', quotes: true}}})
() =>
new Configuration({variables: {bar: {text: 'baz', quotes: true}}}),
);
});

Expand All @@ -119,7 +120,7 @@ describe('a configuration map', () => {
new UseRule({
useUrl: 'foo',
configuration: {variables: {bar: {text: 'baz', quotes: true}}},
}).configuration
}).configuration,
);
});

Expand Down Expand Up @@ -225,7 +226,7 @@ describe('a configuration map', () => {
describe('adds a new variable', () => {
function describeVariable(
description: string,
create: () => Configuration
create: () => Configuration,
): void {
it(description, () => {
expect(create()).toBe(node);
Expand All @@ -238,15 +239,15 @@ describe('a configuration map', () => {
}

describeVariable('with Expression', () =>
node.set('baz', new StringExpression({text: 'bang', quotes: true}))
node.set('baz', new StringExpression({text: 'bang', quotes: true})),
);

describeVariable('with ExpressionProps', () =>
node.set('baz', {text: 'bang', quotes: true})
node.set('baz', {text: 'bang', quotes: true}),
);

describeVariable('with ConfiguredVariableObjectProps', () =>
node.set('baz', {expression: {text: 'bang', quotes: true}})
node.set('baz', {expression: {text: 'bang', quotes: true}}),
);
});

Expand All @@ -269,7 +270,7 @@ describe('a configuration map', () => {
foo: {text: 'bar', quotes: true},
baz: {text: 'bang', quotes: true},
},
}).toString()
}).toString(),
).toBe('($foo: "bar", $baz: "bang")'));
});

Expand All @@ -281,7 +282,7 @@ describe('a configuration map', () => {
foo: {text: 'bar', quotes: true},
baz: {text: 'bang', quotes: true},
},
}).toString()
}).toString(),
).toBe('($foo: "bar", $baz: "bang",)'));

it('with comma: true and afterValue', () =>
Expand All @@ -295,7 +296,7 @@ describe('a configuration map', () => {
raws: {afterValue: '/**/'},
},
},
}).toString()
}).toString(),
).toBe('($foo: "bar", $baz: "bang"/**/,)'));

it('with after', () =>
Expand All @@ -306,7 +307,7 @@ describe('a configuration map', () => {
foo: {text: 'bar', quotes: true},
baz: {text: 'bang', quotes: true},
},
}).toString()
}).toString(),
).toBe('($foo: "bar", $baz: "bang"/**/)'));

it('with after and afterValue', () =>
Expand All @@ -320,7 +321,7 @@ describe('a configuration map', () => {
raws: {afterValue: ' '},
},
},
}).toString()
}).toString(),
).toBe('($foo: "bar", $baz: "bang" /**/)'));

it('with afterValue and a guard', () =>
Expand All @@ -334,7 +335,7 @@ describe('a configuration map', () => {
guarded: true,
},
},
}).toString()
}).toString(),
).toBe('($foo: "bar", $baz: "bang" !default/**/)'));
});
});
Expand Down Expand Up @@ -422,6 +423,6 @@ describe('a configuration map', () => {
it.skip('toJSON', () =>
expect(
(scss.parse('@use "foo" with ($baz: "qux")').nodes[0] as UseRule)
.configuration
.configuration,
).toMatchSnapshot());
});
2 changes: 1 addition & 1 deletion pkg/sass-parser/lib/src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class Configuration extends Node {
constructor(_: undefined, inner: sassInternal.ConfiguredVariable[]);
constructor(
defaults?: ConfigurationProps,
inner?: sassInternal.ConfiguredVariable[]
inner?: sassInternal.ConfiguredVariable[],
) {
super({});
this.raws = defaults?.raws ?? {};
Expand Down
Loading

0 comments on commit df77b66

Please sign in to comment.