Skip to content

Commit

Permalink
refactor: reclass all packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Almouro committed Sep 21, 2023
1 parent d406d87 commit 0c381cf
Show file tree
Hide file tree
Showing 255 changed files with 79 additions and 75 deletions.
6 changes: 3 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ module.exports = {
devDependencies: [
"**/__tests__/**",
// web app will be built with parcel in the dist folder, so we only package the final html/js files, not the deps
"packages/measure/src/webapp/**",
"packages/web-reporter-ui/utils/testUtils.ts",
"packages/web-reporter/src/**",
"packages/commands/measure/src/webapp/**",
"packages/core/web-reporter-ui/utils/testUtils.ts",
"packages/commands/report/src/**",
"**/*.config.js", // This is necessary for tailwind.config.js in both web-reporter and web-reporter-ui
],
},
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ xcrun simctl install $UDID ./.github/workflows/fakeStore.app
xcrun simctl launch $UDID $APPID

mkdir -p report
npx flashlight-ios-poc ios-test --appId $APPID --simulatorId $UDID --testCommand 'maestro test ./packages/ios-poc/test.yaml' --resultsFilePath './report/result.json'
npx flashlight-ios-poc ios-test --appId $APPID --simulatorId $UDID --testCommand 'maestro test ./packages/platforms/ios/test.yaml' --resultsFilePath './report/result.json'
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ yarn workspace @perf-profiler/measure start
Then run the `measure` commmand with:

```bash
DEVELOPMENT_MODE=true node packages/measure/dist/server/bin.js measure
DEVELOPMENT_MODE=true node packages/commands/measure/dist/server/bin.js measure
```

### `test` command
Expand All @@ -52,7 +52,7 @@ To run the command locally:

```
node packages/e2e-performance/dist/bin.js test
node packages/commands/test/dist/bin.js test
```

Expand All @@ -74,7 +74,7 @@ yarn workspace @perf-profiler/web-reporter start
```

Then in `packages/web-reporter/src/App.tsx`, uncomment the lines to add your own measures:
Then in `packages/commands/report/src/App.tsx`, uncomment the lines to add your own measures:

```ts
// Uncomment with when locally testing
Expand Down
20 changes: 10 additions & 10 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ const commonOptions = {
setupFiles: ["<rootDir>/jest-setup.ts"],
};

const WEB_PACKAGES = ["flipper-plugin-android-performance-profiler", "measure", "web-reporter-ui"];
const WEB_PACKAGES = ["plugins/flipper", "commands/measure", "core/web-reporter-ui"];

const NODE_PACKAGES = [
"android-performance-profiler",
"appium-helper",
"appium-test-cases",
"aws-device-farm",
"e2e-performance",
"eslint-plugin-flashlight-eslint-rules",
"reporter",
"shell",
"web-reporter",
"platforms/android",
"plugins/appium-helper",
"plugins/appium-test-cases",
"plugins/aws-device-farm",
"commands/test",
"plugins/eslint",
"core/reporter",
"core/shell",
"commands/report",
];

module.exports = {
Expand Down
26 changes: 13 additions & 13 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"packages": [
"./packages/logger",
"./packages/shell",
"./packages/types",
"./packages/android-performance-profiler",
"./packages/appium-helper",
"./packages/e2e-performance",
"./packages/reporter",
"./packages/web-reporter-ui",
"./packages/web-reporter",
"./packages/appium-test-cases",
"./packages/aws-device-farm",
"./packages/measure",
"./packages/ios-poc"
"./packages/core/logger",
"./packages/core/shell",
"./packages/core/types",
"./packages/platforms/android",
"./packages/plugins/appium-helper",
"./packages/commands/test",
"./packages/core/reporter",
"./packages/core/web-reporter-ui",
"./packages/commands/report",
"./packages/plugins/appium-test-cases",
"./packages/plugins/aws-device-farm",
"./packages/commands/measure",
"./packages/platforms/ios"
],
"useWorkspaces": false,
"npmClient": "yarn",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"license": "MIT",
"workspaces": [
"packages/*",
"packages/*/*",
"examples/*"
],
"bugs": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</head>
<body>
<style>
@import "../../web-reporter-ui/index.css";
@import "../../../../core/web-reporter-ui/index.css";

html,
body,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.module.json",
"extends": "../../../tsconfig.module.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "./dist"
Expand Down
Binary file added packages/commands/report/.DS_Store
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let testCaseResults: TestCaseResult[] =
// require("./example-reports/results1.json"),
// require("./example-reports/results2.json"),
// ];
// // With videos, you have to run `cp packages/web-reporter/src/example-reports/**/*.mp4 packages/web-reporter/dist`
// // With videos, you have to run `cp packages/commands/report/src/example-reports/**/*.mp4 packages/commands/report/dist`
// testCaseResults = [
// require("./example-reports/video/results_417dd25e-d901-4b1e-9d43-3b78305a48e2.json"),
// require("./example-reports/video/results_c7d5d17d-42ed-4354-8b43-bb26e2d6feee.json"),
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</head>
<body>
<style>
@import "../../../web-reporter-ui/index.css";
@import "../../../core/web-reporter-ui/index.css";

html,
body,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.module.json",
"extends": "../../../tsconfig.module.json",
"compilerOptions": {
"outDir": "./dist"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.module.json",
"extends": "../../../tsconfig.module.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "./dist"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.module.json",
"extends": "../../../tsconfig.module.json",
"compilerOptions": {
"outDir": "./dist"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.module.json",
"extends": "../../../tsconfig.module.json",
"compilerOptions": {
"outDir": "./dist"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.module.json",
"extends": "../../../tsconfig.module.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "./dist"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.module.json",
"extends": "../../../tsconfig.module.json",
"compilerOptions": {
"outDir": "./dist"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { getText } from "../utils/testUtils";
describe("<ReporterView />", () => {
it("renders the comparison view", () => {
const testCaseResults: TestCaseResult[] = [
require("../../web-reporter/src/example-reports/results1.json"),
require("../../web-reporter/src/example-reports/results2.json"),
require("../../../commands/report/src/example-reports/results1.json"),
require("../../../commands/report/src/example-reports/results2.json"),
];

const { asFragment, baseElement } = render(
Expand Down Expand Up @@ -44,8 +44,8 @@ describe("<ReporterView />", () => {

it("renders the comparison view with videos", () => {
const testCaseResults: TestCaseResult[] = [
require("../../web-reporter/src/example-reports/video/results_417dd25e-d901-4b1e-9d43-3b78305a48e2.json"),
require("../../web-reporter/src/example-reports/video/results_c7d5d17d-42ed-4354-8b43-bb26e2d6feee.json"),
require("../../../commands/report/src/example-reports/video/results_417dd25e-d901-4b1e-9d43-3b78305a48e2.json"),
require("../../../commands/report/src/example-reports/video/results_c7d5d17d-42ed-4354-8b43-bb26e2d6feee.json"),
];

const { asFragment, baseElement } = render(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.module.json",
"extends": "../../../tsconfig.module.json",
"compilerOptions": {
"outDir": "./dist"
},
Expand Down
File renamed without changes.

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.module.json",
"extends": "../../../tsconfig.module.json",
"compilerOptions": {
"outDir": "./dist"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Requirements:

- Check the results in the web-reporter
`yarn workspace @perf-profiler/web-reporter build`
- `node packages/web-reporter/dist/openReport.js report result.json`
- `node packages/commands/report/dist/openReport.js report result.json`

## Next steps

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.module.json",
"extends": "../../../tsconfig.module.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "./dist"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.module.json",
"extends": "../../../tsconfig.module.json",
"compilerOptions": {
"outDir": "./dist"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.module.json",
"extends": "../../../tsconfig.module.json",
"compilerOptions": {
"outDir": "./dist"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.module.json",
"extends": "../../../tsconfig.module.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "./dist"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"scripts": {
"lint": "flipper-pkg lint",
"prepack": "flipper-pkg lint && flipper-pkg bundle",
"copy:cpp": "cp -R ../android-performance-profiler/cpp-profiler/bin dist/bin",
"copy:cpp": "cp -R ../../platforms/android/cpp-profiler/bin dist/bin",
"copy:css": "yarn workspace @perf-profiler/web-reporter-ui tailwindcss -i ./index.css -o ../flipper-plugin-android-performance-profiler/dist/index.css --minify",
"prebundle": "mkdir -p dist && yarn copy:cpp && yarn copy:css",
"build": "yarn prebundle && flipper-pkg bundle",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import React, { useEffect, useState } from "react";
import { DevicePluginClient, Dialog, createState } from "flipper-plugin";
import { Button, ReporterView, setThemeAtRandom } from "@perf-profiler/web-reporter-ui";
import {
Button,
ReporterView,
setThemeAtRandom,
getThemeColorPalette,
} from "@perf-profiler/web-reporter-ui";
import { BundleIdSelector } from "./components/BundleIdSelector";
import { StartButton } from "./components/StartButton";
import { useMeasures } from "./useMeasures";
import { Delete } from "@mui/icons-material";
import fs from "fs";
import { getThemeColorPalette } from "@perf-profiler/web-reporter-ui/dist/src/theme/colors";
import { AppBar } from "./components/AppBar";

setThemeAtRandom();
Expand Down
4 changes: 4 additions & 0 deletions packages/plugins/flipper/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../../../tsconfig.module.json",
"include": ["src/**/*.ts*"]
}
26 changes: 13 additions & 13 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
"skipLibCheck": true
},
"references": [
{ "path": "./packages/shell" },
{ "path": "./packages/logger" },
{ "path": "./packages/types" },
{ "path": "./packages/android-performance-profiler" },
{ "path": "./packages/appium-helper" },
{ "path": "./packages/e2e-performance" },
{ "path": "./packages/reporter" },
{ "path": "./packages/web-reporter-ui" },
{ "path": "./packages/web-reporter" },
{ "path": "./packages/appium-test-cases" },
{ "path": "./packages/aws-device-farm" },
{ "path": "./packages/ios-poc" },
{ "path": "./packages/measure" },
{ "path": "./packages/core/shell" },
{ "path": "./packages/core/logger" },
{ "path": "./packages/core/types" },
{ "path": "./packages/platforms/android" },
{ "path": "./packages/plugins/appium-helper" },
{ "path": "./packages/commands/test" },
{ "path": "./packages/core/reporter" },
{ "path": "./packages/core/web-reporter-ui" },
{ "path": "./packages/commands/report" },
{ "path": "./packages/plugins/appium-test-cases" },
{ "path": "./packages/plugins/aws-device-farm" },
{ "path": "./packages/platforms/ios" },
{ "path": "./packages/commands/measure" },
{ "path": "./examples/cli" },
{ "path": "./examples/e2e" }
],
Expand Down
2 changes: 1 addition & 1 deletion website/docs/test/running programatically.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ _Feel free to try this out using [our example APK](https://github.com/bamlab/fla
#### 2. Create a TS script including an e2e performance test

You can use any TS/JS based e2e framework (or just simple `adb shell` commands).
Here's an example using our own [Appium Helper](https://github.com/bamlab/flashlight/tree/main/packages/appium-helper) (install it with `yarn add @bam.tech/appium-helper`)
Here's an example using our own [Appium Helper](https://github.com/bamlab/flashlight/tree/main/packages/plugins/appium-helper) (install it with `yarn add @bam.tech/appium-helper`)

```ts
import { AppiumDriver } from "@bam.tech/appium-helper";
Expand Down

0 comments on commit 0c381cf

Please sign in to comment.