Skip to content

Commit

Permalink
chore: upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
idoros committed Mar 5, 2024
1 parent b1618e3 commit 6dd8a78
Show file tree
Hide file tree
Showing 21 changed files with 773 additions and 5,779 deletions.
6,447 changes: 713 additions & 5,734 deletions package-lock.json

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@rollup/plugin-html": "^1.0.3",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/balanced-match": "^3.0.2",
"@types/chai": "^4.3.11",
"@types/chai": "^4.3.12",
"@types/chai-subset": "^1.3.5",
"@types/css-selector-tokenizer": "^0.7.4",
"@types/cssesc": "^3.0.2",
Expand All @@ -42,42 +42,42 @@
"@types/mocha": "^10.0.6",
"@types/node": "14",
"@types/postcss-safe-parser": "^5.0.4",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"@types/semver": "^7.5.6",
"@types/react": "^18.2.63",
"@types/react-dom": "^18.2.19",
"@types/semver": "^7.5.8",
"@types/validate-npm-package-name": "^4.0.2",
"@types/yargs": "^17.0.32",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"autoprefixer": "^10.4.16",
"c8": "^8.0.1",
"autoprefixer": "^10.4.18",
"c8": "^9.1.0",
"chai": "^4.3.10",
"chai-subset": "^1.6.0",
"create-listening-server": "^2.1.0",
"eslint": "^8.56.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.6.0",
"mini-css-extract-plugin": "^2.7.6",
"mocha": "^10.2.0",
"mini-css-extract-plugin": "^2.8.1",
"mocha": "^10.3.0",
"node-eval": "^2.0.0",
"npm-run-all": "^4.1.5",
"playwright-chromium": "^1.40.1",
"postcss": "^8.4.32",
"playwright-chromium": "^1.42.1",
"postcss": "^8.4.35",
"promise-assist": "^2.0.1",
"raw-loader": "^4.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^5.0.5",
"rollup": "^4.9.2",
"rollup": "^4.12.0",
"source-map": "^0.7.4",
"source-map-loader": "^4.0.2",
"style-loader": "^3.3.3",
"source-map-loader": "^5.0.0",
"style-loader": "^3.3.4",
"ts-expect": "^1.3.0",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "~5.2.2",
"typescript": "~5.3.3",
"url-loader": "^4.1.1",
"webpack": "^5.89.0",
"webpack": "^5.90.3",
"yargs": "^17.7.2"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/code-formatter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"dependencies": {
"@stylable/core": "^5.18.1",
"@tokey/css-value-parser": "^0.1.4",
"js-beautify": "^1.14.11",
"postcss": "^8.4.32"
"js-beautify": "^1.15.1",
"postcss": "^8.4.35"
},
"files": [
"dist",
Expand Down
6 changes: 4 additions & 2 deletions packages/code-formatter/src/format-css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,10 @@ function formatAst(ast: AnyNode, index: number, options: FormatOptions) {
}
}
if ('nodes' in ast) {
for (let i = 0; i < ast.nodes.length; i++) {
formatAst(ast.nodes[i], i, {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
for (let i = 0; i < ast.nodes!.length; i++) {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
formatAst(ast.nodes![i], i, {
endOfLine: NL,
indent,
indentLevel: indentLevel + 1,
Expand Down
2 changes: 1 addition & 1 deletion packages/core-test-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@stylable/core": "^5.18.1",
"chai": "^4.3.10",
"flat": "^5.0.2",
"postcss": "^8.4.32"
"postcss": "^8.4.35"
},
"files": [
"dist",
Expand Down
3 changes: 3 additions & 0 deletions packages/core-test-kit/src/match-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export function matchRuleAndDeclaration(
decl: string,
msg?: string
) {
if (!parent.nodes) {
throw new Error(`${msg ? msg + ' ' : ''}expected nested nodes`);
}
const rule = parent.nodes[selectorIndex] as postcss.Rule;
if (rule.selector !== selector) {
throw new Error(
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"balanced-match": "^2.0.0",
"css-selector-tokenizer": "^0.8.0",
"cssesc": "^3.0.0",
"enhanced-resolve": "^5.15.0",
"enhanced-resolve": "^5.15.1",
"is-vendor-prefixed": "^4.0.0",
"lodash.clonedeep": "^4.5.0",
"lodash.clonedeepwith": "^4.5.0",
"postcss": "^8.4.32",
"postcss": "^8.4.35",
"postcss-js": "^4.0.1",
"postcss-nested": "^6.0.1",
"postcss-safe-parser": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/helpers/custom-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ export function validateRuleStateDefinition(
true,
!!stateParam.defaultValue
);
if (errors) {
if (errors && selectorNode.nodes) {
for (const node of selectorNode.nodes) {
if (node.type === 'decl' && node.prop === `-st-states`) {
diagnostics.report(
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/helpers/rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function createSubsetAst<T extends postcss.Root | postcss.AtRule | postcs
const prefixType = prefixSelectorList[0].nodes[0];
const containsPrefix = containsMatchInFirstChunk.bind(null, prefixType);
const mixinRoot = mixinTarget ? mixinTarget : postcss.root();
root.nodes.forEach((node) => {
root.nodes?.forEach((node) => {
if (node.type === 'decl') {
mixinTarget?.append(node.clone());
} else if (
Expand Down
12 changes: 8 additions & 4 deletions packages/core/test/helpers/rule.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ describe(`helpers/rule`, () => {
},
];

testMatcher(expected, res.nodes);
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
testMatcher(expected, res.nodes!);
});

it('should extract global when creating root chunk', () => {
Expand All @@ -115,7 +116,8 @@ describe(`helpers/rule`, () => {
{ selector: ':global(.x) [st-mixin-marker]' },
];

testMatcher(expected, res.nodes);
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
testMatcher(expected, res.nodes!);
});

it('should parts under @media', () => {
Expand Down Expand Up @@ -144,7 +146,8 @@ describe(`helpers/rule`, () => {
},
];

testMatcher(expected, res.nodes);
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
testMatcher(expected, res.nodes!);
});

it('should not append empty media', () => {
Expand All @@ -160,7 +163,8 @@ describe(`helpers/rule`, () => {

const expected = [{ selector: '[st-mixin-marker]' }];

testMatcher(expected, res.nodes);
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
testMatcher(expected, res.nodes!);
});
});
});
3 changes: 2 additions & 1 deletion packages/core/test/scope-directive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@ describe('@st-scope', () => {
shouldReportNoDiagnostics(meta);

const atRule = meta.targetAst!.nodes[0] as AtRule;
const rule = atRule.nodes[0] as Rule;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
const rule = atRule.nodes![0] as Rule;
expect(rule.selector).to.equal('.entry__root .entry__part');
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-test-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dependencies": {
"@stylable/runtime": "^5.18.1",
"node-eval": "^2.0.0",
"playwright-core": "^1.40.1",
"playwright-core": "^1.42.1",
"rimraf": "^5.0.5"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/experimental-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dependencies": {
"@stylable/core": "^5.18.1",
"@stylable/runtime": "^5.18.1",
"css-loader": "^6.8.1",
"css-loader": "^6.10.0",
"decache": "^4.6.2",
"loader-utils": "^3.2.1"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/language-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"@tokey/css-selector-parser": "^0.6.2",
"@tokey/css-value-parser": "^0.1.4",
"css-selector-tokenizer": "^0.8.0",
"postcss": "^8.4.32",
"postcss": "^8.4.35",
"postcss-value-parser": "^4.2.0",
"vscode-css-languageservice": "^6.2.11",
"vscode-css-languageservice": "^6.2.12",
"vscode-languageserver": "^9.0.1",
"vscode-languageserver-textdocument": "^1.0.11",
"vscode-uri": "^3.0.8"
Expand Down
3 changes: 2 additions & 1 deletion packages/language-service/src/lib-new/ast-from-position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export interface AstLocationResult {
atRuleParams: (AstLocation & { type: 'atRuleParams' }) | undefined;
}
function isClosed(node: postcss.AnyNode) {
const isLast = node.parent && node.parent.nodes[node.parent.nodes.length - 1] === node;
const parentNodes = node.parent?.nodes;
const isLast = parentNodes?.[parentNodes.length - 1] === node;
if (node.type === 'decl' || (node.type === 'atrule' && !node.nodes)) {
return isLast ? node.parent?.raws.semicolon : true;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/language-service/src/lib-new/edit-time-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ class EditTimeParser extends Parser {
tokens.splice(colonIndex, 0, ['word', '', colonToken[2], colonToken[2]]);
}
this.decl(tokens, customProperty);
node = this.current.nodes[this.current.nodes.length - 1] as postcss.Declaration;
const nodes = this.current.nodes;
node = nodes?.[nodes.length - 1] as postcss.Declaration;
this.reportNode(node, 'ambiguity', AMBIGUITY.POSSIBLE_UNOPENED_RULE);
} else {
// ambiguity: might be a rule or a declaration
Expand Down
10 changes: 5 additions & 5 deletions packages/language-service/src/lib/utils/postcss-ast-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export function isInNode(
return false;
}
if (!nodeEnd) {
return (
!isBeforeRuleset(position, node) ||
(!!(node as postcss.Container).nodes &&
!!((node as postcss.Container).nodes.length > 0))
);
if (!isBeforeRuleset(position, node)) {
return true;
}
const nodes = (node as postcss.Container).nodes;
return nodes ? nodes.length > 0 : false;
}
if (nodeEnd.line < position.line) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@stylable/core": "^5.18.1",
"@tokey/css-selector-parser": "^0.6.2",
"csso": "^5.0.5",
"postcss": "^8.4.32"
"postcss": "^8.4.35"
},
"files": [
"dist",
Expand Down
4 changes: 2 additions & 2 deletions packages/optimizer/src/stylable-optimizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@stylable/core/dist/index-internal';
import { parseCssSelector, stringifySelectorAst, Selector, walk } from '@tokey/css-selector-parser';
import csso from 'csso';
import postcss, { Root, Rule, Node, Comment, Container } from 'postcss';
import postcss, { Root, Rule, Node, Comment } from 'postcss';
import { NameMapper } from './name-mapper';

const { booleanStateDelimiter } = STCustomState.delimiters;
Expand Down Expand Up @@ -313,7 +313,7 @@ export function replaceRecursiveUpIfEmpty(label: string, node: Node) {
parent &&
parent.type !== 'document' &&
parent.nodes &&
(parent as Container).nodes.filter((node) => node.type !== 'comment').length === 0
parent.nodes.filter((node) => node.type !== 'comment').length === 0
) {
replaceRecursiveUpIfEmpty('EMPTY_NODE', parent);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@stylable/runtime": "^5.18.1",
"decache": "^4.6.2",
"lodash.clonedeep": "^4.5.0",
"postcss": "^8.4.32"
"postcss": "^8.4.35"
},
"files": [
"dist",
Expand Down
3 changes: 3 additions & 0 deletions packages/webpack-plugin/src/plugin-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ export function replaceMappedCSSAssetPlaceholders({
return extractFilenameFromAssetModule(assetModule, publicPath);
} else {
const data = new Map<string, unknown>();
if (!assetModule.generator) {
throw new Error('Missing asset module generator for ' + resourcePath);
}
const assetModuleSource = assetModule.generator.generate(assetModule, {
chunkGraph,
moduleGraph,
Expand Down

0 comments on commit 6dd8a78

Please sign in to comment.