chore(build): initial nx implementation

Because:

* We want to introduce nx to the repository

This commit:

* Adds nx with working builds

Closes: FXA-7341

Co-authored-by: dschom <dschomburg@mozilla.com>
This commit is contained in:
Julian Poyourow 2023-04-27 09:56:10 -07:00
Родитель d18653124f
Коммит 565ebb89c9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: EA0570ABC73D47D3
50 изменённых файлов: 2468 добавлений и 268 удалений

Просмотреть файл

@ -297,13 +297,13 @@ commands:
steps:
- run:
name: Linting
command: yarn workspaces foreach -piv --exclude=functional-tests --exclude=fxa-payments-server run lint
command: npx nx affected --base=main --head=$CIRCLE_SHA1 --parallel=3 -t lint
compile:
steps:
- run:
name: Compiling TypeScript
command: yarn workspaces foreach --topological-dev --verbose run compile
command: npx nx affected --base=main --head=$CIRCLE_SHA1 --parallel=1 -t compile
report-coverage:
# Not currently used. But should be soon once coverage reports are fixed up.
@ -350,7 +350,10 @@ commands:
steps:
- run:
name: Build Common Typescript Packages
command: ./.circleci/build-ts-packages.sh
command: npx nx run-many --parallel=1 -t build --projects=fxa-shared,fxa-auth-client,fxa-react
- run:
name: Compile Changed Typescript Packages
command: npx nx affected --base=main --head=$CIRCLE_SHA1 --parallel=3 -t compile
save-workspace:
steps:
@ -562,9 +565,11 @@ jobs:
steps:
- git-checkout
- restore-workspace
- run-tests:
test_name: Unit Test
list: unit-test.list
- run:
name: Run unit tests
command: npx nx affected --base=main --head=$CIRCLE_SHA1 --parallel=1 -t test-unit
environment:
NODE_ENV: test
# Runs integration tests suites across packages with changes. Integration tests can take
# longer to run, so this job supports splitting.

Просмотреть файл

@ -1,17 +0,0 @@
{
"extends": ["plugin:fxa/recommended"],
"plugins": ["fxa"],
"parserOptions": {
"ecmaVersion": "2020"
},
"rules": {
"require-atomic-updates": "off",
"space-unary-ops": "off",
"no-useless-escape": "off"
},
"ignorePatterns": [
"dist",
"node_modules",
"pm2.config.js"
]
}

17
.eslintrc.json Normal file
Просмотреть файл

@ -0,0 +1,17 @@
{
"rules": {
"require-atomic-updates": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", {"vars": "all", "args": "none"}],
"no-redeclare": "off",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-redeclare": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-function": "off"
},
"extends": ["plugin:@typescript-eslint/recommended", "prettier"],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"root": true
}

4
.prettierrc Normal file
Просмотреть файл

@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "es5"
}

Просмотреть файл

@ -1,23 +0,0 @@
{
"compilerOptions": {
"allowJs": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"useUnknownInCatchVariables": false,
"baseUrl": "../packages",
"typeRoots": [
"../types",
"../node_modules/@types",
"../packages/*/node_modules/@types"
]
},
"exclude": ["../node_modules", "../packages/*/node_modules"]
}

Просмотреть файл

@ -1,9 +0,0 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"target": "ES2016",
"module": "esnext",
"jsx": "react",
"sourceMap": true
}
}

Просмотреть файл

@ -1,10 +0,0 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"target": "ES2019",
"module": "commonjs",
"incremental": true,
"inlineSources": true,
"inlineSourceMap": true
}
}

5
jest.config.ts Normal file
Просмотреть файл

@ -0,0 +1,5 @@
import { getJestProjects } from '@nrwl/jest';
export default {
projects: getJestProjects(),
};

3
jest.preset.js Normal file
Просмотреть файл

@ -0,0 +1,3 @@
const nxPreset = require('@nrwl/jest/preset').default;
module.exports = { ...nxPreset }

42
nx.json Normal file
Просмотреть файл

@ -0,0 +1,42 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"npmScope": "fxa",
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "lint", "test", "test-unit", "test-integration", "e2e"]
}
}
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
},
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
},
"test": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
}
},
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"production": [
"default",
"!{projectRoot}/.eslintrc.json",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s"
],
"sharedGlobals": []
},
"cli": {
"packageManager": "yarn"
},
"workspaceLayout": {
"appsDir": "apps",
"libsDir": "libs"
}
}

Просмотреть файл

@ -45,7 +45,8 @@
"pm2": "^5.3.0",
"prettier": "^2.3.1",
"replace-in-file": "^6.3.5",
"semver": "^7.3.5"
"semver": "^7.3.5",
"tslib": "^2.5.0"
},
"engines": {
"node": "^18.14.2"
@ -79,17 +80,30 @@
]
},
"devDependencies": {
"@nrwl/jest": "^15.9.2",
"@nrwl/js": "^15.9.2",
"@nrwl/workspace": "^15.9.2",
"@types/jest": "^29.5.1",
"@types/node": "^18.16.1",
"@typescript-eslint/eslint-plugin": "^5.59.1",
"@typescript-eslint/parser": "^5.59.1",
"eslint": "^7.32.0",
"eslint-plugin-fxa": "workspace:*",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-react": "^7.32.2",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"json": "^11.0.0",
"mocha-junit-reporter": "^2.2.0",
"mocha-multi": "^1.1.7",
"nx": "^15.9.2",
"postcss": "^8.4.14",
"stylelint": "^15.6.2",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-recommended-scss": "^11.0.0"
"stylelint-config-recommended-scss": "^11.0.0",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
},
"workspaces": [
"packages/*"

Просмотреть файл

@ -76,6 +76,7 @@
"chance": "^1.1.8",
"eslint": "^7.32.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-react": "^7.32.2",
"fxa-shared": "workspace:*",

Просмотреть файл

@ -1,7 +1,8 @@
{
"extends": "../../../_dev/tsconfig.node.json",
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "../build",
"module": "commonjs",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"types": ["jest", "mozlog"]

Просмотреть файл

@ -1,7 +1,6 @@
{
"extends": "../../_dev/tsconfig.browser.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"noEmit": true,
"types": [
"jest",
"node",
@ -12,10 +11,8 @@
"dom.iterable",
"esnext"
],
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"isolatedModules": true,
"jsx": "react-jsx"
"noEmit": true
},
"include": [
"src"

Просмотреть файл

@ -4,15 +4,14 @@
"description": "FxA GraphQL Admin Server",
"scripts": {
"prebuild": "rimraf dist",
"build": "yarn prebuild && yarn nest build && yarn copy-src && yarn copy-config",
"copy-src": "mv ./dist/src/* ./dist/.",
"copy-config": "cp ./src/config/*.json ./dist/config",
"copy-config": "cp ./src/config/*.json ./dist/packages/fxa-admin-server/src/config",
"build": "yarn prebuild && yarn nest build && yarn copy-config",
"compile": "tsc --noEmit",
"lint": "eslint .",
"audit": "npm audit --json | audit-filter --nsp-config=.nsprc --audit=-",
"start": "yarn build && pm2 start pm2.config.js",
"stop": "pm2 stop pm2.config.js",
"start-prod": "node dist/main",
"start-prod": "node dist/packages/fxa-graphql-api/src/main",
"restart": "pm2 restart pm2.config.js",
"delete": "pm2 delete pm2.config.js",
"test": "yarn gen-keys && yarn test-default && yarn test-e2e ",
@ -79,6 +78,8 @@
"esbuild": "^0.17.15",
"esbuild-register": "^3.2.0",
"eslint": "^8.18.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-prettier": "^4.2.1",
"jest": "29.3.1",
"pm2": "^5.3.0",
"supertest": "^6.3.0",

Просмотреть файл

@ -8,7 +8,8 @@ const PATH = process.env.PATH.split(':')
const nest = require.resolve('@nestjs/cli/bin/nest.js');
const getDevScript = () => `${nest} start --debug=9150 --watch`;
const getProdScript = () => 'rm -rf dist && yarn build && node dist/main.js';
const getProdScript = () =>
'rm -rf dist && yarn build && node dist/packages/fxa-admin-server/src/main.js';
const script =
process.env.CI === 'true' || process.env.NODE_ENV === 'production'
? getProdScript()

Просмотреть файл

@ -1,7 +1,9 @@
{
"extends": "../../_dev/tsconfig.node.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"outDir": "./dist",
"module": "commonjs",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noEmitHelpers": true,

Просмотреть файл

@ -2,14 +2,14 @@
"name": "fxa-auth-client",
"version": "0.0.0",
"description": "",
"main": "dist/server/server.js",
"main": "dist/server/packages/fxa-auth-client/server.js",
"exports": {
".": "./dist/server/server.js",
"./browser": "./dist/browser/browser.js",
"./lib/crypto": "./dist/server/lib/crypto.js",
"./lib/hawk": "./dist/server/lib/hawk.js",
"./lib/recoveryKey": "./dist/server/lib/recoveryKey.js",
"./lib/utils": "./dist/server/lib/utils.js",
".": "./dist/server/packages/fxa-auth-client/server.js",
"./browser": "./dist/browser/packages/fxa-auth-client/browser.js",
"./lib/crypto": "./dist/server/packages/fxa-auth-client/lib/crypto.js",
"./lib/hawk": "./dist/server/packages/fxa-auth-client/lib/hawk.js",
"./lib/recoveryKey": "./dist/server/packages/fxa-auth-client/lib/recoveryKey.js",
"./lib/utils": "./dist/server/packages/fxa-auth-client/lib/utils.js",
"./lib/": "./lib/"
},
"scripts": {
@ -42,6 +42,7 @@
"esbuild": "^0.17.15",
"esbuild-register": "^3.2.0",
"eslint": "^8.38.0",
"eslint-config-react-app": "^7.0.1",
"fast-text-encoding": "^1.0.4",
"mocha": "^10.0.0",
"prettier": "^2.8.7",

Просмотреть файл

@ -1,5 +1,5 @@
{
"extends": "../../_dev/tsconfig.browser.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./dist/browser",

Просмотреть файл

@ -1,6 +1,7 @@
{
"extends": "../../_dev/tsconfig.node.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"composite": true,
"outDir": "./dist/server",
"types": ["mocha", "./lib/types"]

Просмотреть файл

@ -9,7 +9,7 @@
"test": "test"
},
"scripts": {
"build": "yarn merge-ftl && yarn emails-scss && tsc --build && cp -R config public lib scripts dist/fxa-auth-server",
"build": "yarn merge-ftl && yarn emails-scss && tsc --build && cp -R config public lib scripts dist/packages/fxa-auth-server",
"clean": "git clean -fXd",
"compile": "tsc --noEmit",
"create-mock-iap": "NODE_ENV=dev FIRESTORE_EMULATOR_HOST=localhost:9090 node -r esbuild-register ./scripts/create-mock-iap-subscriptions.ts",

Просмотреть файл

@ -1,14 +1,14 @@
{
"extends": "../../_dev/tsconfig.node.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"experimentalDecorators": true,
"outDir": "./dist",
"module": "commonjs",
"allowJs": true,
// Permit, but do not report errors for JS files
// TODO: Remove after transition to TS is complete
"checkJs": false,
"types": ["accept-language", "mocha", "mozlog", "node"]
"outDir": "./dist",
"types": ["accept-language", "mocha", "mozlog", "node", "fxa-geodb"],
},
"references": [{ "path": "../fxa-shared" }],
"include": [
"bin/*",
"scripts/*.ts",

Просмотреть файл

@ -1,15 +1,27 @@
{
"extends": ["plugin:fxa/client"],
"extends": ["plugin:fxa/client", "plugin:fxa/recommended"],
"plugins": ["fxa"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": "2020",
"sourceType": "module"
},
"env": {
"mocha": true
},
"rules": {
"require-atomic-updates": "off",
"space-unary-ops": "off",
"no-useless-escape": "off",
"no-console": "off",
"camelCase": "off",
"strict": "off",
"no-useless-escape": "off",
"handle-callback-err": "off"
}
},
"ignorePatterns": [
"dist",
"node_modules",
"pm2.config.js"
],
"root": true
}

Просмотреть файл

@ -1,7 +1,6 @@
{
"extends": "../../_dev/tsconfig.browser.json",
"extends": "../../tsconfig.base.json",
"include": ["**/*.ts"],
"exclude": ["node_modules", "**/*.spec.ts"],
"compilerOptions": {
"outDir": "./.tscompiled/",
"rootDirs": ["./app/scripts/", "./server/lib/routes/react-app"],

Просмотреть файл

@ -1,15 +1,28 @@
{
"extends": ["plugin:fxa/client"],
"extends": ["plugin:fxa/client", "plugin:fxa/recommended"],
"plugins": ["fxa"],
"parserOptions": {
"ecmaVersion": "2020",
"sourceType": "module",
"ecmaFeatures": {
"globalReturn": true
},
"sourceType": "module"
}
},
"env": {
"mocha": true
},
"rules": {
"require-atomic-updates": "off",
"space-unary-ops": "off",
"no-useless-escape": "off",
"strict": "off",
"handle-callback-err": "off",
"camelcase": "off"
}
},
"ignorePatterns": [
"dist",
"node_modules",
"pm2.config.js"
],
"root": true
}

Просмотреть файл

@ -19,6 +19,7 @@
},
"devDependencies": {
"@types/eslint": "^8",
"eslint": "^8.38.0"
"eslint": "^8.38.0",
"eslint-config-react-app": "^7.0.1"
}
}

Просмотреть файл

@ -9,8 +9,8 @@
"compile": "tsc --noEmit",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "../../_scripts/check-url.sh localhost:9000/__heartbeat__ && pm2 start pm2.config.js",
"start-prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"start-prod": "node dist/packages/fxa-event-broker/src/main",
"lint": "eslint {src,test}/**/*.ts",
"test": "jest",
"test-unit": "JEST_JUNIT_OUTPUT_FILE=../../artifacts/tests/$npm_package_name/jest-unit.xml jest --coverage --forceExit --detectOpenHandles --logHeapUsage -t '^(?!.*?#integration).*' --ci --reporters=default --reporters=jest-junit",
"test-integration": "JEST_JUNIT_OUTPUT_FILE=../../artifacts/tests/$npm_package_name/jest-integration.xml jest --coverage --logHeapUsage -t '#integration' --ci --reporters=default --reporters=jest-junit ",
@ -95,6 +95,7 @@
"esbuild-register": "^3.2.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.7.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-import": "^2.27.5",
"factory-bot-ts": "^0.1.5",
"jest": "27.5.1",

Просмотреть файл

@ -1,7 +1,8 @@
{
"extends": "../../_dev/tsconfig.node.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist",
"module": "commonjs",
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,

Просмотреть файл

@ -52,6 +52,7 @@
"convict": "^6.2.4",
"convict-format-with-moment": "^6.2.0",
"convict-format-with-validator": "^6.2.0",
"eslint-config-react-app": "^7.0.1",
"express": "^4.17.3",
"fxa-auth-client": "workspace:*",
"fxa-auth-server": "workspace:*",

Просмотреть файл

@ -8,7 +8,8 @@ const PATH = process.env.PATH.split(':')
const nest = require.resolve('@nestjs/cli/bin/nest.js');
const getNestScript = () => `${nest} start`;
const getProdScript = () => 'rm -rf dist && yarn build && node dist/main.js';
const getProdScript = () =>
'rm -rf dist && yarn build && node dist/packages/fxa-graphql-api/src/main.js';
const script =
process.env.CI === 'true' || process.env.NODE_ENV === 'production'
? getProdScript()

Просмотреть файл

@ -1,11 +1,13 @@
{
"extends": "../../_dev/tsconfig.node.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"allowJs": true,
"outDir": "./dist",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noEmitHelpers": true,
"importHelpers": true,
"module": "commonjs",
"types": ["../fxa-auth-client/lib/types", "mozlog", "jest"]
},
"include": ["src"]

Просмотреть файл

@ -9,8 +9,6 @@
"clean": "git clean -fXd",
"l10n-prime": "yarn l10n:prime fxa-payments-server",
"l10n-bundle": "yarn l10n:bundle fxa-payments-server react,payments",
"lint": "yarn lint-eslint",
"lint-eslint": "eslint . .storybook",
"audit": "npm audit --json | audit-filter --nsp-config=.nsprc --audit=-",
"start": "tsc --build ../fxa-react && yarn build-css && yarn merge-ftl && pm2 start pm2.config.js && ../../_scripts/check-url.sh localhost:3031/__lbheartbeat__",
"stop": "pm2 stop pm2.config.js",
@ -92,6 +90,7 @@
"browserslist": "^4.21.4",
"eslint": "^7.32.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-react": "^7.32.2",
"express-http-proxy": "^1.6.3",
@ -137,6 +136,7 @@
"fxa-shared": "workspace:*",
"helmet": "^6.0.0",
"hot-shots": "^10.0.0",
"jest-watch-typeahead": "0.6.5",
"joi": "^17.8.3",
"jquery-modal": "https://github.com/mozilla-fxa/jquery-modal.git#0576775d1b4590314b114386019f4c7421c77503",
"morgan": "^1.10.0",

Просмотреть файл

@ -10,7 +10,7 @@ export type HeaderProps = {
export const Header = ({ profile, className = 'default' }: HeaderProps) => {
const { l10n } = useLocalization();
let profileSection = null;
let profileSection: JSX.Element | null = null;
if (profile) {
const { avatar, displayName, email } = profile;

Просмотреть файл

@ -213,7 +213,7 @@ export async function emailInputValidationAndAccountCheck(
onClickSignInButton: () => void,
getString?: (id: string) => string
) {
let error = null;
let error: JSX.Element | string | null = null;
let valid = false;
let hasAccount = false;
let invalidEmailDomain = false;

Просмотреть файл

@ -1,8 +1,7 @@
{
"extends": "../../_dev/tsconfig.browser.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"noEmit": true,
"incremental": false,
"types": [
"jest",
"@testing-library/jest-dom"
@ -12,10 +11,8 @@
"dom.iterable",
"esnext"
],
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"isolatedModules": true,
"jsx": "react-jsx"
"noImplicitAny": false
},
"include": [
"src"

Просмотреть файл

@ -1,9 +1,24 @@
{
"extends": ["plugin:fxa/recommended"],
"plugins": ["fxa"],
"parserOptions": {
"ecmaVersion": "2020",
"sourceType": "module"
},
"env": {
"mocha": true
},
"rules": {
"require-atomic-updates": "off",
"space-unary-ops": "off",
"no-useless-escape": "off",
"fxa/async-crypto-random": 0,
"fxa/no-new-buffer": 2
}
},
"ignorePatterns": [
"dist",
"node_modules",
"pm2.config.js"
],
"root": true
}

Просмотреть файл

@ -1,11 +1,24 @@
{
"extends": ["plugin:fxa/recommended"],
"plugins": ["fxa"],
"parserOptions": {
"ecmaVersion": "2020",
"sourceType": "module"
},
"env": {
"browser": true,
"jest": true
},
"parserOptions": {
"sourceType": "module"
}
"rules": {
"require-atomic-updates": "off",
"space-unary-ops": "off",
"no-useless-escape": "off"
},
"ignorePatterns": [
"dist",
"node_modules",
"pm2.config.js",
"storybook-static"
],
"root": true
}

Просмотреть файл

@ -3,13 +3,13 @@
"version": "0.0.0",
"description": "Shared components for FxA React Apps",
"exports": {
"./components/": "./dist/components/",
"./components/": "./dist/packages/fxa-react/components/",
"./configs/tailwind": "./configs/tailwind.js",
"./configs/rescripts": "./configs/rescripts.js",
"./configs/storybooks": "./configs/storybooks.js",
"./images/": "./images/",
"./extract-imported-components": "./extract-imported-components.js",
"./lib/": "./dist/lib/"
"./lib/": "./dist/packages/fxa-react/lib/"
},
"scripts": {
"build-css": "tailwindcss -i ./styles/tailwind.css -o ./styles/tailwind.out.css",
@ -40,6 +40,7 @@
"classnames": "^2.3.1",
"fetch-mock": "^9.11.0",
"fxa-shared": "workspace:*",
"postcss": "^8.4.23",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-helmet": "^6.1.0",

Просмотреть файл

@ -1,8 +1,7 @@
{
"extends": "../../_dev/tsconfig.browser.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist",
"allowJs": false,
"composite": true,
"types": ["jest", "@testing-library/jest-dom"]
},
@ -10,7 +9,6 @@
"./components",
"./lib"
],
"exclude": ["node_modules"],
"references": [
{"path": "../fxa-shared"}
]

Просмотреть файл

@ -13,8 +13,7 @@
"l10n-prime": "yarn l10n:prime fxa-settings",
"l10n-bundle": "yarn l10n:bundle fxa-settings branding,react,settings",
"legal-clone": "yarn legal:clone fxa-settings",
"lint-eslint": "eslint . .storybook",
"lint": "yarn lint-eslint",
"lint": "eslint . .storybook",
"restart": "yarn build-css && pm2 restart pm2.config.js",
"start": "yarn merge-ftl && yarn build-css && pm2 start pm2.config.js && ../../_scripts/check-url.sh localhost:3000/settings/static/js/bundle.js",
"stop": "pm2 stop pm2.config.js",

Просмотреть файл

@ -1,21 +1,17 @@
{
"extends": "../../_dev/tsconfig.browser.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"experimentalDecorators": true,
"noEmit": true,
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"isolatedModules": true,
"types": [
"jest",
"@testing-library/jest-dom"
],
"jsx": "react-jsx"
"isolatedModules": true,
"noEmit": true
},
"include": [
"src"
@ -26,9 +22,6 @@
},
{
"path": "../fxa-shared"
},
{
"path": "../fxa-auth-client/tsconfig.browser.json"
}
]
}

Просмотреть файл

@ -1,10 +1,22 @@
{
"extends": ["plugin:fxa/recommended"],
"plugins": ["fxa"],
"parserOptions": {
"ecmaVersion": "2020",
"sourceType": "module"
},
"env": {
"mocha": true
},
"parserOptions": {
"sourceType": "module"
}
"rules": {
"require-atomic-updates": "off",
"space-unary-ops": "off",
"no-useless-escape": "off"
},
"ignorePatterns": [
"dist",
"node_modules",
"pm2.config.js"
],
"root": true
}

Просмотреть файл

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
import md5 = require('js-md5');
import md5 from 'js-md5';
class BaseGroupingRule {
public name: string = '';

Просмотреть файл

@ -2,62 +2,63 @@
"name": "fxa-shared",
"version": "0.0.0",
"description": "Shared module for FxA repositories",
"main": "dist/index.js",
"main": "dist/packages/fxa-shared/index.js",
"exports": {
".": "./dist/index.js",
"./*": "./dist/*",
"./auth": "./dist/auth/index.js",
"./auth/*": "./dist/auth/*.js",
"./cache/*": "./dist/cache/*.js",
"./configuration/*": "./dist/configuration/*.js",
"./connected-services": "./dist/connected-services/index.js",
"./connected-services/*": "./dist/connected-services/*.js",
"./coverage/*": "./dist/coverage/*.js",
"./db": "./dist/db/index.js",
"./db/*": "./dist/db/*.js",
"./db/config": "./dist/db/config.js",
"./db/models": "./dist/db/models/index.js",
"./db/models/auth": "./dist/db/models/auth/index.js",
"./db/models/auth/*": "./dist/db/models/auth/*.js",
"./db/models/profile": "./dist/db/models/profile/index.js",
"./db/mysql": "./dist/db/mysql.js",
"./db/redis": "./dist/db/redis.js",
"./dto/*": "./dist/dto/*.js",
"./email/*": "./dist/email/*.js",
"./email/popularDomains.json": "./dist/email/popularDomains.json",
"./experiments/*": "./dist/experiments/*.js",
"./express": "./dist/express/index.js",
"./express/*": "./dist/express/*.js",
"./feature-flags": "./dist/feature-flags/index.js",
"./feature-flags/*": "./dist/feature-flags/*.js",
"./guards": "./dist/guards/index.js",
"./guards/*": "./dist/guards/*.js",
"./l10n/*": "./dist/l10n/*.js",
"./lib/*": "./dist/lib/*.js",
"./log": "./dist/log/index.js",
"./log/*": "./dist/log/*.js",
"./metrics/*": "./dist/metrics/*.js",
"./nestjs/*": "./dist/nestjs/*.js",
"./oauth/*": "./dist/oauth/*.js",
"./payments/*": "./dist/payments/*.js",
"./payments/configuration/*": "./dist/payments/configuration/*.js",
"./payments/iap/*": "./dist/payments/iap/*.js",
"./payments/iap/apple-app-store/types": "./dist/payments/iap/apple-app-store/types/index.js",
"./payments/iap/google-play/types": "./dist/payments/iap/google-play/types/index.js",
"./payments/stripe": "./dist/payments/stripe.js",
"./payments/stripe-firestore": "./dist/payments/stripe-firestore.js",
"./scripts/*": "./dist/scripts/*.js",
"./sentry": "./dist/sentry/index.js",
"./sentry/*": "./dist/sentry/*.js",
"./subscriptions/*": "./dist/subscriptions/*.js",
"./tracing/*": "./dist/tracing/*.js"
".": "./dist/packages/fxa-shared/index.js",
"./*": "./dist/packages/fxa-shared/*",
"./auth": "./dist/packages/fxa-shared/auth/index.js",
"./auth/*": "./dist/packages/fxa-shared/auth/*.js",
"./cache/*": "./dist/packages/fxa-shared/cache/*.js",
"./configuration/*": "./dist/packages/fxa-shared/configuration/*.js",
"./connected-services": "./dist/packages/fxa-shared/connected-services/index.js",
"./connected-services/*": "./dist/packages/fxa-shared/connected-services/*.js",
"./coverage/*": "./dist/packages/fxa-shared/coverage/*.js",
"./db": "./dist/packages/fxa-shared/db/index.js",
"./db/*": "./dist/packages/fxa-shared/db/*.js",
"./db/config": "./dist/packages/fxa-shared/db/config.js",
"./db/models": "./dist/packages/fxa-shared/db/models/index.js",
"./db/models/auth": "./dist/packages/fxa-shared/db/models/auth/index.js",
"./db/models/auth/*": "./dist/packages/fxa-shared/db/models/auth/*.js",
"./db/models/profile": "./dist/packages/fxa-shared/db/models/profile/index.js",
"./db/mysql": "./dist/packages/fxa-shared/db/mysql.js",
"./db/redis": "./dist/packages/fxa-shared/db/redis.js",
"./dto/*": "./dist/packages/fxa-shared/dto/*.js",
"./email/*": "./dist/packages/fxa-shared/email/*.js",
"./email/popularDomains.json": "./dist/packages/fxa-shared/email/popularDomains.json",
"./experiments/*": "./dist/packages/fxa-shared/experiments/*.js",
"./express": "./dist/packages/fxa-shared/express/index.js",
"./express/*": "./dist/packages/fxa-shared/express/*.js",
"./feature-flags": "./dist/packages/fxa-shared/feature-flags/index.js",
"./feature-flags/*": "./dist/packages/fxa-shared/feature-flags/*.js",
"./guards": "./dist/packages/fxa-shared/guards/index.js",
"./guards/*": "./dist/packages/fxa-shared/guards/*.js",
"./l10n/*": "./dist/packages/fxa-shared/l10n/*.js",
"./lib/*": "./dist/packages/fxa-shared/lib/*.js",
"./log": "./dist/packages/fxa-shared/log/index.js",
"./log/*": "./dist/packages/fxa-shared/log/*.js",
"./metrics/*": "./dist/packages/fxa-shared/metrics/*.js",
"./nestjs/*": "./dist/packages/fxa-shared/nestjs/*.js",
"./oauth/*": "./dist/packages/fxa-shared/oauth/*.js",
"./payments/*": "./dist/packages/fxa-shared/payments/*.js",
"./payments/configuration/*": "./dist/packages/fxa-shared/payments/configuration/*.js",
"./payments/iap/*": "./dist/packages/fxa-shared/payments/iap/*.js",
"./payments/iap/apple-app-store/types": "./dist/packages/fxa-shared/payments/iap/apple-app-store/types/index.js",
"./payments/iap/google-play/types": "./dist/packages/fxa-shared/payments/iap/google-play/types/index.js",
"./payments/stripe": "./dist/packages/fxa-shared/payments/stripe.js",
"./payments/stripe-firestore": "./dist/packages/fxa-shared/payments/stripe-firestore.js",
"./scripts/*": "./dist/packages/fxa-shared/scripts/*.js",
"./sentry": "./dist/packages/fxa-shared/sentry/index.js",
"./sentry/*": "./dist/packages/fxa-shared/sentry/*.js",
"./speed-trap/*": "./dist/packages/fxa-shared/speed-trap/*.js",
"./subscriptions/*": "./dist/packages/fxa-shared/subscriptions/*.js",
"./tracing/*": "./dist/packages/fxa-shared/tracing/*.js"
},
"scripts": {
"postinstall": "yarn build || true",
"build": "tsc --build && yarn copy-assets && yarn copy-sql",
"compile": "tsc --noEmit && yarn copy-assets && yarn copy-sql",
"copy-assets": "cp -r ./db/luaScripts ./dist/db/luaScripts",
"copy-sql": "find test -name \\*.sql -exec cp \\{\\} dist/\\{\\} \\;",
"copy-assets": "cp -r ./db/luaScripts ./dist/packages/fxa-shared/db/luaScripts",
"copy-sql": "find test -name \\*.sql -exec cp \\{\\} dist/packages/fxa-shared/\\{\\} \\;",
"start": "pm2 start pm2.config.js",
"stop": "pm2 stop pm2.config.js",
"restart": "pm2 restart pm2.config.js",

Просмотреть файл

@ -1,6 +1,8 @@
{
"extends": "../../_dev/tsconfig.node.json",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"allowJs": true,
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,

Просмотреть файл

12
tools/tsconfig.tools.json Normal file
Просмотреть файл

@ -0,0 +1,12 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "../dist/out-tsc/tools",
"rootDir": ".",
"module": "commonjs",
"target": "es5",
"types": ["node"],
"importHelpers": false
},
"include": ["**/*.ts"]
}

40
tsconfig.base.json Normal file
Просмотреть файл

@ -0,0 +1,40 @@
{
"compileOnSave": false,
"compilerOptions": {
"rootDir": ".",
"allowJs": false,
"incremental": true,
"inlineSources": true,
"inlineSourceMap": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2019",
"module": "esnext",
"strict": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"useUnknownInCatchVariables": false,
"baseUrl": ".",
"paths": {
},
"typeRoots": [
"./types",
"./node_modules/@types",
"./packages/*/node_modules/@types"
],
"jsx": "react-jsx"
},
"exclude": [
"packages/*/node_modules",
"node_modules",
"tmp"
]
}

1
types/fxa-geodb/index.d.ts поставляемый Normal file
Просмотреть файл

@ -0,0 +1 @@
declare module 'fxa-geodb';

2197
yarn.lock

Разница между файлами не показана из-за своего большого размера Загрузить разницу