Skip to content

File tree

5 files changed

+100
-158
lines changed

5 files changed

+100
-158
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Docusign Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 78 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,97 @@
1-
# 1DS Playground
1+
# 1fe Playground
22

3-
A development environment for testing and validating widgets within the 1FE ecosystem without requiring the full shell or host plugin setup.
3+
A development sandbox for testing and validating widgets within the 1fe ecosystem without requiring the full shell or host plugin setup.
44

5-
## Getting Started
5+
## Prerequisites
66

7-
### Prerequisites
7+
- **Node.js** `>= 22`
8+
- **Yarn** (package manager)
89

9-
- Node.js 22.x (or use the workflow override for different versions)
10-
- npm or yarn
10+
## Getting Started
1111

12-
### Installation
12+
### Development Setup
1313

1414
```bash
1515
# Clone the repository
1616
git clone <repository-url>
1717
cd 1fe-playground
1818

1919
# Install dependencies
20-
yarn
20+
yarn install
2121

2222
# Start the development server
2323
yarn dev
2424
```
2525

26+
## Development Commands
27+
28+
```bash
29+
# Start development server
30+
yarn dev
31+
32+
# Build widget for testing
33+
yarn build:widget
34+
35+
# Run unit tests
36+
yarn test
37+
38+
# Run E2E tests
39+
yarn test:e2e
40+
41+
# Run E2E tests with UI
42+
yarn test:e2e:ui
43+
44+
# Type checking
45+
yarn type:check
46+
47+
# Linting
48+
yarn lint
49+
50+
# Format code
51+
yarn format
52+
```
53+
54+
## Testing
55+
56+
### Unit Testing
57+
58+
- Uses Jest with React Testing Library
59+
- Run tests with `yarn test`
60+
- Test files located in `src/__tests__/`
61+
62+
### E2E Testing
63+
64+
- Uses Playwright for end-to-end testing
65+
- Run tests with `yarn test:e2e`
66+
- Test files located in `tests/`
67+
68+
## Contributing
69+
70+
### Development Workflow
71+
72+
1. Fork the repository
73+
2. Create a feature branch (`git checkout -b feature/your-feature`)
74+
3. Make your changes
75+
4. Run tests (`yarn test` and `yarn test:e2e`)
76+
5. Ensure linting passes (`yarn lint`)
77+
6. Commit your changes (`git commit -m 'Add feature'`)
78+
7. Push to your branch (`git push origin feature/your-feature`)
79+
8. Open a Pull Request
80+
81+
## Troubleshooting
82+
83+
### Common Issues
84+
85+
- **Build failures**: Ensure Node.js version is >= 22 and all dependencies are installed
86+
- **Test failures**: Check that mock services are properly configured
87+
- **TypeScript errors**: Run `yarn type:check` to see detailed type errors
88+
89+
## Getting Help
90+
91+
- **[1fe Documentation](https://1fe.com/getting-started/installation/)** - Complete platform documentation
92+
- **[GitHub Issues](https://github.com/docusign/1fe/issues)** - Report bugs or request features
93+
- **[GitHub Discussions](https://github.com/docusign/1fe/discussions)** - Ask questions and share ideas
94+
2695
## License
2796

28-
This project is licensed under the MIT License.
97+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@1fe/playground",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"license": "UNLICENSED",
55
"description": "1fe playground plugin",
66
"author": "",

src/services/widget.ts

Lines changed: 0 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1 @@
1-
// const WidgetBundle = WidgetEnvironmentActivity.extend({
2-
// bundleUrl: z.string().url().optional(),
3-
// configUrl: z.string().url(),
4-
// });
5-
6-
// type WidgetBundle = z.infer<typeof WidgetBundle>;
7-
8-
// export const Widget = WidgetActivity.extend({
9-
// widgetId: z.string(),
10-
// lastModified: z.object({
11-
// integration: WidgetBundle.optional(),
12-
// stage: WidgetBundle.optional(),
13-
// demo: WidgetBundle.optional(),
14-
// production: WidgetBundle.optional(),
15-
// }),
16-
// widgetDependencies: z.array(z.string()),
17-
// pinnnedWidgetDependencies: z.array(z.string()),
18-
// variants: z.array(z.string()),
19-
// auth: PluginAuth.optional(),
20-
// route: z.string().optional(),
21-
// isPlugin: z.boolean().default(false),
22-
// });
23-
24-
// export type Widget = z.infer<typeof Widget>;
25-
26-
// const getConfigUrl = (widgetId: string, environment: Environment) => {
27-
// const normalizedWidgetId = widgetId.replace('/', '-');
28-
// return `https://cdn.com`;
29-
// };
30-
31-
// const envToCheck = ['integration', 'stage', 'demo', 'production'] as const;
32-
33-
// export const getWidgets = async (): Promise<Widget[]> => {
34-
// try {
35-
// const [versions, activity] = await Promise.all([
36-
// downloadWidgetVersions(),
37-
// downloadWidgetActivity(),
38-
// ]);
39-
40-
// const versionByWidgetId = new Map(
41-
// versions.configs.widgetConfig.map((c) => {
42-
// return [c.widgetId, c];
43-
// }),
44-
// );
45-
46-
// const widgets = Object.keys(activity)
47-
// .map((widgetId) => {
48-
// const widgetActivity = activity[widgetId];
49-
// const widgetVersion = versionByWidgetId.get(widgetId);
50-
51-
// if (!widgetVersion) {
52-
// console.error(`No version found for widget ${widgetId}`);
53-
// return;
54-
// }
55-
56-
// const merged = {
57-
// ...widgetActivity,
58-
// widgetId: widgetId,
59-
// widgetDependencies:
60-
// widgetVersion.runtime.dependsOn?.widgets?.map((w) => w.widgetId) ??
61-
// [],
62-
// pinnnedWidgetDependencies:
63-
// widgetVersion.runtime.dependsOn?.pinnedWidgets?.map(
64-
// (w) => `${w.widgetId}@${w.version}`,
65-
// ) ?? [],
66-
// variants: [],
67-
// auth: widgetVersion.plugin?.auth,
68-
// route: widgetVersion.plugin?.route,
69-
// isPlugin: widgetVersion.plugin != null,
70-
// } as Widget;
71-
72-
// envToCheck.forEach((env) => {
73-
// if (merged.lastModified?.[env]) {
74-
// merged.lastModified[env] = {
75-
// ...merged.lastModified[env],
76-
// bundleUrl: merged.lastModified[env]?.widgetVersion
77-
// ? getWidgetCdnUrl(
78-
// widgetId,
79-
// merged.lastModified[env]?.widgetVersion,
80-
// '1fe-bundle',
81-
// env,
82-
// )
83-
// : undefined,
84-
// configUrl: getConfigUrl(widgetId, env),
85-
// };
86-
// }
87-
// });
88-
89-
// return Widget.parse(merged);
90-
// })
91-
// .filter(Boolean) as Widget[];
92-
93-
// console.log(`loaded ${widgets.length} widgets`);
94-
// return widgets;
95-
// } catch (err) {
96-
// console.error({
97-
// message: 'Failed to load widgets',
98-
// err,
99-
// });
100-
101-
// throw new Error('Failed to load widgets');
102-
// }
103-
// };
104-
1051
export type Widget = Record<string, any>;

src/services/widgetActivity.ts

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)