├── CODEOWNERS ├── .yarnrc.yml ├── .npmignore ├── .prettierignore ├── .stylelintignore ├── .eslintignore ├── src ├── public │ └── favicon.ico ├── __tests__ │ ├── tests │ │ ├── platform-utils │ │ │ ├── widgets │ │ │ │ ├── get-not-found.playwright.ts │ │ │ │ ├── getLoader.playwright.ts │ │ │ │ └── get.playwright.ts │ │ │ ├── context.playwright.ts │ │ │ ├── experience.playwright.ts │ │ │ ├── localStorage.playwright.ts │ │ │ ├── sessionStorage.playwright.ts │ │ │ ├── appLoadTime.playwright.ts │ │ │ └── eventbus.playwright.ts │ │ └── shell │ │ │ ├── kitchensink.playwright.ts │ │ │ ├── import-platform-props.playwright.ts │ │ │ ├── retry-critical-imports.playwright.ts │ │ │ ├── preload │ │ │ ├── libraries.playwright.ts │ │ │ ├── client-side-widgets-get.playwright.ts │ │ │ ├── fetch-wsk.playwright.ts │ │ │ ├── api-get.playwright.ts │ │ │ └── shell-and-plugin.playwright.ts │ │ │ ├── csp │ │ │ ├── csp-isolation.playwright.ts │ │ │ └── csp-runtime-override.playwright.ts │ │ │ ├── loading-spinner.playwright.ts │ │ │ ├── browser-not-supported.playwright.ts │ │ │ ├── page-not-found.playwright.ts │ │ │ ├── overrides │ │ │ ├── meta-tags.playwright.ts │ │ │ ├── sanitize-query-params.playwright.ts │ │ │ ├── runtime-config-overrides.playwright.ts │ │ │ ├── import-map-overrides.playwright.ts │ │ │ └── widget-url-overrides.playwright.ts │ │ │ ├── sessionIdCookie.playwright.ts │ │ │ ├── validate-headers-response.playwright.ts │ │ │ └── versions-contract-stablity.playwright.ts │ └── test-utils │ │ ├── setUserAgentForWidgetUrlOverride.ts │ │ ├── localStorage.ts │ │ ├── importMapOverridesUi.ts │ │ └── envs.ts ├── server │ ├── exceptions │ │ ├── errorCodes.ts │ │ ├── HttpException.ts │ │ └── APIException.ts │ ├── types │ │ └── APIErrorResponse.ts │ └── middlewares │ │ ├── error.middleware.ts │ │ └── error-template.ts ├── shell │ ├── components │ │ ├── Loader.tsx │ │ └── Error.tsx │ ├── index.ts │ ├── logger │ │ └── index.ts │ ├── types │ │ └── utils.ts │ ├── utils │ │ └── init-service-worker.ts │ └── main.tsx ├── lib │ └── router.ts ├── configs │ ├── env.ts │ ├── ecosystem-configs.ts │ ├── critical-libs.ts │ └── widgetConfigs.ts ├── csp-configs.ts ├── server.ts └── sw.ts ├── bundle ├── client │ ├── build.js │ ├── sw.js │ ├── shell-types.js │ ├── dev.js │ ├── utils.js │ └── prod.js └── server │ ├── build.js │ ├── dev.js │ └── common.js ├── .lintstagedrc.json ├── .github ├── actions │ └── common-ci │ │ ├── build │ │ └── action.yml │ │ ├── setup │ │ └── action.yml │ │ └── test │ │ └── action.yml └── workflows │ └── ci.yml ├── .stylelintrc.json ├── tsconfig-sw.json ├── tsconfig-shell.types.json ├── .gitignore ├── .changeset ├── config.json └── README.md ├── render.yaml ├── .prettierrc.json ├── tsconfig.server.json ├── app.json ├── .eslintrc.json ├── playwright.config.ts ├── CHANGELOG.md ├── tsconfig.json ├── LICENSE ├── package.json └── README.md /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @docusign/1fe 2 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | yarnPath: .yarn/releases/yarn-4.9.1.cjs 2 | nodeLinker: node-modules 3 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | src 2 | bundle 3 | .github 4 | .yarn 5 | playwright.config.ts 6 | test-results 7 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | .eslintcache -------------------------------------------------------------------------------- /.stylelintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | .eslintcache -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | .eslintcache 7 | bundle -------------------------------------------------------------------------------- /src/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docusign/1fe-starter-app/main/src/public/favicon.ico -------------------------------------------------------------------------------- /src/__tests__/tests/platform-utils/widgets/get-not-found.playwright.ts: -------------------------------------------------------------------------------- 1 | // TODO[1fe]: Add input box to test 2 | -------------------------------------------------------------------------------- /src/__tests__/tests/platform-utils/widgets/getLoader.playwright.ts: -------------------------------------------------------------------------------- 1 | // TODO[1fe]: Add skeleton loader test 2 | -------------------------------------------------------------------------------- /src/__tests__/tests/shell/kitchensink.playwright.ts: -------------------------------------------------------------------------------- 1 | // TODO[1fe]: Add back tests when bathtub is complete 2 | -------------------------------------------------------------------------------- /src/__tests__/tests/shell/import-platform-props.playwright.ts: -------------------------------------------------------------------------------- 1 | // TODO[1fe]: Add this test back when imports are added 2 | -------------------------------------------------------------------------------- /src/__tests__/tests/shell/retry-critical-imports.playwright.ts: -------------------------------------------------------------------------------- 1 | // TODO[1fe][post-mvp]: add back critical import test 2 | -------------------------------------------------------------------------------- /src/__tests__/tests/shell/preload/libraries.playwright.ts: -------------------------------------------------------------------------------- 1 | // TODO[1fe]: Add this test when we have decided cdn hosting for libraries 2 | -------------------------------------------------------------------------------- /src/__tests__/tests/shell/csp/csp-isolation.playwright.ts: -------------------------------------------------------------------------------- 1 | // TODO[1fe]: Add csp isolation test back after runtime configs are available 2 | -------------------------------------------------------------------------------- /src/__tests__/tests/shell/preload/client-side-widgets-get.playwright.ts: -------------------------------------------------------------------------------- 1 | // TODO[1fe]: Add this test when we have runtime configurations example. 2 | -------------------------------------------------------------------------------- /bundle/client/build.js: -------------------------------------------------------------------------------- 1 | const getProdConfig = require('./prod'); 2 | 3 | const buildConfig = getProdConfig({}); 4 | 5 | module.exports = buildConfig; 6 | -------------------------------------------------------------------------------- /src/server/exceptions/errorCodes.ts: -------------------------------------------------------------------------------- 1 | export enum ErrorCodes { 2 | // AUTH RELATED ERROR 3 | AuthorizationError = 100, 4 | UserInfoError = 101, 5 | } 6 | -------------------------------------------------------------------------------- /src/shell/components/Loader.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | export const Loader = () => ( 4 |
Starter App Loading...
5 | ); 6 | -------------------------------------------------------------------------------- /src/shell/index.ts: -------------------------------------------------------------------------------- 1 | export type { PlatformPropsWithCustomUtils } from './types/utils'; 2 | 3 | export {}; // Exporting something to ensure this file is treated as a module 4 | -------------------------------------------------------------------------------- /.lintstagedrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "*.{js,jsx,ts,tsx}": "eslint --fix --cache", 3 | "*.css": "stylelint --fix", 4 | "*.{js,jsx,ts,tsx,css,html,json,md,mdx}": "prettier --write" 5 | } 6 | -------------------------------------------------------------------------------- /.github/actions/common-ci/build/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Build' 2 | description: 'Build the application' 3 | 4 | runs: 5 | using: "composite" 6 | steps: 7 | - run: yarn build 8 | shell: bash 9 | -------------------------------------------------------------------------------- /.stylelintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["stylelint-config-standard", "stylelint-config-prettier"], 3 | "rules": { 4 | "selector-class-pattern": null, 5 | "keyframes-name-pattern": null 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/shell/logger/index.ts: -------------------------------------------------------------------------------- 1 | export const shellLogger = { 2 | log: (logObject: any) => { 3 | console.log(logObject); 4 | }, 5 | error: (logObject: any) => { 6 | console.error(logObject); 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /.github/actions/common-ci/setup/action.yml: -------------------------------------------------------------------------------- 1 | name: "Setup Environment" 2 | description: "Install dependencies" 3 | 4 | runs: 5 | using: "composite" 6 | steps: 7 | - run: yarn install --no-immutable 8 | shell: bash 9 | -------------------------------------------------------------------------------- /src/lib/router.ts: -------------------------------------------------------------------------------- 1 | import express from 'express'; 2 | 3 | const router = express.Router(); 4 | 5 | router.get('/hello', async (_req, res) => { 6 | res.status(200).json({ message: 'Hello World!' }); 7 | }); 8 | 9 | export default router; 10 | -------------------------------------------------------------------------------- /tsconfig-sw.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "rootDir": "src", 4 | "composite": true, 5 | "target": "es2020", 6 | "module": "es2020", 7 | "moduleResolution": "Node", 8 | "outDir": "dist", 9 | "lib": ["WebWorker", "ES2022"] 10 | }, 11 | "include": ["src/sw.ts"] 12 | } 13 | -------------------------------------------------------------------------------- /src/server/exceptions/HttpException.ts: -------------------------------------------------------------------------------- 1 | export class HttpException extends Error { 2 | public status: number; 3 | 4 | public message: string; 5 | 6 | constructor(status: number, message: string) { 7 | super(message); 8 | this.status = status; 9 | this.message = message; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tsconfig-shell.types.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": true, 4 | "outDir": "dist", 5 | "rootDir": "src", 6 | "strict": true, 7 | "target": "ESNext", 8 | "module": "ESNext", 9 | "moduleResolution": "Node" 10 | }, 11 | "include": ["src/shell/index.ts"] 12 | } 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | .eslintcache 7 | # Yarn 8 | .pnp.* 9 | .yarn/* 10 | !.yarn/patches 11 | !.yarn/plugins 12 | !.yarn/releases 13 | !.yarn/sdks 14 | !.yarn/versions 15 | 16 | # Playwright 17 | test-results/ 18 | 19 | # local development 20 | .env 21 | .npmrc 22 | -------------------------------------------------------------------------------- /bundle/server/build.js: -------------------------------------------------------------------------------- 1 | const esbuild = require('esbuild'); 2 | const { commonEsbuild } = require('./common'); 3 | // const { nodeConsoleLogger } = require('@1ds/helpers/node'); 4 | 5 | (async () => { 6 | const result = await esbuild.build(commonEsbuild); 7 | console.log(`[SERVER][BUILD] ${JSON.stringify(result)}`); 8 | })(); 9 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json", 3 | "changelog": "@changesets/cli/changelog", 4 | "commit": false, 5 | "fixed": [], 6 | "linked": [], 7 | "access": "restricted", 8 | "baseBranch": "main", 9 | "updateInternalDependencies": "patch", 10 | "ignore": [] 11 | } 12 | -------------------------------------------------------------------------------- /render.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | - type: web 3 | name: my-1fe-app 4 | env: node 5 | buildCommand: yarn install && yarn build 6 | startCommand: yarn start 7 | plan: free # Or 'starter', 'standard', etc. 8 | envVars: 9 | - key: NODE_ENV 10 | value: production 11 | - key: BUILD_NUMBER 12 | sync: false 13 | -------------------------------------------------------------------------------- /.github/actions/common-ci/test/action.yml: -------------------------------------------------------------------------------- 1 | name: "Test" 2 | description: "Run playwright tests" 3 | 4 | runs: 5 | using: "composite" 6 | steps: 7 | - run: yarn playwright install --with-deps 8 | shell: bash 9 | 10 | - run: yarn test:playwright 11 | shell: bash 12 | env: 13 | AZURE_APPCONFIG_CONNECTION_STRING: "" 14 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "all", 3 | "tabWidth": 2, 4 | "semi": true, 5 | "singleQuote": true, 6 | "jsxSingleQuote": true, 7 | "endOfLine": "lf", 8 | "printWidth": 80, 9 | "overrides": [ 10 | { 11 | "files": ["*.yaml", "*.yml"], 12 | "options": { 13 | "singleQuote": false 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /src/shell/types/utils.ts: -------------------------------------------------------------------------------- 1 | import { PlatformPropsType } from '@1fe/shell'; 2 | 3 | export type CustomExampleUtils = { 4 | initializeLogger: (widgetId: string) => { 5 | logger: { 6 | log: (message: string) => void; 7 | error: (message: string) => void; 8 | }; 9 | }; 10 | }; 11 | 12 | export type PlatformPropsWithCustomUtils = PlatformPropsType37 | You’re using a version that isn’t supported, update to 38 | the latest version to continue. 39 |
40 | <% } else { %> 41 |Make sure your connection is stable and try again
43 | 46 | <% } %> 47 |