packages: add compile-test-app that uses serve-plugin from cli

This commit is contained in:
Patrik Oldsberg
2020-02-27 11:42:22 +01:00
parent 136bccaf8d
commit 8d69089cf4
8 changed files with 49 additions and 0 deletions
@@ -0,0 +1,3 @@
# compile-test-app
Used to try out different setups for building packages separately but supporting global watch mode.
@@ -0,0 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { ExampleComponent } from '../src';
ReactDOM.render(
<main>
<h1>This is the dev app</h1>
<ExampleComponent />
</main>,
document.getElementById('root'),
);
@@ -0,0 +1,4 @@
module.exports = {
...require('@spotify/web-scripts/config/jest.config.js'),
setupFilesAfterEnv: ['../jest.setup.ts'],
};
@@ -0,0 +1 @@
import '@testing-library/jest-dom/extend-expect';
@@ -0,0 +1,18 @@
{
"name": "compile-test-app",
"version": "0.0.0",
"main": "dist/cjs/index.js",
"license": "Apache-2.0",
"private": false,
"scripts": {
"build": "tsc --outDir dist/cjs --noEmit false --module CommonJS",
"build:watch": "yarn run build --watch",
"start": "backstage-cli serve-plugin",
"lint": "web-scripts lint",
"test": "web-scripts test"
},
"devDependencies": {
"@spotify/web-scripts": "^6.0.0",
"@spotify-backstage/cli": "^1.2.0"
}
}
@@ -0,0 +1,7 @@
import React, { FC } from 'react';
const ExampleComponent: FC<{}> = () => {
return <div>This is the ExampleComponent</div>;
};
export default ExampleComponent;
@@ -0,0 +1 @@
export { default as ExampleComponent } from './ExampleComponent';
@@ -0,0 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["dev", "src"]
}