Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps-dev): bump the lint group with 4 updates #3084

Merged
merged 4 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
360 changes: 180 additions & 180 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@
"@types/jest-image-snapshot": "~6.4.0",
"@types/lodash-es": "~4.17.12",
"@types/minimist": "~1.2.5",
"@typescript-eslint/eslint-plugin": "~7.7.0",
"@typescript-eslint/parser": "~7.7.0",
"@typescript-eslint/eslint-plugin": "~7.7.1",
"@typescript-eslint/parser": "~7.7.1",
"autoprefixer": "~10.4.19",
"clipboardy": "~4.0.0",
"cross-env": "~7.0.3",
Expand All @@ -131,12 +131,12 @@
"eslint-config-prettier": "~9.1.0",
"eslint-import-resolver-typescript": "~3.6.1",
"eslint-plugin-import": "~2.29.1",
"eslint-plugin-jest": "~28.2.0",
"eslint-plugin-jest": "~28.3.0",
"eslint-plugin-jest-extended": "^2.4.0",
"eslint-plugin-notice": "~0.9.10",
"eslint-plugin-playwright": "~1.6.0",
"eslint-plugin-prettier": "~5.1.3",
"eslint-plugin-unicorn": "~51.0.1",
"eslint-plugin-unicorn": "~52.0.0",
"expect-playwright": "~0.8.0",
"fs-extra": "~11.2.0",
"husky": "~9.0.11",
Expand Down
16 changes: 8 additions & 8 deletions scripts/prepare-demo-for-publish.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ limitations under the License.
*/

import { readdirSync, writeFileSync, readFileSync, copyFileSync } from 'node:fs';
import { join, extname } from 'node:path';
import path from 'node:path';

const updateAssetsLoadingFile = path => {
let content = readFileSync(path, 'utf8').toString();
const updateAssetsLoadingFile = filePath => {
let content = readFileSync(filePath, 'utf8').toString();
content = content.replaceAll('"/dev/public/assets/', '"assets/');
writeFileSync(path, content);
writeFileSync(filePath, content);
// eslint-disable-next-line no-console
console.info('Content of page updated', path);
console.info('Content of page updated', filePath);
};

const demoRootDirectory = './build/demo';
const htmlPagesPath = join(demoRootDirectory, 'dev/public');
tbouffard marked this conversation as resolved.
Show resolved Hide resolved
const pages = readdirSync(htmlPagesPath);
for (const page of pages.filter(file => extname(file).toLowerCase() === '.html')) {
for (const page of pages.filter(file => path.extname(file).toLowerCase() === '.html')) {
// eslint-disable-next-line no-console
console.info('Managing', page);

// change the path of the assets in the current html page
updateAssetsLoadingFile(join(htmlPagesPath, page));
updateAssetsLoadingFile(path.join(htmlPagesPath, page));
}

// copy ./index.html in build/demo directory, to reproduce the hierarchy on the examples' repo, on the demo preview in GitHub
copyFileSync('./index.html', join(demoRootDirectory, 'index.html'));
copyFileSync('./index.html', path.join(demoRootDirectory, 'index.html'));
4 changes: 2 additions & 2 deletions scripts/utils/parseBpmn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
import type BpmnModel from '../../src/model/bpmn/internal/BpmnModel';
import type { BpmnJsonModel } from '../../src/model/bpmn/json/bpmn20';

import { resolve as resolvePath } from 'node:path';
import path from 'node:path';

import clipboardy from 'clipboardy';
import parseArgs from 'minimist';
Expand All @@ -27,7 +27,7 @@ import { ParsingMessageCollector } from '../../src/component/parser/parsing-mess
import BpmnXmlParser from '../../src/component/parser/xml/BpmnXmlParser';
import { readFileSync } from '../../test/shared/file-helper';

const __dirname = resolvePath();
const __dirname = path.resolve();
const argv = parseArgs(process.argv.slice(2));
const bpmnFilePath = argv._[0];
const outputType = argv.output || 'json';
Expand Down
4 changes: 2 additions & 2 deletions test/bundles/bundles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import 'jest-playwright-preset';
import type { TargetedPageConfiguration } from '@test/shared/visu/bpmn-page-utils';
import type { Page } from 'playwright';

import { resolve } from 'node:path';
import path from 'node:path';

import { BpmnPageSvgTester } from '@test/shared/visu/bpmn-page-utils';

Expand Down Expand Up @@ -53,7 +53,7 @@ class BpmnStaticPageSvgTester extends BpmnPageSvgTester {
super({ ...targetedPageConfiguration, diagramSubfolder: 'none' }, page);
}
override async gotoPageAndLoadBpmnDiagram(): Promise<void> {
const url = `file://${resolve(__dirname, `static/${this.targetedPageConfiguration.targetedPage.pageFileName}.html`)}`;
const url = `file://${path.resolve(__dirname, `static/${this.targetedPageConfiguration.targetedPage.pageFileName}.html`)}`;
await super.doGotoPageAndLoadBpmnDiagram(url, false);
}
}
12 changes: 6 additions & 6 deletions test/e2e/diagram.navigation.fit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
import type { ImageSnapshotThresholdConfig } from './helpers/visu/image-snapshot-config';
import type { MatchImageSnapshotOptions } from 'jest-image-snapshot';

import { join } from 'node:path';
import path from 'node:path';

import 'jest-playwright-preset';

Expand All @@ -41,23 +41,23 @@ class FitImageSnapshotConfigurator extends ImageSnapshotConfigurator {
}

private static buildSnapshotFitDirectory(parentDirectory: string, fitType: FitType, withMargin = false, margin?: number): string {
const rootFitDirectory = join(parentDirectory, `type-${fitType}`);
const rootFitDirectory = path.join(parentDirectory, `type-${fitType}`);

if (!withMargin) {
return rootFitDirectory;
}
return join(rootFitDirectory, `margin-${margin == null || margin < 0 ? 0 : margin}`);
return path.join(rootFitDirectory, `margin-${margin == null || margin < 0 ? 0 : margin}`);
}

static buildOnLoadDiffDirectory(config: MatchImageSnapshotOptions, fitType: FitType, withMargin = false, margin?: number): string {
const onLoadDirectory = join(config.customDiffDir, 'on-load');
const onLoadDirectory = path.join(config.customDiffDir, 'on-load');
return FitImageSnapshotConfigurator.buildSnapshotFitDirectory(onLoadDirectory, fitType, withMargin, margin);
}

static buildAfterLoadDiffDirectory(config: MatchImageSnapshotOptions, afterLoadFitType: FitType, onLoadFitType: FitType): string {
const afterLoadDirectory = join(config.customDiffDir, 'after-load');
const afterLoadDirectory = path.join(config.customDiffDir, 'after-load');
const snapshotFitDirectory = FitImageSnapshotConfigurator.buildSnapshotFitDirectory(afterLoadDirectory, afterLoadFitType);
return join(snapshotFitDirectory, `on-load_type-${onLoadFitType}`);
return path.join(snapshotFitDirectory, `on-load_type-${onLoadFitType}`);
}
}

Expand Down
10 changes: 5 additions & 5 deletions test/e2e/diagram.navigation.zoom.pan.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
import type { ImageSnapshotThresholdConfig } from './helpers/visu/image-snapshot-config';
import type { Point } from '@test/shared/visu/bpmn-page-utils';

import { join } from 'node:path';
import path from 'node:path';

import debugLogger from 'debug';
import 'jest-playwright-preset';
Expand Down Expand Up @@ -122,7 +122,7 @@ describe('diagram navigation - zoom and pan with mouse', () => {
expect(image).toMatchImageSnapshot({
...config,
customSnapshotIdentifier: 'initial.zoom',
customDiffDir: join(config.customDiffDir, `mouse-zoom-in-out-${xTimes}-times`),
customDiffDir: path.join(config.customDiffDir, `mouse-zoom-in-out-${xTimes}-times`),
});
});
});
Expand Down Expand Up @@ -166,7 +166,7 @@ describe('diagram navigation - zoom with buttons', () => {
expect(image).toMatchImageSnapshot({
...config,
customSnapshotIdentifier: 'initial.zoom',
customDiffDir: join(config.customDiffDir, `button-zoom-in-out-${xTimes}-times`),
customDiffDir: path.join(config.customDiffDir, `button-zoom-in-out-${xTimes}-times`),
});
});
});
Expand Down Expand Up @@ -208,7 +208,7 @@ describe('diagram navigation - zoom with buttons and mouse', () => {
expect(image).toMatchImageSnapshot({
...config,
customSnapshotIdentifier: 'initial.zoom',
customDiffDir: join(config.customDiffDir, `zoom-button-then-mouse-${firstZoom}-then-${secondZoom}`),
customDiffDir: path.join(config.customDiffDir, `zoom-button-then-mouse-${firstZoom}-then-${secondZoom}`),
});
});

Expand All @@ -225,7 +225,7 @@ describe('diagram navigation - zoom with buttons and mouse', () => {
expect(image).toMatchImageSnapshot({
...config,
customSnapshotIdentifier: 'initial.zoom',
customDiffDir: join(config.customDiffDir, `zoom-mouse-then-button-${firstZoom}-then-${secondZoom}`),
customDiffDir: path.join(config.customDiffDir, `zoom-mouse-then-button-${firstZoom}-then-${secondZoom}`),
});
});
});
12 changes: 6 additions & 6 deletions test/e2e/helpers/visu/image-snapshot-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

import type { MatchImageSnapshotOptions } from 'jest-image-snapshot';

import { dirname, join } from 'node:path';
import path from 'node:path';

import { configLog, getSimplePlatformName, getTestedBrowserFamily } from '@test/shared/visu/test-utils';

Expand Down Expand Up @@ -47,8 +47,8 @@ export class ImageSnapshotConfigurator {
constructor(imageSnapshotThresholds: MultiBrowserImageSnapshotThresholds, snapshotsSubDirectoryName: string) {
this.thresholdConfig = imageSnapshotThresholds.getThresholds();
this.defaultFailureThreshold = imageSnapshotThresholds.getDefault();
this.defaultCustomDiffDir = join(ImageSnapshotConfigurator.getDiffDirectory(), snapshotsSubDirectoryName);
this.defaultCustomSnapshotsDir = join(ImageSnapshotConfigurator.getSnapshotsDirectory(), snapshotsSubDirectoryName);
this.defaultCustomDiffDir = path.join(ImageSnapshotConfigurator.getDiffDirectory(), snapshotsSubDirectoryName);
this.defaultCustomSnapshotsDir = path.join(ImageSnapshotConfigurator.getSnapshotsDirectory(), snapshotsSubDirectoryName);
}

getConfig(parameter: string | { fileName: string }): MatchImageSnapshotOptions {
Expand Down Expand Up @@ -83,13 +83,13 @@ export class ImageSnapshotConfigurator {
}

static getSnapshotsDirectory(): string {
return join(dirname(expect.getState().testPath), '__image_snapshots__');
return path.join(path.dirname(expect.getState().testPath), '__image_snapshots__');
}

static getDiffDirectory(): string {
const testDirectoryName = dirname(expect.getState().testPath);
const testDirectoryName = path.dirname(expect.getState().testPath);
// directory is relative to $ROOT/test/e2e
return join(testDirectoryName, '../../build/test-report/e2e/__diff_output__');
return path.join(testDirectoryName, '../../build/test-report/e2e/__diff_output__');
}
}

Expand Down
12 changes: 6 additions & 6 deletions test/e2e/overlays.rendering.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type { ImageSnapshotThresholdConfig } from './helpers/visu/image-snapshot
import type { OverlayEdgePosition, OverlayPosition, OverlayShapePosition } from '@lib/component/registry';
import type { Point } from '@test/shared/visu/bpmn-page-utils';

import { join } from 'node:path';
import path from 'node:path';

import debugLogger from 'debug';

Expand Down Expand Up @@ -125,15 +125,15 @@ class OverlaysPageTester extends PageTester {
const pageTester = new OverlaysPageTester({ targetedPage: AvailableTestPages.OVERLAYS, diagramSubfolder: 'overlays' }, page);

function getEdgeDirectory(directory: string): string {
return join(directory, `on.edge`);
return path.join(directory, `on.edge`);
}

function getEdgePositionDirectory(directory: string, position: OverlayEdgePosition): string {
return join(getEdgeDirectory(directory), `on-position-${position}`);
return path.join(getEdgeDirectory(directory), `on-position-${position}`);
}

function getShapeDirectory(directory: string): string {
return join(directory, `on.shape`);
return path.join(directory, `on.shape`);
}

describe('BPMN Shapes with overlays', () => {
Expand Down Expand Up @@ -365,8 +365,8 @@ describe('Overlay style', () => {
expect(image).toMatchImageSnapshot({
...config,
customSnapshotIdentifier: `add.overlay.with.custom.${style}`,
customSnapshotsDir: join(config.customSnapshotsDir, snapshotPath),
customDiffDir: join(config.customDiffDir, snapshotPath),
customSnapshotsDir: path.join(config.customSnapshotsDir, snapshotPath),
customDiffDir: path.join(config.customDiffDir, snapshotPath),
});
});
});
6 changes: 3 additions & 3 deletions test/shared/file-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ limitations under the License.
*/

import { readdirSync, readFileSync as fsReadFileSync } from 'node:fs';
import { join } from 'node:path';
import path from 'node:path';

export function readFileSync(relativePathToSourceFile: string, encoding: BufferEncoding = 'utf8', directoryName = __dirname): string {
return fsReadFileSync(join(directoryName, relativePathToSourceFile), { encoding });
return fsReadFileSync(path.join(directoryName, relativePathToSourceFile), { encoding });
}

/** Returns the files in the given directory. The function doesn't do any recursion in sub directories. */
export function findFiles(relativePathToSourceDirectory: string): string[] {
return readdirSync(join(__dirname, relativePathToSourceDirectory));
return readdirSync(path.join(__dirname, relativePathToSourceDirectory));
}
4 changes: 2 additions & 2 deletions test/shared/visu/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import { join } from 'node:path';
import path from 'node:path';

import debugLogger from 'debug';
import 'jest-playwright-preset';
Expand Down Expand Up @@ -49,7 +49,7 @@ export function delay(time: number): Promise<unknown> {
}

export function getBpmnDiagramNames(directoryName: string): string[] {
return findFiles(join('../fixtures/bpmn/', directoryName))
return findFiles(path.join('../fixtures/bpmn/', directoryName))
.filter(filename => filename.endsWith('.bpmn'))
.map(filename => filename.split('.').slice(0, -1).join('.'));
}
6 changes: 3 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import { resolve } from 'node:path';
import path from 'node:path';

import { defineConfig } from 'vite';

Expand All @@ -33,8 +33,8 @@ export default defineConfig(({ mode }) => {
assetsDir: 'build/demo/dev/public/assets',
rollupOptions: {
input: {
index: resolve(__dirname, 'dev/public/index.html'),
'elements-identification': resolve(__dirname, 'dev/public/elements-identification.html'),
index: path.resolve(__dirname, 'dev/public/index.html'),
'elements-identification': path.resolve(__dirname, 'dev/public/elements-identification.html'),
},
// No hash in asset names. We make the demo publicly available via the examples repository and served by statically.io
// New versions are accessed using tags. The master branch is cached by statically.io and updated once a day.
Expand Down
Loading