@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.
This commit is contained in:
Steven Vachon authored and GitHub committed 2020-03-06 12:25:55 -05:00
1 parent 3745cccde6
commit aa7e6cf55f
6 files changed
+12 -25

No files matched your search

+1 -8
View File
@@ -1,10 +1,3 @@
#!/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')();
@@ -1,16 +1,15 @@
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"';
+1
View File
@@ -5,6 +5,7 @@
"version": "6.7.0-pre",
"description": "Grafana End-to-End Test Library",
"keywords": [
"cli",
"grafana",
"e2e",
"typescript"
+2 -2
View File
@@ -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/' },
],
@@ -1,5 +0,0 @@
#!/usr/bin/env node
import cli from '../cli/index';
cli();
-1
View File
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"declarationDir": "dist",
"module": "commonjs",
"outDir": "compiled",
"rootDirs": ["."],
"typeRoots": ["node_modules/@types"],