Commit aa7e6cf5 by Steven Vachon Committed by GitHub

@grafana/e2e: fix empty bundle files (#22607)

* Minor changes

* Revert CLI to JavaScript

... as Rollup is only accepts ESM modules and TypeScript would need to use the new incremental builds feature which causes weird Redux module errors.
parent 3745cccd
#!/usr/bin/env node
// This file is used only for internal executions
require('ts-node').register({
project: `${__dirname}/../tsconfig.json`,
transpileOnly: true,
});
require('../src/cli/index.ts').default();
require('../cli')();
import { resolve, sep } from 'path';
import execa, { Options } from 'execa';
import program from 'commander';
const execa = require('execa');
const program = require('commander');
const { resolve, sep } = require('path');
const cypress = (commandName: string) => {
const cypress = commandName => {
// Support running an unpublished dev build
const parentPath = resolve(`${__dirname}/../`);
const parentDirname = parentPath.split(sep).pop();
const projectPath = resolve(`${parentPath}${parentDirname === 'dist' ? '/..' : ''}`);
const dirname = __dirname.split(sep).pop();
const projectPath = resolve(`${__dirname}${dirname === 'dist' ? '/..' : ''}`);
const cypressOptions = [commandName, '--env', `CWD=${process.cwd()}`, `--project=${projectPath}`];
const execaOptions: Options = {
const execaOptions = {
cwd: __dirname,
stdio: 'inherit',
};
......@@ -20,7 +19,7 @@ const cypress = (commandName: string) => {
.catch(error => console.error(error.message));
};
export default () => {
module.exports = () => {
const configOption = '-c, --config <path>';
const configDescription = 'path to JSON file where configuration values are set; defaults to "cypress.json"';
......
......@@ -5,6 +5,7 @@
"version": "6.7.0-pre",
"description": "Grafana End-to-End Test Library",
"keywords": [
"cli",
"grafana",
"e2e",
"typescript"
......
......@@ -20,8 +20,8 @@ const buildCjsPackage = ({ env }) => ({
copy({
flatten: false,
targets: [
{ src: 'compiled/bin/**/*.*', dest: 'dist/' },
{ src: 'compiled/cli/**/*.*', dest: 'dist/' },
{ src: 'bin/**/*.*', dest: 'dist/bin/' },
{ src: 'cli.js', dest: 'dist/' },
{ src: 'cypress.json', dest: 'dist/' },
{ src: 'cypress/**/*.+(js|ts)', dest: 'dist/cypress/' },
],
......
#!/usr/bin/env node
import cli from '../cli/index';
cli();
{
"compilerOptions": {
"declarationDir": "dist",
"module": "commonjs",
"outDir": "compiled",
"rootDirs": ["."],
"typeRoots": ["node_modules/@types"],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment