-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
129 changed files
with
5,605 additions
and
1,082 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"extends": ["plugin:playwright/recommended", "../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["src/**/*.{ts,js,tsx,jsx}"], | ||
"rules": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { defineConfig, devices } from '@playwright/test'; | ||
import { nxE2EPreset } from '@nx/playwright/preset'; | ||
|
||
import { workspaceRoot } from '@nx/devkit'; | ||
|
||
// For CI, you may want to set BASE_URL to the deployed application. | ||
const baseURL = process.env['BASE_URL'] || 'http://localhost:4200'; | ||
|
||
/** | ||
* Read environment variables from file. | ||
* https://github.com/motdotla/dotenv | ||
*/ | ||
// require('dotenv').config(); | ||
|
||
/** | ||
* See https://playwright.dev/docs/test-configuration. | ||
*/ | ||
export default defineConfig({ | ||
...nxE2EPreset(__filename, { testDir: './src' }), | ||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ | ||
use: { | ||
baseURL, | ||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ | ||
trace: 'on-first-retry', | ||
}, | ||
/* Run your local dev server before starting the tests */ | ||
webServer: { | ||
command: 'yarn nx serve jetstream-web-extension', | ||
url: 'http://localhost:4200', | ||
reuseExistingServer: !process.env.CI, | ||
cwd: workspaceRoot, | ||
}, | ||
projects: [ | ||
{ | ||
name: 'chromium', | ||
use: { ...devices['Desktop Chrome'] }, | ||
}, | ||
|
||
{ | ||
name: 'firefox', | ||
use: { ...devices['Desktop Firefox'] }, | ||
}, | ||
|
||
{ | ||
name: 'webkit', | ||
use: { ...devices['Desktop Safari'] }, | ||
}, | ||
|
||
// Uncomment for mobile browsers support | ||
/* { | ||
name: 'Mobile Chrome', | ||
use: { ...devices['Pixel 5'] }, | ||
}, | ||
{ | ||
name: 'Mobile Safari', | ||
use: { ...devices['iPhone 12'] }, | ||
}, */ | ||
|
||
// Uncomment for branded browsers | ||
/* { | ||
name: 'Microsoft Edge', | ||
use: { ...devices['Desktop Edge'], channel: 'msedge' }, | ||
}, | ||
{ | ||
name: 'Google Chrome', | ||
use: { ...devices['Desktop Chrome'], channel: 'chrome' }, | ||
} */ | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "jetstream-web-extension-e2e", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"projectType": "application", | ||
"sourceRoot": "apps/jetstream-web-extension-e2e/src", | ||
"implicitDependencies": ["jetstream-web-extension"], | ||
"targets": { | ||
"e2e": { | ||
"executor": "@nx/playwright:playwright", | ||
"outputs": ["{workspaceRoot}/dist/.playwright/apps/jetstream-web-extension-e2e"], | ||
"options": { | ||
"config": "apps/jetstream-web-extension-e2e/playwright.config.ts" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('has title', async ({ page }) => { | ||
await page.goto('/'); | ||
|
||
// Expect h1 to contain a substring. | ||
expect(await page.locator('h1').innerText()).toContain('Welcome'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"outDir": "../../dist/out-tsc", | ||
"module": "commonjs", | ||
"sourceMap": false | ||
}, | ||
"include": [ | ||
"**/*.ts", | ||
"**/*.js", | ||
"playwright.config.ts", | ||
"src/**/*.spec.ts", | ||
"src/**/*.spec.js", | ||
"src/**/*.test.ts", | ||
"src/**/*.test.js", | ||
"src/**/*.d.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@nx/react/babel", | ||
{ | ||
"runtime": "automatic", | ||
"importSource": "@emotion/react" | ||
} | ||
] | ||
], | ||
"plugins": ["@emotion/babel-plugin"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"extends": ["plugin:@nx/react", "../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": { | ||
"react-hooks/exhaustive-deps": [ | ||
"warn", | ||
{ | ||
"additionalHooks": "(useRecoilCallback|useNonInitialEffect)" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
} | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
apps/jetstream-web-extension/environments/environment.prod.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export const environment = { | ||
name: 'Jetstream', | ||
production: true, | ||
rollbarClientAccessToken: process.env.NX_PUBLIC_ROLLBAR_KEY, | ||
amplitudeToken: process.env.NX_PUBLIC_AMPLITUDE_KEY, | ||
authAudience: process.env.NX_PUBLIC_AUTH_AUDIENCE, | ||
MODE: process.env.MODE, | ||
BASE_URL: process.env.BASE_URL, | ||
PROD: process.env.PROD, | ||
DEV: process.env.DEV, | ||
SSR: process.env.SSR, | ||
}; |
12 changes: 12 additions & 0 deletions
12
apps/jetstream-web-extension/environments/environment.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export const environment = { | ||
name: 'JetstreamTest', | ||
production: true, | ||
rollbarClientAccessToken: process.env.NX_PUBLIC_ROLLBAR_KEY, | ||
amplitudeToken: process.env.NX_PUBLIC_AMPLITUDE_KEY, | ||
authAudience: process.env.NX_PUBLIC_AUTH_AUDIENCE, | ||
// MODE: process.env.MODE, | ||
// BASE_URL: process.env.BASE_URL, | ||
// PROD: process.env.PROD, | ||
// DEV: process.env.DEV, | ||
// SSR: process.env.SSR, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// This file can be replaced during build by using the `fileReplacements` array. | ||
// When building for production, this file is replaced with `environment.prod.ts`. | ||
|
||
export const environment = { | ||
name: 'JetstreamDev', | ||
production: false, | ||
rollbarClientAccessToken: process.env.NX_PUBLIC_ROLLBAR_KEY, | ||
amplitudeToken: process.env.NX_PUBLIC_AMPLITUDE_KEY, | ||
authAudience: process.env.NX_PUBLIC_AUTH_AUDIENCE, | ||
MODE: process.env.MODE, | ||
BASE_URL: process.env.BASE_URL, | ||
PROD: process.env.PROD, | ||
DEV: process.env.DEV, | ||
SSR: process.env.SSR, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"name": "jetstream-web-extension", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "apps/jetstream-web-extension/src", | ||
"projectType": "application", | ||
"tags": [], | ||
"targets": { | ||
"build": { | ||
"executor": "@nx/webpack:webpack", | ||
"outputs": ["{options.outputPath}"], | ||
"defaultConfiguration": "production", | ||
"options": { | ||
"compiler": "babel", | ||
"outputPath": "dist/apps/jetstream-web-extension", | ||
"baseHref": "/", | ||
"tsConfig": "apps/jetstream-web-extension/tsconfig.app.json", | ||
"assets": ["apps/jetstream-web-extension/src/assets"], | ||
"styles": [], | ||
"scripts": [], | ||
"webpackConfig": "apps/jetstream-web-extension/webpack.config.js" | ||
}, | ||
"configurations": { | ||
"development": { | ||
"extractLicenses": false, | ||
"optimization": false, | ||
"sourceMap": true, | ||
"vendorChunk": true | ||
}, | ||
"production": { | ||
"fileReplacements": [], | ||
"optimization": false, | ||
"outputHashing": "none", | ||
"sourceMap": true, | ||
"namedChunks": false, | ||
"extractLicenses": false, | ||
"vendorChunk": false | ||
} | ||
} | ||
}, | ||
"serve": { | ||
"executor": "@nx/webpack:dev-server", | ||
"defaultConfiguration": "development", | ||
"options": { | ||
"buildTarget": "jetstream-web-extension:build", | ||
"hmr": true | ||
}, | ||
"configurations": { | ||
"development": { | ||
"buildTarget": "jetstream-web-extension:build:development" | ||
}, | ||
"production": { | ||
"buildTarget": "jetstream-web-extension:build:production", | ||
"hmr": false | ||
} | ||
} | ||
}, | ||
"test": { | ||
"executor": "@nx/jest:jest", | ||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"], | ||
"options": { | ||
"jestConfig": "apps/jetstream-web-extension/jest.config.ts" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.