Skip to content

Commit f87f62b

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/examples/running-tests-in-chrome-using-bitbucket-pipelines-ci/picomatch-2.3.2
2 parents ff9b4e4 + 2653b1a commit f87f62b

107 files changed

Lines changed: 4567 additions & 7659 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"no-shadow": 0,
4242
"@typescript-eslint/no-shadow": 2,
4343
"no-shadow-restricted-names": 2,
44-
"no-spaced-func": 2,
44+
"func-call-spacing": [2, "never"],
4545
"no-trailing-spaces": 2,
4646
"no-undef-init": 2,
4747
"no-unused-expressions": 2,
@@ -62,7 +62,11 @@
6262
"key-spacing": [2, { "align": "value" }],
6363
"max-nested-callbacks": [2, 3],
6464
"new-parens": 2,
65-
"newline-after-var": [2, "always"],
65+
"padding-line-between-statements": [
66+
2,
67+
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*" },
68+
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"] }
69+
],
6670
"no-lonely-if": 2,
6771
"no-multiple-empty-lines": [2, { "max": 2 }],
6872
"no-nested-ternary": 2,
@@ -98,33 +102,33 @@
98102
"prefer-rest-params": 0,
99103
"prefer-spread": 0,
100104
"@typescript-eslint/no-explicit-any": 0,
101-
"@typescript-eslint/no-extra-parens": 2,
105+
"no-extra-parens": 2,
106+
"@typescript-eslint/no-require-imports": 0,
102107
"@typescript-eslint/no-use-before-define": [2, "nofunc"],
103108
"@typescript-eslint/no-var-requires": [0],
104109
"@typescript-eslint/explicit-function-return-type": "off",
105110
"no-unused-vars": 0,
106-
"@typescript-eslint/no-unused-vars": 2,
111+
"@typescript-eslint/no-unused-expressions": 0,
112+
"@typescript-eslint/no-unused-vars": [2, {
113+
"caughtErrors": "none",
114+
"argsIgnorePattern": "^_",
115+
"varsIgnorePattern": "^_$"
116+
}],
107117
"@typescript-eslint/no-empty-function": 0,
108118
"@typescript-eslint/no-this-alias": 0,
109119
"@typescript-eslint/ban-ts-comment": 0,
120+
"@typescript-eslint/no-unsafe-function-type": 0,
121+
"@typescript-eslint/no-wrapper-object-types": 0,
110122
"no-prototype-builtins": 0,
111-
"@typescript-eslint/ban-types": [
112-
"error",
113-
{
114-
"types": {
115-
"Function": false
116-
}
117-
}
118-
]
123+
"no-constant-binary-expression": 0
119124
},
120125
"overrides": [
121126
{
122127
"files": ["*.ts"],
123128
"rules": {
124129
"@typescript-eslint/explicit-function-return-type": [2, { "allowExpressions": true }],
125130
"@typescript-eslint/no-empty-function": 2,
126-
"prefer-spread": 2,
127-
"@typescript-eslint/ban-ts-ignore": 0
131+
"prefer-spread": 2
128132
}
129133
}
130134
]

.github/scripts/security-checker.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ const LABELS = {
1212
const ALERT_TYPES = {
1313
dependabot: 'dependabot',
1414
codeq: 'codeql',
15-
}
15+
};
1616

1717
class SecurityChecker {
18-
constructor(github, context, issueRepo) {
18+
constructor (github, context, issueRepo) {
1919
this.github = github;
2020
this.issueRepo = issueRepo;
2121
this.context = {
@@ -88,7 +88,7 @@ class SecurityChecker {
8888
}
8989

9090
async closeSpoiledIssues () {
91-
const regExpAlertNumbers = new RegExp(`(?<=\`${this.context.repo}\` - https:.*/dependabot/)\\d+`,'g');
91+
const regExpAlertNumbers = new RegExp(`(?<=\`${this.context.repo}\` - https:.*/dependabot/)\\d+`, 'g');
9292

9393
for (const alert of this.alertDictionary.values()) {
9494

@@ -101,7 +101,7 @@ class SecurityChecker {
101101
const updates = {};
102102
let changedBody = alert.issue.body;
103103

104-
for (let alertNumber of alertNumbers) {
104+
for (const alertNumber of alertNumbers) {
105105
const isAlertOpened = await this.isDependabotAlertOpened(alertNumber);
106106

107107
if (isAlertOpened)
@@ -150,9 +150,9 @@ class SecurityChecker {
150150

151151
async createDependabotlIssues (dependabotAlerts) {
152152
for (const alert of dependabotAlerts) {
153-
if (this.needAddAlertToIssue(alert)) {
153+
if (this.needAddAlertToIssue(alert))
154154
await this.addAlertToIssue(alert);
155-
}
155+
156156
else if (this.needCreateIssue(alert)) {
157157
await this.createIssue({
158158
labels: [LABELS.dependabot, LABELS.security, alert.dependency.scope],
@@ -177,7 +177,7 @@ class SecurityChecker {
177177
return existedIssue
178178
&& existedIssue.cveId === alert.security_advisory.cve_id
179179
&& existedIssue.ghsaId === alert.security_advisory.ghsa_id
180-
&& (!isAlertExisted || (isAlertExisted && !alertNumber));
180+
&& (!isAlertExisted || isAlertExisted && !alertNumber);
181181
}
182182

183183
async addAlertToIssue (alert) {

.github/workflows/publish.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ jobs:
1414
runs-on: ubuntu-latest
1515
environment: npmjs
1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v6
1818
with:
1919
ref: ${{ github.event.release.target_commitish }}
20-
- run: git fetch --force --tags
21-
- uses: actions/setup-node@v4
20+
- uses: DevExpress/testcafe-build-system/actions/publish@main
2221
with:
23-
node-version: 24
24-
registry-url: 'https://registry.npmjs.org'
25-
- run: npm ci
26-
- run: npm run publish-please-only
22+
pre-publish-script: gulp test-server
23+
audit-level: critical
24+
omit-dev-dependencies: true
25+
branch: ${{ github.event.release.target_commitish }}
26+
version: ${{ github.event.release.tag_name }}
2727
docker-publish:
2828
needs: npm-publish
2929
runs-on: ubuntu-latest

.publishrc

Lines changed: 0 additions & 14 deletions
This file was deleted.

@types/replicator/index.d.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

Gulpfile.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const gulp = require('gulp');
22
const gulpStep = require('gulp-step');
33
const data = require('gulp-data');
44
const less = require('gulp-less');
5-
const mocha = require('gulp-mocha-simple');
65
const mustache = require('gulp-mustache');
76
const rename = require('gulp-rename');
87
const uglify = require('gulp-uglify');
@@ -28,6 +27,7 @@ const promisifyStream = require('./gulp/helpers/promisify-stream')
2827
const testFunctional = require('./gulp/helpers/test-functional');
2928
const moduleExportsTransform = require('./gulp/helpers/module-exports-transform');
3029
const createPackageFilesForTests = require('./gulp/helpers/create-package-files-for-tests');
30+
const { runCommands } = require('./gulp/helpers/run-shell-commands');
3131

3232
const {
3333
TESTS_GLOB,
@@ -72,7 +72,7 @@ gulp.task('clean', () => {
7272

7373
// Lint
7474
gulp.task('lint', () => {
75-
const eslint = require('gulp-eslint');
75+
const eslint = require('gulp-eslint-new');
7676

7777
return gulp
7878
.src([
@@ -84,7 +84,7 @@ gulp.task('lint', () => {
8484
'gulp/**/*.js',
8585
'!test/client/vendor/**/*.*',
8686
'!test/functional/fixtures/api/es-next/custom-client-scripts/data/*.js',
87-
'Gulpfile.js',
87+
'[Gg]ulpfile.js',
8888
])
8989
.pipe(eslint())
9090
.pipe(eslint.format(process.env.ESLINT_FORMATTER))
@@ -254,7 +254,7 @@ gulp.step('clean-functional-tests', async () => {
254254

255255
gulp.step('prepare-tests', gulp.registry().get(SKIP_BUILD ? 'lint' : 'build'));
256256

257-
gulp.step('test-server-run', () => {
257+
gulp.step('test-server-run', async () => {
258258
const chai = require('chai');
259259

260260
chai.use(require('chai-string'));
@@ -264,11 +264,11 @@ gulp.step('test-server-run', () => {
264264
const domains = exitDomains();
265265

266266
try {
267-
return gulp
268-
.src('test/server/*-test.js', { read: false })
269-
.pipe(mocha({
270-
timeout: getTimeout(4_000),
271-
}));
267+
const timeout = getTimeout(4_000) === Infinity ? 0 : getTimeout(4_000);
268+
269+
await runCommands([
270+
`npx --no-install mocha --full-trace --timeout ${timeout} "test/server/*-test.js"`,
271+
]);
272272
}
273273
finally {
274274
enterDomains(domains);

eslint.config.js

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
const json5 = require('json5');
4+
const js = require('@eslint/js');
5+
const { FlatCompat } = require('@eslint/eslintrc');
6+
7+
const hammerheadPlugin = require('eslint-plugin-hammerhead');
8+
9+
function wrapLegacyRule (rule) {
10+
if (typeof rule !== 'function')
11+
return rule;
12+
13+
return {
14+
meta: {},
15+
create: rule,
16+
};
17+
}
18+
19+
hammerheadPlugin.rules = Object.fromEntries(
20+
Object.entries(hammerheadPlugin.rules).map(([name, rule]) => [name, wrapLegacyRule(rule)])
21+
);
22+
23+
const compat = new FlatCompat({
24+
baseDirectory: __dirname,
25+
recommendedConfig: js.configs.recommended,
26+
allConfig: js.configs.all,
27+
});
28+
29+
function readConfig (relativePath) {
30+
return json5.parse(fs.readFileSync(path.join(__dirname, relativePath), 'utf8'));
31+
}
32+
33+
function scopeConfigs (files, configs) {
34+
return configs.map(config => ({
35+
...config,
36+
files,
37+
}));
38+
}
39+
40+
module.exports = [
41+
{
42+
ignores: ['test/server/data/**/*.js'],
43+
},
44+
...compat.config(readConfig('.eslintrc')),
45+
...scopeConfigs(['examples/**/*.js'], compat.config(readConfig('examples/.eslintrc'))),
46+
...scopeConfigs(['src/**/*.{js,ts}'], compat.config(readConfig('src/.eslintrc'))),
47+
...scopeConfigs(['src/cli/**/*.{js,ts}'], compat.config(readConfig('src/cli/.eslintrc'))),
48+
...scopeConfigs(['src/client/**/*.{js,ts}'], compat.config(readConfig('src/client/.eslintrc'))),
49+
...scopeConfigs(['src/client/browser/**/*.{js,ts}'], compat.config(readConfig('src/client/browser/.eslintrc'))),
50+
...scopeConfigs(['test/docker/**/*.js'], compat.config(readConfig('test/docker/.eslintrc'))),
51+
...scopeConfigs(['test/client/**/*.js'], compat.config(readConfig('test/client/.eslintrc'))),
52+
...scopeConfigs(['test/client/fixtures/**/*.js'], compat.config(readConfig('test/client/fixtures/.eslintrc'))),
53+
...scopeConfigs(['test/functional/**/*.js'], compat.config(readConfig('test/functional/.eslintrc'))),
54+
...scopeConfigs(['test/functional/fixtures/**/*.js'], compat.config(readConfig('test/functional/fixtures/.eslintrc'))),
55+
...scopeConfigs(['test/functional/legacy-fixtures/**/*.js'], compat.config(readConfig('test/functional/legacy-fixtures/.eslintrc'))),
56+
...scopeConfigs(['test/server/**/*.js'], compat.config(readConfig('test/server/.eslintrc'))),
57+
{
58+
files: ['src/client/rollup.config.js'],
59+
languageOptions: {
60+
globals: {
61+
__dirname: 'readonly',
62+
__filename: 'readonly',
63+
Buffer: 'readonly',
64+
clearInterval: 'readonly',
65+
clearTimeout: 'readonly',
66+
global: 'readonly',
67+
process: 'readonly',
68+
setInterval: 'readonly',
69+
setTimeout: 'readonly',
70+
},
71+
},
72+
},
73+
];

0 commit comments

Comments
 (0)