Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit 672a8f2

Browse files
authored
Merge pull request #1255 from facebookresearch/address-lack-of-package-builds
Reorganized local builds of Mephisto packages
2 parents 66a9d0b + d8f3fa5 commit 672a8f2

File tree

129 files changed

+8814
-16283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+8814
-16283
lines changed

.github/workflows/cypress-end-to-end-tests.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
tools: ${{ steps.filter.outputs.tools }}
2828
mephisto-task: ${{ steps.filter.outputs.mephisto-task }}
2929
mephisto-worker-addons: ${{ steps.filter.outputs.mephisto-worker-addons }}
30+
mephisto-core: ${{ steps.filter.outputs.mephisto-core }}
31+
mephisto-addons: ${{ steps.filter.outputs.mephisto-addons }}
3032
steps:
3133
- uses: actions/checkout@v3
3234
with:
@@ -66,6 +68,10 @@ jobs:
6668
- 'packages/mephisto-task/src/**'
6769
mephisto-worker-addons:
6870
- 'packages/mephisto-worker-addons/src/**'
71+
mephisto-core:
72+
- 'packages/mephisto-core/src/**'
73+
mephisto-addons:
74+
- 'packages/mephisto-addons/src/**'
6975
7076
# Learn more about this test here: https://github.com/facebookresearch/Mephisto/pull/881
7177
simple_static_task:
@@ -307,7 +313,7 @@ jobs:
307313
# Learn more about this test here: https://github.com/facebookresearch/Mephisto/pull/833
308314
static_react_task_with_worker_opinion:
309315
needs: changes
310-
if: ${{ (needs.changes.outputs.static_react_task_with_worker_opinion == 'true') || (needs.changes.outputs.mephisto-task == 'true') || (needs.changes.outputs.mephisto-task-addons == 'true') || (needs.changes.outputs.abstractions == 'true') || (needs.changes.outputs.data_model == 'true') || (needs.changes.outputs.operations == 'true') || (needs.changes.outputs.tools == 'true')}}
316+
if: ${{ (needs.changes.outputs.static_react_task_with_worker_opinion == 'true') || (needs.changes.outputs.mephisto-task == 'true') || (needs.changes.outputs.mephisto-addons == 'true') || (needs.changes.outputs.abstractions == 'true') || (needs.changes.outputs.data_model == 'true') || (needs.changes.outputs.operations == 'true') || (needs.changes.outputs.tools == 'true')}}
311317
runs-on: ubuntu-latest
312318
steps:
313319
- name: 🔀 Checking out repo

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ mephisto/server/blueprints/**/build/*
1313

1414
**/*.log
1515
**/build/*
16+
!**/packages/mephisto-core/build/*
17+
!**/packages/mephisto-addons/build/*
1618
**/_generated/*
1719
**/outputs/*
1820
mephisto/scripts/metrics/*

docs/web/docs/explanations/architecture_overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ This is a quick guide over file directories in Mephisto project. Note that some
5454
- `review_app` - builds React app for TaskReview, and launches a server to display TaskReview in a browser
5555
- `outputs` - exhaust produced by running the code (logs, database dumps, etc)
5656
- `packages` - npm packages (can be used locally, and some are also in npm repo)
57-
- `mephisto-task-addons` - package for FC React component
57+
- `mephisto-addons` - package with FC React component
5858
- `scripts` - command-line utilities for code upkeep
5959
- `test` - All tests (Back-end and Front-end, Unittests and Integration tests)

docs/web/docs/guides/how_to_use/form_composer/configuration/insertions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,22 +212,22 @@ During development of your form config, you can use a few available helper funct
212212

213213
Example of use:
214214

215-
1. Add `mephisto-task-addons` in webpack config
215+
1. Add `mephisto-addons` in webpack config
216216

217217
```js
218218
resolve: {
219219
alias: {
220220
...
221-
"mephisto-task-addons": path.resolve(
221+
"mephisto-addons": path.resolve(
222222
__dirname,
223-
"<relativePath>/packages/mephisto-task-addons"
223+
"<relativePath>/packages/mephisto-addons"
224224
),
225225
},
226226
}
227227
```
228228
2. Add import
229229
```js
230-
import { validateFieldValue } from "mephisto-task-addons";
230+
import { validateFieldValue } from "mephisto-addons";
231231
```
232232
3. Validate a value before assigning it to form field
233233
```js

docs/web/docs/guides/how_to_use/video_annotator/configuration/insertions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,22 +212,22 @@ During development of your annotator config, you can use a few available helper
212212

213213
Example of use:
214214

215-
1. Add `mephisto-task-addons` in webpack config
215+
1. Add `mephisto-addons` in webpack config
216216

217217
```js
218218
resolve: {
219219
alias: {
220220
...
221-
"mephisto-task-addons": path.resolve(
221+
"mephisto-addons": path.resolve(
222222
__dirname,
223-
"<relativePath>/packages/mephisto-task-addons"
223+
"<relativePath>/packages/mephisto-addons"
224224
),
225225
},
226226
}
227227
```
228228
2. Add import
229229
```js
230-
import { validateFieldValue } from "mephisto-task-addons";
230+
import { validateFieldValue } from "mephisto-addons";
231231
```
232232
3. Validate a value before assigning it to segment field
233233
```js

docs/web/docs/guides/how_to_use/worker_experience/mephisto-task-addons.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ sidebar_position: 1
1111

1212
## Overview
1313

14-
The `mephisto-task-addons` package provides:
14+
The `mephisto-addons` package provides:
1515
- `WorkerOpinion` widget: collect workers' feedback for each completed unit
1616

1717
## Usage
1818

19-
1. Add `mephisto-task-addons` library to your webpack config:
19+
1. Add `mephisto-addons` library to your webpack config:
2020
```js
2121
// Specifies location of your packages (e.g. `../../dir`)
2222
var PATH_TO_PACKAGES = "<path>"
@@ -26,19 +26,19 @@ module.exports = {
2626
resolve: {
2727
alias: {
2828
...
29-
"mephisto-task-addons": path.resolve(
29+
"mephisto-addons": path.resolve(
3030
__dirname,
31-
`${PATH_TO_PACKAGES}/packages/mephisto-task-addons`
31+
`${PATH_TO_PACKAGES}/packages/mephisto-addons`
3232
),
3333
}
3434
}
3535
};
3636
```
3737

38-
2. Import desired widgets from `mephisto-task-addons` in your code like so:
38+
2. Import desired widgets from `mephisto-addons` in your code like so:
3939

4040
```jsx
41-
import { WorkerOpinion } from "mephisto-task-addons";
41+
import { WorkerOpinion } from "mephisto-addons";
4242
...
4343
<WorkerOpinion
4444
maxTextLength={500}

docs/web/docs/guides/how_to_use/worker_experience/worker_opinion.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ WorkerOpinion widget currently may contain a set of textarea form fields, and a
1616

1717
## How to enable `WorkerOpinion`
1818

19-
1. Add `mephisto-task-addons` library to your webpack config
19+
1. Add `mephisto-addons` library to your webpack config
2020
2. Import `WorkerOpinion` component to your Task's React application code and define questions.
2121

2222
### 1. Webpack config
@@ -30,9 +30,9 @@ module.exports = {
3030
resolve: {
3131
alias: {
3232
...
33-
"mephisto-task-addons": path.resolve(
33+
"mephisto-addons": path.resolve(
3434
__dirname,
35-
`${PATH_TO_PACKAGES}/packages/mephisto-task-addons`
35+
`${PATH_TO_PACKAGES}/packages/mephisto-addons`
3636
),
3737
}
3838
}
@@ -42,7 +42,7 @@ module.exports = {
4242
### 2. `WorkerOpinion` component
4343

4444
```jsx
45-
import { WorkerOpinion } from "mephisto-task-addons";
45+
import { WorkerOpinion } from "mephisto-addons";
4646
...
4747
return(
4848
<div ...>
@@ -75,4 +75,4 @@ Here's how `WorkerOpinion` component looks like:
7575

7676
1. After completing each unit, workers can submit an opinion about the completed unit.
7777
2. **Once the task is shut down**, you can review all collected opinions for the task in TaskReview app.
78-
3. When reviewing units in TaskReview app, you will see an extra accordion section "Worker Opinion" if a worker submitted their opinion.
78+
3. When reviewing units in TaskReview app, you will see an extra accordion section "Worker Opinion" if a worker submitted their opinion.

examples/form_composer_demo/data/dynamic/insertions/custom_triggers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// NOTE: that `mephisto-task-addons` library must be set in webpack config as an alias.
2-
import { validateFieldValue } from "mephisto-task-addons";
1+
// NOTE: that `mephisto-addons` library must be set in webpack config as an alias.
2+
import { validateFieldValue } from "mephisto-addons";
33

44
export function onChangeCountry(
55
formData, // React state for the entire form

examples/form_composer_demo/webapp/src/app_dynamic.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
FormComposerBaseFrontend,
1111
LoadingScreen,
1212
} from "./components/core_components_dynamic.jsx";
13-
import { useMephistoTask, ErrorBoundary } from "mephisto-task-multipart";
13+
import { useMephistoTask, ErrorBoundary } from "mephisto-core";
1414

1515
/* ================= Application Components ================= */
1616

examples/form_composer_demo/webapp/src/app_simple.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* LICENSE file in the root directory of this source tree.
55
*/
66

7-
import { WorkerOpinion } from "mephisto-task-addons";
8-
import { ErrorBoundary, useMephistoTask } from "mephisto-task-multipart";
7+
import { WorkerOpinion } from "mephisto-addons";
8+
import { ErrorBoundary, useMephistoTask } from "mephisto-core";
99
import React, { useEffect, useState } from "react";
1010
import ReactDOM from "react-dom";
1111
import { BrowserRouter, Route, Routes } from "react-router-dom";

0 commit comments

Comments
 (0)