Skip to content

Commit

Permalink
chore(gene-tools): update setupNodeEvents configuration (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
kopach authored Dec 31, 2024
1 parent 54dc022 commit 29603d7
Show file tree
Hide file tree
Showing 11 changed files with 505 additions and 242 deletions.
1 change: 1 addition & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Publish to NPM on GH Release Publish
run-name: Publish to NPM ${{ github.event.inputs.version || github.event.release.tag_name }}

on:
workflow_dispatch:
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"@storybook/addon-actions": "6.5.16",
"@storybook/builder-webpack5": "6.5.4",
"@storybook/core-server": "6.5.16",
"@storybook/manager-webpack5": "6.5.4",
"@tanstack/react-query": "5.55.4",
"chalk": "2.4.2",
"classnames": "2.5.1",
Expand Down Expand Up @@ -96,6 +95,7 @@
"@babel/runtime": "7.16.7",
"@badeball/cypress-cucumber-preprocessor": "13.0.2",
"@bahmutov/cypress-esbuild-preprocessor": "2.1.5",
"@cypress/webpack-preprocessor": "6.0.2",
"@next/bundle-analyzer": "12.3.4",
"@nrwl/cypress": "15.8.9",
"@nrwl/jest": "15.8.9",
Expand Down Expand Up @@ -175,9 +175,11 @@
"tailwindcss": "3.4.14",
"tailwindcss-animate": "1.0.7",
"ts-jest": "29.0.5",
"ts-loader": "9.5.1",
"ts-node": "10.9.1",
"tsconfig-paths-webpack-plugin": "3.5.1",
"typescript": "4.7.4",
"webpack": "5.74.0",
"zod": "3.22.3",
"zod-to-ts": "1.2.0"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'cypress';
import {nxE2EPreset} from '@nrwl/cypress/plugins/cypress-preset';
import * as setupNodeEvents from './src/plugins/index';
import {setupNodeEvents} from './src/plugins';

export default defineConfig({
e2e: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,41 @@
const webpack = require('@cypress/webpack-preprocessor');
const {
addCucumberPreprocessorPlugin,
} = require('@badeball/cypress-cucumber-preprocessor');
const {
preprocessor,
} = require('@badeball/cypress-cucumber-preprocessor/browserify');

module.exports = async (on, config) => {
export async function setupNodeEvents(on, config) {
// This is required for the preprocessor to be able to generate JSON reports after each run, and more,
await addCucumberPreprocessorPlugin(on, config);

on(
'file:preprocessor',
preprocessor(config, {
typescript: require.resolve('typescript'),
webpack({
webpackOptions: {
resolve: {
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.feature$/,
use: [
{
loader: '@badeball/cypress-cucumber-preprocessor/webpack',
options: config,
},
],
},
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'ts-loader',
options: {
transpileOnly: true,
},
},
],
},
},
})
);

Expand All @@ -25,5 +49,6 @@ module.exports = async (on, config) => {
}
});

// Make sure to return the config object as it might have been modified by the plugin.
return config;
};
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'cypress';
import {nxE2EPreset} from '@nrwl/cypress/plugins/cypress-preset';
import * as setupNodeEvents from './src/plugins/index';
import {setupNodeEvents} from './src/plugins';

export default defineConfig({
e2e: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,41 @@
const webpack = require('@cypress/webpack-preprocessor');
const {
addCucumberPreprocessorPlugin,
} = require('@badeball/cypress-cucumber-preprocessor');
const {
preprocessor,
} = require('@badeball/cypress-cucumber-preprocessor/browserify');

module.exports = async (on, config) => {
export async function setupNodeEvents(on, config) {
// This is required for the preprocessor to be able to generate JSON reports after each run, and more,
await addCucumberPreprocessorPlugin(on, config);

on(
'file:preprocessor',
preprocessor(config, {
typescript: require.resolve('typescript'),
webpack({
webpackOptions: {
resolve: {
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.feature$/,
use: [
{
loader: '@badeball/cypress-cucumber-preprocessor/webpack',
options: config,
},
],
},
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'ts-loader',
options: {
transpileOnly: true,
},
},
],
},
},
})
);

Expand All @@ -25,5 +49,6 @@ module.exports = async (on, config) => {
}
});

// Make sure to return the config object as it might have been modified by the plugin.
return config;
};
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'cypress';
import {nxE2EPreset} from '@nrwl/cypress/plugins/cypress-preset';
import * as setupNodeEvents from './src/plugins/index';
import {setupNodeEvents} from './src/plugins';

export default defineConfig({
e2e: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,41 @@
const webpack = require('@cypress/webpack-preprocessor');
const {
addCucumberPreprocessorPlugin,
} = require('@badeball/cypress-cucumber-preprocessor');
const {
preprocessor,
} = require('@badeball/cypress-cucumber-preprocessor/browserify');

module.exports = async (on, config) => {
export async function setupNodeEvents(on, config) {
// This is required for the preprocessor to be able to generate JSON reports after each run, and more,
await addCucumberPreprocessorPlugin(on, config);

on(
'file:preprocessor',
preprocessor(config, {
typescript: require.resolve('typescript'),
webpack({
webpackOptions: {
resolve: {
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.feature$/,
use: [
{
loader: '@badeball/cypress-cucumber-preprocessor/webpack',
options: config,
},
],
},
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'ts-loader',
options: {
transpileOnly: true,
},
},
],
},
},
})
);

Expand All @@ -25,5 +49,6 @@ module.exports = async (on, config) => {
}
});

// Make sure to return the config object as it might have been modified by the plugin.
return config;
};
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'cypress';
import {nxE2EPreset} from '@nrwl/cypress/plugins/cypress-preset';
import * as setupNodeEvents from './src/plugins/index';
import {setupNodeEvents} from './src/plugins';

export default defineConfig({
e2e: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,41 @@
const webpack = require('@cypress/webpack-preprocessor');
const {
addCucumberPreprocessorPlugin,
} = require('@badeball/cypress-cucumber-preprocessor');
const {
preprocessor,
} = require('@badeball/cypress-cucumber-preprocessor/browserify');

module.exports = async (on, config) => {
export async function setupNodeEvents(on, config) {
// This is required for the preprocessor to be able to generate JSON reports after each run, and more,
await addCucumberPreprocessorPlugin(on, config);

on(
'file:preprocessor',
preprocessor(config, {
typescript: require.resolve('typescript'),
webpack({
webpackOptions: {
resolve: {
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.feature$/,
use: [
{
loader: '@badeball/cypress-cucumber-preprocessor/webpack',
options: config,
},
],
},
{
test: /\.tsx?$/,
exclude: /node_modules/,
loader: 'ts-loader',
options: {
transpileOnly: true,
},
},
],
},
},
})
);

Expand All @@ -25,5 +49,6 @@ module.exports = async (on, config) => {
}
});

// Make sure to return the config object as it might have been modified by the plugin.
return config;
};
}
Loading

0 comments on commit 29603d7

Please sign in to comment.