diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 000000000000..bcd2a3efb20e --- /dev/null +++ b/.eslintrc @@ -0,0 +1,40 @@ +{ + "extends": "@redwoodjs/eslint-config", + "rules": { + "import/order": [ + "error", + { + "newlines-between": "always", + "pathGroupsExcludedImportTypes": [ + "react" + ], + "pathGroups": [ + { + "pattern": "react", + "group": "builtin", + "position": "after" + }, + { + "pattern": "@redwoodjs/**", + "group": "external", + "position": "after" + }, + { + "pattern": "src/lib/test", + "group": "parent", + "position": "before" + }, + { + "pattern": "src/**", + "group": "parent", + "position": "before" + } + ], + "alphabetize": { + "order": "asc", + "caseInsensitive": true + } + } + ] + } +} \ No newline at end of file diff --git a/package.json b/package.json index cecbcf034dfa..2ced7e8a6609 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,16 @@ { + "scripts": { + "build": "lerna run build:js && ttsc --build --verbose", + "build:clean": "rimraf ./packages/**/dist", + "build:watch": "ttsc --build && lerna run build:watch --parallel", + "test": "lerna run test --stream -- --colors --maxWorkers=4", + "lint": "eslint packages", + "lint:fix": "eslint --fix packages" + }, "private": true, "license": "MIT", + "npmClient": "yarn", + "useWorkspaces": true, "workspaces": [ "packages/*" ], @@ -15,7 +25,6 @@ "@babel/preset-react": "^7.10.4", "@babel/preset-typescript": "^7.10.4", "@babel/runtime-corejs3": "^7.11.2", - "core-js": "3.6.5", "@testing-library/jest-dom": "5.11.4", "@testing-library/react": "11.1.0", "@testing-library/user-event": "^12.0.11", @@ -25,6 +34,7 @@ "babel-plugin-module-resolver": "^4.0.0", "babel-plugin-remove-code": "^0.0.6", "bundlesize": "^0.18.0", + "core-js": "3.6.5", "cp-cli": "^2.0.0", "cross-env": "^7.0.2", "jest": "^26.5.3", @@ -32,21 +42,12 @@ "msw": "0.21.2", "nodemon": "^2.0.6", "rimraf": "^3.0.2", + "ttypescript": "^1.5.12", "typescript": "^4.0.2", + "typescript-transform-paths": "^2.0.2", "whatwg-fetch": "3.4.1" }, "resolutions": { "@types/react": "16.9.53" - }, - "eslintConfig": { - "extends": "@redwoodjs/eslint-config" - }, - "scripts": { - "build": "lerna run build:js && tsc --build --verbose", - "build:clean": "rimraf ./packages/**/dist", - "build:watch": "tsc --build && lerna run build:watch --parallel", - "test": "lerna run test --stream -- --colors --maxWorkers=4", - "lint": "eslint packages", - "lint:fix": "eslint --fix packages" } } diff --git a/packages/api-server/src/http.ts b/packages/api-server/src/http.ts index 4a8484d85258..1106af8cde62 100644 --- a/packages/api-server/src/http.ts +++ b/packages/api-server/src/http.ts @@ -1,7 +1,7 @@ +import bodyParser from 'body-parser' import type { Response, Request } from 'express' import express from 'express' import morgan from 'morgan' -import bodyParser from 'body-parser' export interface Lambdas { [path: string]: any diff --git a/packages/api-server/src/index.ts b/packages/api-server/src/index.ts index 8012a33e0b87..cfc961db8acc 100644 --- a/packages/api-server/src/index.ts +++ b/packages/api-server/src/index.ts @@ -1,7 +1,8 @@ #!/usr/bin/env node import path from 'path' -import yargs from 'yargs' + import requireDir from 'require-dir' +import yargs from 'yargs' import { server, setLambdaFunctions } from './http' import { requestHandler } from './requestHandlers/awsLambda' diff --git a/packages/api-server/tsconfig.json b/packages/api-server/tsconfig.json index 726a918b621e..0698d039699d 100644 --- a/packages/api-server/tsconfig.json +++ b/packages/api-server/tsconfig.json @@ -5,6 +5,9 @@ "rootDir": "src", "tsBuildInfoFile": "dist/tsconfig.tsbuildinfo", "outDir": "dist", + "paths": { + "src/*": ["./src/*"] + } }, "include": ["src", "ambient.d.ts"], "references": [{ "path": "../internal" }] diff --git a/packages/api/package.json b/packages/api/package.json index ca9a2d23e7d9..3cae6f59a7e5 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -37,7 +37,7 @@ "build": "yarn build:js && yarn build:types", "prepublishOnly": "yarn cross-env NODE_ENV=production yarn build", "build:js": "babel src -d dist --extensions \".js,.ts,.tsx\"", - "build:types": "tsc --build --verbose", + "build:types": "ttsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,ts,tsx\" --ignore dist --exec \"yarn build\"", "test": "jest", "test:watch": "yarn test --watch" diff --git a/packages/api/src/auth/decoders/index.ts b/packages/api/src/auth/decoders/index.ts index 4198c1b6b0f3..c49b639702d6 100644 --- a/packages/api/src/auth/decoders/index.ts +++ b/packages/api/src/auth/decoders/index.ts @@ -1,9 +1,11 @@ -import type { GlobalContext } from 'src/globalContext' import type { APIGatewayProxyEvent, Context as LambdaContext } from 'aws-lambda' + import type { SupportedAuthTypes } from '@redwoodjs/auth' -import { netlify } from './netlify' +import type { GlobalContext } from 'src/globalContext' + import { auth0 } from './auth0' +import { netlify } from './netlify' const noop = (token: string) => token const typesToDecoders: Record = { diff --git a/packages/api/src/auth/index.ts b/packages/api/src/auth/index.ts index 1ebe11922d20..372d5eec4a1f 100644 --- a/packages/api/src/auth/index.ts +++ b/packages/api/src/auth/index.ts @@ -1,7 +1,9 @@ -import type { GlobalContext } from 'src/globalContext' import type { APIGatewayProxyEvent, Context as LambdaContext } from 'aws-lambda' + import type { SupportedAuthTypes } from '@redwoodjs/auth' +import type { GlobalContext } from 'src/globalContext' + import { decodeToken } from './decoders' // This is shared by `@redwoodjs/web` diff --git a/packages/api/src/functions/authDecoder.test.ts b/packages/api/src/functions/authDecoder.test.ts index 8060936afa6c..b177a130a10f 100644 --- a/packages/api/src/functions/authDecoder.test.ts +++ b/packages/api/src/functions/authDecoder.test.ts @@ -1,7 +1,7 @@ -import mockedAPIGatewayProxyEvent from './fixtures/apiGatewayProxyEvent.fixture' import * as auth0Decoder from './../auth/decoders/auth0' -import * as netlifyDecoder from './../auth/decoders/netlify' import { decodeToken } from './../auth/decoders/index' +import * as netlifyDecoder from './../auth/decoders/netlify' +import mockedAPIGatewayProxyEvent from './fixtures/apiGatewayProxyEvent.fixture' jest.mock('./../auth/decoders/auth0', () => { return { diff --git a/packages/api/src/functions/graphql.ts b/packages/api/src/functions/graphql.ts index 22368e01a565..e82030b73573 100644 --- a/packages/api/src/functions/graphql.ts +++ b/packages/api/src/functions/graphql.ts @@ -1,10 +1,11 @@ -import type { APIGatewayProxyEvent, Context as LambdaContext } from 'aws-lambda' -import type { Config, CreateHandlerOptions } from 'apollo-server-lambda' import type { Context, ContextFunction } from 'apollo-server-core' -import type { GlobalContext } from 'src/globalContext' -import type { AuthContextPayload } from 'src/auth' +import type { Config, CreateHandlerOptions } from 'apollo-server-lambda' import { ApolloServer } from 'apollo-server-lambda' +import type { APIGatewayProxyEvent, Context as LambdaContext } from 'aws-lambda' + +import type { AuthContextPayload } from 'src/auth' import { getAuthenticationContext } from 'src/auth' +import type { GlobalContext } from 'src/globalContext' import { setContext } from 'src/globalContext' export type GetCurrentUser = ( diff --git a/packages/api/src/makeMergedSchema/makeMergedSchema.test.ts b/packages/api/src/makeMergedSchema/makeMergedSchema.test.ts index 1a3bdef64feb..dbd02f746c69 100644 --- a/packages/api/src/makeMergedSchema/makeMergedSchema.test.ts +++ b/packages/api/src/makeMergedSchema/makeMergedSchema.test.ts @@ -1,8 +1,8 @@ -import { GraphQLResolveInfo } from 'graphql' import { gql } from 'apollo-server-lambda' +import { GraphQLResolveInfo } from 'graphql' -import { GraphQLTypeWithFields } from '../types' import { makeMergedSchema } from '../makeMergedSchema/makeMergedSchema' +import { GraphQLTypeWithFields } from '../types' describe('makeMergedSchema', () => { // Simulate `importAll` diff --git a/packages/api/src/makeMergedSchema/makeMergedSchema.ts b/packages/api/src/makeMergedSchema/makeMergedSchema.ts index d7b79017af32..b464da5ed57a 100644 --- a/packages/api/src/makeMergedSchema/makeMergedSchema.ts +++ b/packages/api/src/makeMergedSchema/makeMergedSchema.ts @@ -4,10 +4,11 @@ import { IResolvers, IExecutableSchemaDefinition, } from 'apollo-server-lambda' -import { mergeTypes } from 'merge-graphql-schemas' +import { GraphQLSchema, GraphQLFieldMap } from 'graphql' import merge from 'lodash.merge' import omitBy from 'lodash.omitby' -import { GraphQLSchema, GraphQLFieldMap } from 'graphql' +import { mergeTypes } from 'merge-graphql-schemas' + import { Services, GraphQLTypeWithFields } from 'src/types' import * as rootSchema from './rootSchema' diff --git a/packages/api/src/makeMergedSchema/rootSchema.ts b/packages/api/src/makeMergedSchema/rootSchema.ts index 30e269a5ecc5..8014168282ae 100644 --- a/packages/api/src/makeMergedSchema/rootSchema.ts +++ b/packages/api/src/makeMergedSchema/rootSchema.ts @@ -1,7 +1,4 @@ /* eslint-disable @typescript-eslint/ban-ts-comment */ -import type { GlobalContext } from 'src/globalContext' -const { prismaVersion } = require('@prisma/client') -import gql from 'graphql-tag' import { DateResolver, TimeResolver, @@ -9,10 +6,15 @@ import { JSONResolver, JSONObjectResolver, } from 'graphql-scalars' - +import gql from 'graphql-tag' +// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - not inside the import apiPackageJson from 'src/../package.json' +import type { GlobalContext } from 'src/globalContext' + +const { prismaVersion } = require('@prisma/client') + /** * This adds scalar types for dealing with Date, Time, DateTime, and JSON. * This also adds a root Query type which is needed to start the GraphQL server on a fresh install. @@ -52,7 +54,7 @@ export const resolvers: Resolvers = { JSONObject: JSONObjectResolver, Query: { redwood: () => ({ - version: apiPackageJson.version, + version: apiPackageJson.version as string, prismaVersion: () => prismaVersion.client, currentUser: (_args: any, context: GlobalContext) => { return context?.currentUser diff --git a/packages/api/tsconfig.json b/packages/api/tsconfig.json index 5aaccf015624..dc924ffe8851 100644 --- a/packages/api/tsconfig.json +++ b/packages/api/tsconfig.json @@ -5,10 +5,13 @@ "rootDir": "src", "tsBuildInfoFile": "dist/tsconfig.tsbuildinfo", "outDir": "dist", + "paths": { + "src/*": ["./src/*"] + } }, "include": ["src", "src/../package.json"], "references": [ - { "path": "../auth", }, - { "path": "../dev-server", } + { "path": "../auth" }, + { "path": "../dev-server" } ] } diff --git a/packages/auth/package.json b/packages/auth/package.json index db37970a10a3..4d345206f9c8 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -35,7 +35,7 @@ "build": "yarn build:js && yarn build:types", "prepublishOnly": "yarn cross-env NODE_ENV=production yarn build", "build:js": "babel src -d dist --extensions \".js,.ts,.tsx\"", - "build:types": "tsc --build --verbose", + "build:types": "ttsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,ts,tsx\" --ignore dist --exec \"yarn build\"", "test": "jest", "test:watch": "yarn test --watch" diff --git a/packages/auth/src/__tests__/AuthProvider.test.tsx b/packages/auth/src/__tests__/AuthProvider.test.tsx index 6edde549d274..f0d5eebe9da8 100644 --- a/packages/auth/src/__tests__/AuthProvider.test.tsx +++ b/packages/auth/src/__tests__/AuthProvider.test.tsx @@ -2,12 +2,12 @@ require('whatwg-fetch') import { render, screen, fireEvent, waitFor } from '@testing-library/react' import '@testing-library/jest-dom/extend-expect' -import { setupServer } from 'msw/node' import { graphql } from 'msw' +import { setupServer } from 'msw/node' -import { useAuth } from '../useAuth' -import { AuthProvider } from '../AuthProvider' import type { AuthClient } from '../authClients' +import { AuthProvider } from '../AuthProvider' +import { useAuth } from '../useAuth' let CURRENT_USER_DATA = { name: 'Peter Pistorius', diff --git a/packages/auth/src/authClients/index.ts b/packages/auth/src/authClients/index.ts index e7d77c18eaed..47543c4a5abb 100644 --- a/packages/auth/src/authClients/index.ts +++ b/packages/auth/src/authClients/index.ts @@ -1,18 +1,18 @@ -import type { NetlifyIdentity } from './netlify' import type { Auth0, Auth0User } from './auth0' +import { auth0 } from './auth0' +import type { Custom } from './custom' +import { custom } from './custom' +import type { Firebase } from './firebase' +import { firebase } from './firebase' import type { GoTrue, GoTrueUser } from './goTrue' +import { goTrue } from './goTrue' import type { MagicLink, MagicUser } from './magicLink' -import type { Firebase } from './firebase' +import { magicLink } from './magicLink' +import type { NetlifyIdentity } from './netlify' +import { netlify } from './netlify' import type { Supabase, SupabaseUser } from './supabase' -import type { Custom } from './custom' // -import { netlify } from './netlify' -import { auth0 } from './auth0' -import { goTrue } from './goTrue' -import { magicLink } from './magicLink' -import { firebase } from './firebase' import { supabase } from './supabase' -import { custom } from './custom' const typesToClients = { netlify, @@ -40,7 +40,11 @@ export type { Auth0User } export type { GoTrueUser } export type { MagicUser } export type { SupabaseUser } -export type SupportedUserMetadata = Auth0User | GoTrueUser | MagicUser | SupabaseUser +export type SupportedUserMetadata = + | Auth0User + | GoTrueUser + | MagicUser + | SupabaseUser export interface AuthClient { restoreAuthState?(): void | Promise diff --git a/packages/auth/tsconfig.json b/packages/auth/tsconfig.json index fabf60e3eb27..168382cefbcc 100644 --- a/packages/auth/tsconfig.json +++ b/packages/auth/tsconfig.json @@ -5,6 +5,9 @@ "rootDir": "src", "tsBuildInfoFile": "dist/tsconfig.tsbuildinfo", "outDir": "dist", + "paths": { + "src/*": ["./src/*"] + } }, "include": ["src"], } diff --git a/packages/cli/src/commands/__tests__/build.test.js b/packages/cli/src/commands/__tests__/build.test.js index a1d38563193f..464c54af1db8 100644 --- a/packages/cli/src/commands/__tests__/build.test.js +++ b/packages/cli/src/commands/__tests__/build.test.js @@ -1,9 +1,5 @@ jest.mock('execa', () => jest.fn((cmd) => cmd)) -import execa from 'execa' - -import { runCommandTask } from '../../lib/index' - jest.mock('src/lib', () => { return { ...jest.requireActual('src/lib'), @@ -20,6 +16,10 @@ jest.mock('src/lib', () => { } }) +import execa from 'execa' + +import { runCommandTask } from 'src/lib' + import { handler } from '../build' test('The build command runs the correct commands.', async () => { diff --git a/packages/cli/src/commands/build.js b/packages/cli/src/commands/build.js index 2123be1ea8e1..d91310ced477 100644 --- a/packages/cli/src/commands/build.js +++ b/packages/cli/src/commands/build.js @@ -6,9 +6,9 @@ import Listr from 'listr' import VerboseRenderer from 'listr-verbose-renderer' import terminalLink from 'terminal-link' +import { handler as generatePrismaClient } from 'src/commands/dbCommands/generate' import { getPaths } from 'src/lib' import c from 'src/lib/colors' -import { handler as generatePrismaClient } from 'src/commands/dbCommands/generate' export const command = 'build [side..]' export const description = 'Build for production' diff --git a/packages/cli/src/commands/dataMigrate/install.js b/packages/cli/src/commands/dataMigrate/install.js index 54b9ee8672b2..a69f44b8363f 100644 --- a/packages/cli/src/commands/dataMigrate/install.js +++ b/packages/cli/src/commands/dataMigrate/install.js @@ -1,7 +1,7 @@ import path from 'path' -import fs from 'fs-extra' import execa from 'execa' +import fs from 'fs-extra' import Listr from 'listr' import terminalLink from 'terminal-link' diff --git a/packages/cli/src/commands/dataMigrate/up.js b/packages/cli/src/commands/dataMigrate/up.js index 74c5b7d77010..0fd51070d871 100644 --- a/packages/cli/src/commands/dataMigrate/up.js +++ b/packages/cli/src/commands/dataMigrate/up.js @@ -1,9 +1,9 @@ -import path from 'path' import fs from 'fs' +import path from 'path' import Listr from 'listr' -import terminalLink from 'terminal-link' import VerboseRenderer from 'listr-verbose-renderer' +import terminalLink from 'terminal-link' import { getPaths } from 'src/lib' import c from 'src/lib/colors' diff --git a/packages/cli/src/commands/dbCommands/__tests__/dbCommands.test.js b/packages/cli/src/commands/dbCommands/__tests__/dbCommands.test.js index 41857020c211..4923a798c432 100644 --- a/packages/cli/src/commands/dbCommands/__tests__/dbCommands.test.js +++ b/packages/cli/src/commands/dbCommands/__tests__/dbCommands.test.js @@ -1,11 +1,11 @@ import { runCommandTask } from 'src/lib' -import * as up from '../up' import * as down from '../down' -import * as save from '../save' import * as generate from '../generate' -import * as seed from '../seed' import * as introspect from '../introspect' +import * as save from '../save' +import * as seed from '../seed' +import * as up from '../up' const schema = './api/db/schema.prisma' diff --git a/packages/cli/src/commands/dbCommands/down.js b/packages/cli/src/commands/dbCommands/down.js index a03dd3c0335e..80d5ad63cda6 100644 --- a/packages/cli/src/commands/dbCommands/down.js +++ b/packages/cli/src/commands/dbCommands/down.js @@ -1,5 +1,5 @@ -import { runCommandTask } from 'src/lib' import * as options from 'src/commands/dbCommands/options' +import { runCommandTask } from 'src/lib' export const command = 'down [decrement]' export const description = 'Migrate your database down' diff --git a/packages/cli/src/commands/dbCommands/generate.js b/packages/cli/src/commands/dbCommands/generate.js index 3960e1f19543..2ac19ef7dd5e 100644 --- a/packages/cli/src/commands/dbCommands/generate.js +++ b/packages/cli/src/commands/dbCommands/generate.js @@ -1,8 +1,8 @@ import fs from 'fs' import path from 'path' -import { runCommandTask, getPaths } from 'src/lib' import * as options from 'src/commands/dbCommands/options' +import { runCommandTask, getPaths } from 'src/lib' export const command = 'generate' export const description = 'Generate the Prisma client' diff --git a/packages/cli/src/commands/dbCommands/introspect.js b/packages/cli/src/commands/dbCommands/introspect.js index 50a16e1a762e..b1b1fd894e39 100644 --- a/packages/cli/src/commands/dbCommands/introspect.js +++ b/packages/cli/src/commands/dbCommands/introspect.js @@ -1,5 +1,5 @@ -import { getPaths, runCommandTask } from 'src/lib' import * as options from 'src/commands/dbCommands/options' +import { getPaths, runCommandTask } from 'src/lib' export const command = 'introspect' export const description = diff --git a/packages/cli/src/commands/dbCommands/save.js b/packages/cli/src/commands/dbCommands/save.js index dcdbd809e4a5..2f90761e1e5c 100644 --- a/packages/cli/src/commands/dbCommands/save.js +++ b/packages/cli/src/commands/dbCommands/save.js @@ -1,5 +1,5 @@ -import { runCommandTask } from 'src/lib' import * as options from 'src/commands/dbCommands/options' +import { runCommandTask } from 'src/lib' export const command = 'save [name..]' export const description = 'Create a new migration' diff --git a/packages/cli/src/commands/dbCommands/studio.js b/packages/cli/src/commands/dbCommands/studio.js index 2e4b48551d97..84eb61e0e528 100644 --- a/packages/cli/src/commands/dbCommands/studio.js +++ b/packages/cli/src/commands/dbCommands/studio.js @@ -1,8 +1,8 @@ -import path from 'path' import fs from 'fs' +import path from 'path' -import { runCommandTask, getPaths } from 'src/lib' import * as options from 'src/commands/dbCommands/options' +import { runCommandTask, getPaths } from 'src/lib' import c from 'src/lib/colors' export const command = 'studio' diff --git a/packages/cli/src/commands/dbCommands/up.js b/packages/cli/src/commands/dbCommands/up.js index fe842a8335d0..002412fa1e95 100644 --- a/packages/cli/src/commands/dbCommands/up.js +++ b/packages/cli/src/commands/dbCommands/up.js @@ -1,6 +1,6 @@ -import { runCommandTask } from 'src/lib' import { handler as generatePrismaClient } from 'src/commands/dbCommands/generate' import * as options from 'src/commands/dbCommands/options' +import { runCommandTask } from 'src/lib' export const command = 'up [increment]' export const description = 'Generate the Prisma client and apply migrations' diff --git a/packages/cli/src/commands/deploy/api/api.js b/packages/cli/src/commands/deploy/api/api.js index 205e909a127f..86b4f0545374 100644 --- a/packages/cli/src/commands/deploy/api/api.js +++ b/packages/cli/src/commands/deploy/api/api.js @@ -1,12 +1,12 @@ import fs from 'fs' import path from 'path' -import terminalLink from 'terminal-link' import execa from 'execa' import Listr from 'listr' +import terminalLink from 'terminal-link' -import c from 'src/lib/colors' import { getPaths } from 'src/lib' +import c from 'src/lib/colors' export const command = 'api ' export const description = 'Deploy the API using the selected provider' diff --git a/packages/cli/src/commands/destroy/page/__tests__/page.test.js b/packages/cli/src/commands/destroy/page/__tests__/page.test.js index d3527874857e..c23f231e2f16 100644 --- a/packages/cli/src/commands/destroy/page/__tests__/page.test.js +++ b/packages/cli/src/commands/destroy/page/__tests__/page.test.js @@ -10,6 +10,7 @@ jest.mock('src/lib', () => { import fs from 'fs' import 'src/lib/test' + import { getPaths } from 'src/lib' import { files } from '../../../generate/page/page' diff --git a/packages/cli/src/commands/destroy/scaffold/__tests__/scaffold.test.js b/packages/cli/src/commands/destroy/scaffold/__tests__/scaffold.test.js index 6e2d10d7db57..6e9652a9b6da 100644 --- a/packages/cli/src/commands/destroy/scaffold/__tests__/scaffold.test.js +++ b/packages/cli/src/commands/destroy/scaffold/__tests__/scaffold.test.js @@ -3,6 +3,7 @@ global.__dirname = __dirname import fs from 'fs' import 'src/lib/test' + import { getPaths, getDefaultArgs } from 'src/lib' import { yargsDefaults as defaults } from '../../../generate' diff --git a/packages/cli/src/commands/dev.js b/packages/cli/src/commands/dev.js index 8e8d341bd0e1..34ff1cbae8ee 100644 --- a/packages/cli/src/commands/dev.js +++ b/packages/cli/src/commands/dev.js @@ -3,11 +3,12 @@ import path from 'path' import concurrently from 'concurrently' import terminalLink from 'terminal-link' + import { getConfig, shutdownPort } from '@redwoodjs/internal' +import { handler as generatePrismaClient } from 'src/commands/dbCommands/generate' import { getPaths } from 'src/lib' import c from 'src/lib/colors' -import { handler as generatePrismaClient } from 'src/commands/dbCommands/generate' export const command = 'dev [side..]' export const description = 'Start development servers for api, db, and web' diff --git a/packages/cli/src/commands/generate/auth/__tests__/auth.test.js b/packages/cli/src/commands/generate/auth/__tests__/auth.test.js index fc2ee478cbfc..084efda6764a 100644 --- a/packages/cli/src/commands/generate/auth/__tests__/auth.test.js +++ b/packages/cli/src/commands/generate/auth/__tests__/auth.test.js @@ -1,9 +1,5 @@ global.__dirname = __dirname -import { - waitFor, -} from '@testing-library/react' - jest.mock('fs') jest.mock('src/lib', () => ({ getPaths: () => ({ @@ -13,11 +9,14 @@ jest.mock('src/lib', () => ({ })) import fs from 'fs' + +import { waitFor } from '@testing-library/react' import chalk from 'chalk' import * as auth from '../auth' -const EXISTING_AUTH_PROVIDER_ERROR = 'Existing auth provider found.\nUse --force to override existing provider.'; +const EXISTING_AUTH_PROVIDER_ERROR = + 'Existing auth provider found.\nUse --force to override existing provider.' test(`no error thrown when auth provider not found`, async () => { // Mock process.exit to make sure CLI quites @@ -25,7 +24,9 @@ test(`no error thrown when auth provider not found`, async () => { auth.handler({ provider: 'netlify' }) await waitFor(() => expect(console.log).toHaveBeenCalledTimes(1)) - expect(console.log).not.toHaveBeenCalledWith(chalk.bold.red(EXISTING_AUTH_PROVIDER_ERROR)) + expect(console.log).not.toHaveBeenCalledWith( + chalk.bold.red(EXISTING_AUTH_PROVIDER_ERROR) + ) // Restore mocks cSpy.mockRestore() @@ -33,12 +34,16 @@ test(`no error thrown when auth provider not found`, async () => { test('throws an error if auth provider exists', async () => { // Mock process.exit to make sure CLI quites - const fsSpy = jest.spyOn(fs, 'readFileSync').mockImplementation(() => `import { AuthProvider } from '@redwoodjs/auth'`) + const fsSpy = jest + .spyOn(fs, 'readFileSync') + .mockImplementation(() => `import { AuthProvider } from '@redwoodjs/auth'`) const cSpy = jest.spyOn(console, 'log').mockImplementation(() => {}) auth.handler({ provider: 'netlify' }) await waitFor(() => expect(console.log).toHaveBeenCalledTimes(1)) - expect(console.log).toHaveBeenCalledWith(chalk.bold.red(EXISTING_AUTH_PROVIDER_ERROR)) + expect(console.log).toHaveBeenCalledWith( + chalk.bold.red(EXISTING_AUTH_PROVIDER_ERROR) + ) // Restore mocks fsSpy.mockRestore() diff --git a/packages/cli/src/commands/generate/auth/auth.js b/packages/cli/src/commands/generate/auth/auth.js index 9ec6fb312621..7d301a380e27 100644 --- a/packages/cli/src/commands/generate/auth/auth.js +++ b/packages/cli/src/commands/generate/auth/auth.js @@ -4,6 +4,7 @@ import path from 'path' import execa from 'execa' import Listr from 'listr' import terminalLink from 'terminal-link' + import { resolveFile } from '@redwoodjs/internal' import { getPaths, writeFilesTask } from 'src/lib' diff --git a/packages/cli/src/commands/generate/cell/__tests__/cell.test.js b/packages/cli/src/commands/generate/cell/__tests__/cell.test.js index 38e60138a1aa..69edeeee8759 100644 --- a/packages/cli/src/commands/generate/cell/__tests__/cell.test.js +++ b/packages/cli/src/commands/generate/cell/__tests__/cell.test.js @@ -1,8 +1,6 @@ global.__dirname = __dirname import path from 'path' -import { loadGeneratorFixture } from 'src/lib/test' - jest.mock('@redwoodjs/structure', () => { return { getProject: () => ({ @@ -11,6 +9,8 @@ jest.mock('@redwoodjs/structure', () => { } }) +import { loadGeneratorFixture } from 'src/lib/test' + import * as cell from '../cell' let singleWordFiles, diff --git a/packages/cli/src/commands/generate/dataMigration/dataMigration.js b/packages/cli/src/commands/generate/dataMigration/dataMigration.js index 9ae14b01c2c1..96c6c3829862 100644 --- a/packages/cli/src/commands/generate/dataMigration/dataMigration.js +++ b/packages/cli/src/commands/generate/dataMigration/dataMigration.js @@ -1,8 +1,8 @@ import fs from 'fs' import path from 'path' -import { paramCase } from 'param-case' import Listr from 'listr' +import { paramCase } from 'param-case' import terminalLink from 'terminal-link' import { getPaths, writeFilesTask } from 'src/lib' diff --git a/packages/cli/src/commands/generate/deploy/deploy.js b/packages/cli/src/commands/generate/deploy/deploy.js index 798b1421219c..2f4dd2af750e 100644 --- a/packages/cli/src/commands/generate/deploy/deploy.js +++ b/packages/cli/src/commands/generate/deploy/deploy.js @@ -142,7 +142,7 @@ export const handler = async ({ provider, force }) => { }, providerData?.prismaBinaryTargetAdditions && { title: 'Adding necessary Prisma binaries...', - task: () => providerData.prismaBinaryTargetAdditions() + task: () => providerData.prismaBinaryTargetAdditions(), }, { title: 'One more thing...', diff --git a/packages/cli/src/commands/generate/deploy/providers/aws_serverless.js b/packages/cli/src/commands/generate/deploy/providers/aws_serverless.js index 8b3c27ccd3ce..5c59d924dd2a 100644 --- a/packages/cli/src/commands/generate/deploy/providers/aws_serverless.js +++ b/packages/cli/src/commands/generate/deploy/providers/aws_serverless.js @@ -1,9 +1,10 @@ -import path from 'path' import fs from 'fs' +import path from 'path' -import { getPaths } from 'src/lib' import { getConfig } from '@redwoodjs/internal' +import { getPaths } from 'src/lib' + const config = getConfig() const SERVERLESS_YML = `# See the full yml reference at https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/ @@ -94,7 +95,7 @@ export const gitIgnoreAdditions = ['.serverless'] export const prismaBinaryTargetAdditions = () => { const content = fs.readFileSync(getPaths().api.dbSchema).toString() - if (!content.includes("rhel-openssl-1.0.x")) { + if (!content.includes('rhel-openssl-1.0.x')) { const result = content.replace( /binaryTargets =.*\n/, `binaryTargets = ["native", "rhel-openssl-1.0.x"]\n` diff --git a/packages/cli/src/commands/generate/deploy/providers/netlify.js b/packages/cli/src/commands/generate/deploy/providers/netlify.js index a5a145bbf0b7..d4d76bb18409 100644 --- a/packages/cli/src/commands/generate/deploy/providers/netlify.js +++ b/packages/cli/src/commands/generate/deploy/providers/netlify.js @@ -1,4 +1,5 @@ import path from 'path' + import { getPaths } from 'src/lib' const NETLIFY_TOML = `[build] diff --git a/packages/cli/src/commands/generate/helpers.js b/packages/cli/src/commands/generate/helpers.js index 2c748005caf2..ec9871501508 100644 --- a/packages/cli/src/commands/generate/helpers.js +++ b/packages/cli/src/commands/generate/helpers.js @@ -1,9 +1,10 @@ import path from 'path' import Listr from 'listr' -import pascalcase from 'pascalcase' import { paramCase } from 'param-case' +import pascalcase from 'pascalcase' import terminalLink from 'terminal-link' + import { ensurePosixPath } from '@redwoodjs/internal' import { generateTemplate, getPaths, writeFilesTask } from 'src/lib' diff --git a/packages/cli/src/commands/generate/page/__tests__/page.test.js b/packages/cli/src/commands/generate/page/__tests__/page.test.js index 3f4fcb02ebc9..5313241f3d9c 100644 --- a/packages/cli/src/commands/generate/page/__tests__/page.test.js +++ b/packages/cli/src/commands/generate/page/__tests__/page.test.js @@ -36,10 +36,11 @@ jest.mock('fs', () => { } }) -import path from 'path' import fs from 'fs' +import path from 'path' import { loadGeneratorFixture } from 'src/lib/test' + import { getPaths } from 'src/lib' import { pathName } from '../../helpers' diff --git a/packages/cli/src/commands/generate/page/page.js b/packages/cli/src/commands/generate/page/page.js index 99f7db2b48ed..ff4e33336f77 100644 --- a/packages/cli/src/commands/generate/page/page.js +++ b/packages/cli/src/commands/generate/page/page.js @@ -1,7 +1,7 @@ import { execSync } from 'child_process' -import Listr from 'listr' import camelcase from 'camelcase' +import Listr from 'listr' import pascalcase from 'pascalcase' import terminalLink from 'terminal-link' diff --git a/packages/cli/src/commands/generate/scaffold/__tests__/scaffold.test.js b/packages/cli/src/commands/generate/scaffold/__tests__/scaffold.test.js index 5eb6cd55955d..508d176ed086 100644 --- a/packages/cli/src/commands/generate/scaffold/__tests__/scaffold.test.js +++ b/packages/cli/src/commands/generate/scaffold/__tests__/scaffold.test.js @@ -2,6 +2,7 @@ global.__dirname = __dirname import path from 'path' import { loadGeneratorFixture } from 'src/lib/test' + import { getDefaultArgs } from 'src/lib' import { yargsDefaults as defaults } from '../../../generate' diff --git a/packages/cli/src/commands/generate/scaffold/__tests__/scaffoldPath.test.js b/packages/cli/src/commands/generate/scaffold/__tests__/scaffoldPath.test.js index 6cd5f2e13bd9..1c28648476e7 100644 --- a/packages/cli/src/commands/generate/scaffold/__tests__/scaffoldPath.test.js +++ b/packages/cli/src/commands/generate/scaffold/__tests__/scaffoldPath.test.js @@ -1,7 +1,7 @@ global.__dirname = __dirname import path from 'path' -import { loadGeneratorFixture } from 'src/lib/test' // eslint-disable-line +import 'src/lib/test' import * as scaffold from '../scaffold' diff --git a/packages/cli/src/commands/generate/scaffold/__tests__/scaffoldPathMultiword.test.js b/packages/cli/src/commands/generate/scaffold/__tests__/scaffoldPathMultiword.test.js index 59008afce01e..c596bf301246 100644 --- a/packages/cli/src/commands/generate/scaffold/__tests__/scaffoldPathMultiword.test.js +++ b/packages/cli/src/commands/generate/scaffold/__tests__/scaffoldPathMultiword.test.js @@ -1,7 +1,7 @@ global.__dirname = __dirname import path from 'path' -import { loadGeneratorFixture } from 'src/lib/test' // eslint-disable-line +import 'src/lib/test' import * as scaffold from '../scaffold' diff --git a/packages/cli/src/commands/generate/scaffold/__tests__/scaffoldPathNested.test.js b/packages/cli/src/commands/generate/scaffold/__tests__/scaffoldPathNested.test.js index 7d7b14039649..c464e80de2dd 100644 --- a/packages/cli/src/commands/generate/scaffold/__tests__/scaffoldPathNested.test.js +++ b/packages/cli/src/commands/generate/scaffold/__tests__/scaffoldPathNested.test.js @@ -1,7 +1,7 @@ global.__dirname = __dirname import path from 'path' -import { loadGeneratorFixture } from 'src/lib/test' // eslint-disable-line +import 'src/lib/test' import * as scaffold from '../scaffold' diff --git a/packages/cli/src/commands/generate/scaffold/scaffold.js b/packages/cli/src/commands/generate/scaffold/scaffold.js index b3794bf8d751..8c03470ae1dc 100644 --- a/packages/cli/src/commands/generate/scaffold/scaffold.js +++ b/packages/cli/src/commands/generate/scaffold/scaffold.js @@ -1,15 +1,15 @@ import fs from 'fs' import path from 'path' -import Listr from 'listr' +import boxen from 'boxen' import camelcase from 'camelcase' +import chalk from 'chalk' +import humanize from 'humanize-string' +import Listr from 'listr' +import { paramCase } from 'param-case' import pascalcase from 'pascalcase' import pluralize from 'pluralize' -import { paramCase } from 'param-case' -import humanize from 'humanize-string' import terminalLink from 'terminal-link' -import boxen from 'boxen' -import chalk from 'chalk' import { generateTemplate, diff --git a/packages/cli/src/commands/generate/sdl/__tests__/sdl.test.js b/packages/cli/src/commands/generate/sdl/__tests__/sdl.test.js index c20235c85d9b..6878f9b670e9 100644 --- a/packages/cli/src/commands/generate/sdl/__tests__/sdl.test.js +++ b/packages/cli/src/commands/generate/sdl/__tests__/sdl.test.js @@ -2,6 +2,7 @@ global.__dirname = __dirname import path from 'path' import { loadGeneratorFixture } from 'src/lib/test' + import { getDefaultArgs } from 'src/lib' import * as sdl from '../sdl' diff --git a/packages/cli/src/commands/generate/sdl/sdl.js b/packages/cli/src/commands/generate/sdl/sdl.js index da445dcd22e5..56694a71c0a1 100644 --- a/packages/cli/src/commands/generate/sdl/sdl.js +++ b/packages/cli/src/commands/generate/sdl/sdl.js @@ -1,7 +1,7 @@ import path from 'path' -import Listr from 'listr' import camelcase from 'camelcase' +import Listr from 'listr' import pascalcase from 'pascalcase' import pluralize from 'pluralize' import terminalLink from 'terminal-link' @@ -17,8 +17,8 @@ import { import c from 'src/lib/colors' import { yargsDefaults } from '../../generate' -import { files as serviceFiles } from '../service/service' import { relationsForModel } from '../helpers' +import { files as serviceFiles } from '../service/service' const IGNORE_FIELDS_FOR_INPUT = ['id', 'createdAt', 'updatedAt'] diff --git a/packages/cli/src/commands/generate/service/__tests__/service.test.js b/packages/cli/src/commands/generate/service/__tests__/service.test.js index c06dd69f8a14..7ffc532ca4f3 100644 --- a/packages/cli/src/commands/generate/service/__tests__/service.test.js +++ b/packages/cli/src/commands/generate/service/__tests__/service.test.js @@ -2,6 +2,7 @@ global.__dirname = __dirname import path from 'path' import { loadGeneratorFixture } from 'src/lib/test' + import { getDefaultArgs } from 'src/lib' import * as service from '../service' diff --git a/packages/cli/src/commands/open.js b/packages/cli/src/commands/open.js index 7d333cf67773..cdf8268fd313 100644 --- a/packages/cli/src/commands/open.js +++ b/packages/cli/src/commands/open.js @@ -1,7 +1,8 @@ import execa from 'execa' -import { getConfig } from '@redwoodjs/internal' import terminalLink from 'terminal-link' +import { getConfig } from '@redwoodjs/internal' + export const command = 'open' export const description = 'Open your project in your browser' export const builder = (yargs) => { diff --git a/packages/cli/src/commands/setup/i18n/i18n.js b/packages/cli/src/commands/setup/i18n/i18n.js index 6e2ede6e6fdc..b234f3b71bc1 100644 --- a/packages/cli/src/commands/setup/i18n/i18n.js +++ b/packages/cli/src/commands/setup/i18n/i18n.js @@ -1,12 +1,12 @@ import fs from 'fs' import path from 'path' -import Listr from 'listr' -import execa from 'execa' import chalk from 'chalk' +import execa from 'execa' +import Listr from 'listr' -import c from 'src/lib/colors' import { getPaths, writeFile } from 'src/lib' +import c from 'src/lib/colors' export const command = 'i18n' export const description = 'Setup i18n' diff --git a/packages/cli/src/commands/setup/tailwind/tailwind.js b/packages/cli/src/commands/setup/tailwind/tailwind.js index 71ee0ff6f1c0..455e89a6f7f6 100644 --- a/packages/cli/src/commands/setup/tailwind/tailwind.js +++ b/packages/cli/src/commands/setup/tailwind/tailwind.js @@ -1,12 +1,12 @@ import fs from 'fs' import path from 'path' -import Listr from 'listr' -import execa from 'execa' import chalk from 'chalk' +import execa from 'execa' +import Listr from 'listr' -import c from 'src/lib/colors' import { getPaths, writeFile } from 'src/lib' +import c from 'src/lib/colors' export const command = 'tailwind' export const description = 'Setup tailwindcss and PostCSS' diff --git a/packages/cli/src/commands/setup/webpack/webpack.js b/packages/cli/src/commands/setup/webpack/webpack.js index 647d2a136500..ad5a8b4cacca 100644 --- a/packages/cli/src/commands/setup/webpack/webpack.js +++ b/packages/cli/src/commands/setup/webpack/webpack.js @@ -1,10 +1,11 @@ import fs from 'fs' -import Listr from 'listr' import path from 'path' + import chalk from 'chalk' +import Listr from 'listr' -import c from 'src/lib/colors' import { getPaths, writeFile } from 'src/lib' +import c from 'src/lib/colors' export const command = 'webpack' export const description = diff --git a/packages/cli/src/commands/storybook.js b/packages/cli/src/commands/storybook.js index 1e41274820e5..2166c675247c 100644 --- a/packages/cli/src/commands/storybook.js +++ b/packages/cli/src/commands/storybook.js @@ -1,6 +1,7 @@ import path from 'path' import execa from 'execa' + import { getPaths } from '@redwoodjs/internal' export const command = 'storybook' diff --git a/packages/cli/src/commands/test.js b/packages/cli/src/commands/test.js index 392fdb03d741..e20b599c38de 100644 --- a/packages/cli/src/commands/test.js +++ b/packages/cli/src/commands/test.js @@ -1,7 +1,8 @@ import execa from 'execa' import terminalLink from 'terminal-link' + import { ensurePosixPath } from '@redwoodjs/internal' -const { getProject } = require('@redwoodjs/structure') +import { getProject } from '@redwoodjs/structure' import { getPaths } from 'src/lib' import c from 'src/lib/colors' diff --git a/packages/cli/src/index.js b/packages/cli/src/index.js index a2e797c936d1..196a78eef8f9 100644 --- a/packages/cli/src/index.js +++ b/packages/cli/src/index.js @@ -1,9 +1,10 @@ #!/usr/bin/env node import path from 'path' +import { config } from 'dotenv-defaults' import yargs from 'yargs' + import { getPaths } from '@redwoodjs/internal' -import { config } from 'dotenv-defaults' config({ path: path.join(getPaths().base, '.env'), diff --git a/packages/cli/src/lib/index.js b/packages/cli/src/lib/index.js index c00133d5782b..d26095173a29 100644 --- a/packages/cli/src/lib/index.js +++ b/packages/cli/src/lib/index.js @@ -1,19 +1,20 @@ import fs from 'fs' import path from 'path' -import lodash from 'lodash/string' +import * as babel from '@babel/core' +import { getDMMF } from '@prisma/sdk' import camelcase from 'camelcase' -import pascalcase from 'pascalcase' -import pluralize from 'pluralize' import decamelize from 'decamelize' -import { paramCase } from 'param-case' -import { getDMMF } from '@prisma/sdk' -import { getPaths as getRedwoodPaths } from '@redwoodjs/internal' import execa from 'execa' import Listr from 'listr' import VerboseRenderer from 'listr-verbose-renderer' +import lodash from 'lodash/string' +import { paramCase } from 'param-case' +import pascalcase from 'pascalcase' +import pluralize from 'pluralize' import { format } from 'prettier' -import * as babel from '@babel/core' + +import { getPaths as getRedwoodPaths } from '@redwoodjs/internal' import c from './colors' diff --git a/packages/cli/src/redwood-tools.js b/packages/cli/src/redwood-tools.js index 6f13d39c0906..f0308e6cd2e0 100644 --- a/packages/cli/src/redwood-tools.js +++ b/packages/cli/src/redwood-tools.js @@ -1,12 +1,13 @@ #!/usr/bin/env node -import path from 'path' import fs from 'fs' +import path from 'path' -import yargs from 'yargs' -import { getPaths, ensurePosixPath } from '@redwoodjs/internal' -import execa from 'execa' import chokidar from 'chokidar' +import execa from 'execa' import _ from 'lodash' +import yargs from 'yargs' + +import { getPaths, ensurePosixPath } from '@redwoodjs/internal' const RW_BINS = { redwood: 'cli/dist/index.js', diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index 4050cd70786f..03632945c00f 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -4,7 +4,10 @@ "tsBuildInfoFile": "dist/tsconfig.tsbuildinfo", "baseUrl": ".", "rootDir": "src", - "outDir": "dist" + "outDir": "dist", + "paths": { + "src/*": ["./src/*"] + } }, "include": ["src"], "references": [ diff --git a/packages/core/config/webpack.common.js b/packages/core/config/webpack.common.js index 21378576d59f..74c98e3516ec 100644 --- a/packages/core/config/webpack.common.js +++ b/packages/core/config/webpack.common.js @@ -1,17 +1,17 @@ /* eslint-disable import/no-extraneous-dependencies */ -const path = require('path') const { existsSync } = require('fs') +const path = require('path') -const webpack = require('webpack') +const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin') +const CopyPlugin = require('copy-webpack-plugin') const Dotenv = require('dotenv-webpack') -const { getConfig, getPaths } = require('@redwoodjs/internal') -const { merge } = require('webpack-merge') - const HtmlWebpackPlugin = require('html-webpack-plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin') -const CopyPlugin = require('copy-webpack-plugin') +const webpack = require('webpack') +const { merge } = require('webpack-merge') const { RetryChunkLoadPlugin } = require('webpack-retry-chunk-load-plugin') -const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin') + +const { getConfig, getPaths } = require('@redwoodjs/internal') const redwoodConfig = getConfig() const redwoodPaths = getPaths() diff --git a/packages/core/config/webpack.development.js b/packages/core/config/webpack.development.js index 0bba3000b2f6..f2619ed846e4 100644 --- a/packages/core/config/webpack.development.js +++ b/packages/core/config/webpack.development.js @@ -1,7 +1,8 @@ -const { merge } = require('webpack-merge') +const ErrorOverlayPlugin = require('error-overlay-webpack-plugin') const escapeRegExp = require('lodash.escaperegexp') +const { merge } = require('webpack-merge') + const { getConfig } = require('@redwoodjs/internal') -const ErrorOverlayPlugin = require('error-overlay-webpack-plugin') const webpackConfig = require('./webpack.common') diff --git a/packages/core/config/webpack.stats.js b/packages/core/config/webpack.stats.js index e74e239d94f1..fab9f20bd0b1 100644 --- a/packages/core/config/webpack.stats.js +++ b/packages/core/config/webpack.stats.js @@ -1,5 +1,5 @@ -const { merge } = require('webpack-merge') const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') +const { merge } = require('webpack-merge') const webpackProduction = require('./webpack.production') diff --git a/packages/core/package.json b/packages/core/package.json index e9c8d6834139..5a4c6b358ed6 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -75,7 +75,7 @@ "build": "yarn build:js && yarn build:types", "prepublishOnly": "yarn build", "build:js": "babel src -d dist --extensions \".js,.ts,.tsx\"", - "build:types": "tsc --build --verbose", + "build:types": "ttsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,ts,tsx,template\" --ignore dist --exec \"yarn build\"", "test": "jest", "test:watch": "yarn test --watch" diff --git a/packages/core/src/babelPlugins/__tests__/babel-plugin-redwood-import-dir.test.ts b/packages/core/src/babelPlugins/__tests__/babel-plugin-redwood-import-dir.test.ts index 0482a9ecae4e..92ded40ec192 100644 --- a/packages/core/src/babelPlugins/__tests__/babel-plugin-redwood-import-dir.test.ts +++ b/packages/core/src/babelPlugins/__tests__/babel-plugin-redwood-import-dir.test.ts @@ -1,5 +1,7 @@ import path from 'path' + import pluginTester from 'babel-plugin-tester' + import plugin from '../babel-plugin-redwood-import-dir' const mockReaddirSync = jest.fn(() => [ diff --git a/packages/core/src/babelPlugins/__tests__/babel-plugin-redwood-routes-auto-loader.test.ts b/packages/core/src/babelPlugins/__tests__/babel-plugin-redwood-routes-auto-loader.test.ts index cf8bbf333315..5356fa0799fe 100644 --- a/packages/core/src/babelPlugins/__tests__/babel-plugin-redwood-routes-auto-loader.test.ts +++ b/packages/core/src/babelPlugins/__tests__/babel-plugin-redwood-routes-auto-loader.test.ts @@ -1,8 +1,11 @@ import path from 'path' + import pluginTester from 'babel-plugin-tester' -import plugin from '../babel-plugin-redwood-routes-auto-loader' + import { getProject } from '@redwoodjs/structure' +import plugin from '../babel-plugin-redwood-routes-auto-loader' + const mockReaddirSync = jest.fn(() => ['routes.d.ts']) const mockWriteFileSync = jest.fn() diff --git a/packages/core/src/babelPlugins/babel-plugin-redwood-directory-named-import.ts b/packages/core/src/babelPlugins/babel-plugin-redwood-directory-named-import.ts index 4731db5c2352..75db5fa4c947 100644 --- a/packages/core/src/babelPlugins/babel-plugin-redwood-directory-named-import.ts +++ b/packages/core/src/babelPlugins/babel-plugin-redwood-directory-named-import.ts @@ -1,8 +1,9 @@ -import { resolveFile } from '@redwoodjs/internal' import path from 'path' import type { PluginObj, types } from '@babel/core' +import { resolveFile } from '@redwoodjs/internal' + const getNewPath = (value: string, filename: string): string | null => { const dirname = path.dirname(value) const basename = path.basename(value) diff --git a/packages/core/src/babelPlugins/babel-plugin-redwood-import-dir.ts b/packages/core/src/babelPlugins/babel-plugin-redwood-import-dir.ts index 71a1a52a78f8..5ecebf3302db 100644 --- a/packages/core/src/babelPlugins/babel-plugin-redwood-import-dir.ts +++ b/packages/core/src/babelPlugins/babel-plugin-redwood-import-dir.ts @@ -1,7 +1,7 @@ import path from 'path' -import glob from 'glob' import type { PluginObj, types } from '@babel/core' +import glob from 'glob' import { generateTypeDef, generateTypeDefIndex } from './generateTypes' diff --git a/packages/core/src/babelPlugins/babel-plugin-redwood-mock-cell-data.ts b/packages/core/src/babelPlugins/babel-plugin-redwood-mock-cell-data.ts index 03354f633849..aa0c127fbc91 100644 --- a/packages/core/src/babelPlugins/babel-plugin-redwood-mock-cell-data.ts +++ b/packages/core/src/babelPlugins/babel-plugin-redwood-mock-cell-data.ts @@ -1,6 +1,7 @@ import path from 'path' import type { PluginObj, types } from '@babel/core' + // TODO: Figure out why Wallaby doesn't work with a normal import. import { getBaseDirFromFile } from '@redwoodjs/internal/dist/paths' import { getProject, URL_file } from '@redwoodjs/structure' diff --git a/packages/core/src/babelPlugins/babel-plugin-redwood-routes-auto-loader.ts b/packages/core/src/babelPlugins/babel-plugin-redwood-routes-auto-loader.ts index 518884eecebb..2e0dba71ef2b 100644 --- a/packages/core/src/babelPlugins/babel-plugin-redwood-routes-auto-loader.ts +++ b/packages/core/src/babelPlugins/babel-plugin-redwood-routes-auto-loader.ts @@ -1,9 +1,10 @@ import type { PluginObj, types } from '@babel/core' import { processPagesDir } from '@redwoodjs/internal' -import { generateTypeDef, generateTypeDefIndex } from './generateTypes' import { RWProject } from '@redwoodjs/structure' +import { generateTypeDef, generateTypeDefIndex } from './generateTypes' + interface PluginOptions { project: RWProject } diff --git a/packages/core/src/configs/node/jest.setup.js b/packages/core/src/configs/node/jest.setup.js index 2330a1f7c452..deaa0b1428c4 100644 --- a/packages/core/src/configs/node/jest.setup.js +++ b/packages/core/src/configs/node/jest.setup.js @@ -1,6 +1,7 @@ const path = require('path') const camelCase = require('lodash/camelCase') + const { getPaths } = require('@redwoodjs/internal') const redwoodPaths = getPaths() diff --git a/packages/core/src/storybook/StorybookProvider.tsx b/packages/core/src/storybook/StorybookProvider.tsx index c1df56585632..980230182470 100644 --- a/packages/core/src/storybook/StorybookProvider.tsx +++ b/packages/core/src/storybook/StorybookProvider.tsx @@ -1,4 +1,5 @@ import { useEffect, useState } from 'react' + import { MockProviders, startMSW, diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 775e33516f48..da02f5ce2d1e 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -5,6 +5,9 @@ "rootDir": "src", "tsBuildInfoFile": "dist/tsconfig.tsbuildinfo", "outDir": "dist", + "paths": { + "src/*": ["./src/*"] + } }, "include": ["src"], "references": [ diff --git a/packages/create-redwood-app/src/create-redwood-app.js b/packages/create-redwood-app/src/create-redwood-app.js index e2534a868f7f..5b6096cb1da7 100644 --- a/packages/create-redwood-app/src/create-redwood-app.js +++ b/packages/create-redwood-app/src/create-redwood-app.js @@ -9,13 +9,13 @@ import fs from 'fs' import path from 'path' -import decompress from 'decompress' import axios from 'axios' -import Listr from 'listr' +import chalk from 'chalk' +import checkNodeVersion from 'check-node-version' +import decompress from 'decompress' import execa from 'execa' +import Listr from 'listr' import tmp from 'tmp' -import checkNodeVersion from 'check-node-version' -import chalk from 'chalk' import yargs from 'yargs' import { name, version } from '../package' diff --git a/packages/dev-server/src/http.ts b/packages/dev-server/src/http.ts index 3eca786b7979..d6d9a2f32664 100644 --- a/packages/dev-server/src/http.ts +++ b/packages/dev-server/src/http.ts @@ -1,7 +1,7 @@ +import bodyParser from 'body-parser' import type { Response, Request } from 'express' import express from 'express' import morgan from 'morgan' -import bodyParser from 'body-parser' export interface Lambdas { [path: string]: any diff --git a/packages/dev-server/src/main.ts b/packages/dev-server/src/main.ts index 44eb2701ba5d..50c0cfff8044 100644 --- a/packages/dev-server/src/main.ts +++ b/packages/dev-server/src/main.ts @@ -1,12 +1,13 @@ #!/usr/bin/env node import yargs from 'yargs' + import { getConfig, getPaths } from '@redwoodjs/internal' import type { NodeTargetPaths } from '@redwoodjs/internal' +import { handleError } from './error' import { server, setLambdaFunctions } from './http' -import { watchFunctions } from './watchApiSide' import { requestHandler } from './requestHandlers/awsLambda' -import { handleError } from './error' +import { watchFunctions } from './watchApiSide' // TODO: Expand the sides once that concept is introduced. export const getArgsForSide = ( diff --git a/packages/dev-server/src/watchApiSide.ts b/packages/dev-server/src/watchApiSide.ts index 7efa9336cec9..a7db48971dc1 100644 --- a/packages/dev-server/src/watchApiSide.ts +++ b/packages/dev-server/src/watchApiSide.ts @@ -6,11 +6,12 @@ import path from 'path' -import type { NodeTargetPaths } from '@redwoodjs/internal' -import chokidar from 'chokidar' import babelRequireHook from '@babel/register' +import chokidar from 'chokidar' import requireDir from 'require-dir' +import type { NodeTargetPaths } from '@redwoodjs/internal' + const WATCHER_IGNORE_EXTENSIONS = ['.db', '.sqlite', '-journal'] export interface Functions { diff --git a/packages/dev-server/tsconfig.json b/packages/dev-server/tsconfig.json index 726a918b621e..0698d039699d 100644 --- a/packages/dev-server/tsconfig.json +++ b/packages/dev-server/tsconfig.json @@ -5,6 +5,9 @@ "rootDir": "src", "tsBuildInfoFile": "dist/tsconfig.tsbuildinfo", "outDir": "dist", + "paths": { + "src/*": ["./src/*"] + } }, "include": ["src", "ambient.d.ts"], "references": [{ "path": "../internal" }] diff --git a/packages/forms/src/__tests__/form.test.tsx b/packages/forms/src/__tests__/form.test.tsx index 7729122efba8..f3d0cd2c522a 100644 --- a/packages/forms/src/__tests__/form.test.tsx +++ b/packages/forms/src/__tests__/form.test.tsx @@ -1,5 +1,6 @@ import React from 'react' -import userEvent from '@testing-library/user-event' + +import { toHaveFocus } from '@testing-library/jest-dom/matchers' import { screen, render, @@ -7,7 +8,7 @@ import { fireEvent, waitFor, } from '@testing-library/react' -import { toHaveFocus } from '@testing-library/jest-dom/matchers' +import userEvent from '@testing-library/user-event' expect.extend({ toHaveFocus }) import { diff --git a/packages/forms/src/coercion.tsx b/packages/forms/src/coercion.tsx index 7ffb271cd2ba..3de0185117b0 100644 --- a/packages/forms/src/coercion.tsx +++ b/packages/forms/src/coercion.tsx @@ -64,9 +64,10 @@ export const useCoercion = () => { if (transformValue) { coercionFunction = COERCION_FUNCTIONS[transformValue] } else if (type && inputTypeToDataTypeMapping[type]) { - coercionFunction = COERCION_FUNCTIONS[inputTypeToDataTypeMapping[type]] + coercionFunction = + COERCION_FUNCTIONS[inputTypeToDataTypeMapping[type]] } else { - coercionFunction = ((value) => value) + coercionFunction = (value) => value } } diff --git a/packages/forms/src/index.tsx b/packages/forms/src/index.tsx index f86ee9b50ef8..29693629ae87 100644 --- a/packages/forms/src/index.tsx +++ b/packages/forms/src/index.tsx @@ -1,4 +1,6 @@ import React, { useContext, useEffect, forwardRef } from 'react' + +import pascalcase from 'pascalcase' import { useForm, FormProvider, @@ -7,7 +9,6 @@ import { UseFormMethods, UseFormOptions, } from 'react-hook-form' -import pascalcase from 'pascalcase' import { CoercionContextProvider, diff --git a/packages/internal/package.json b/packages/internal/package.json index 995fed15ae03..73086581d01b 100644 --- a/packages/internal/package.json +++ b/packages/internal/package.json @@ -25,7 +25,7 @@ "build": "yarn build:js && yarn build:types", "prepublishOnly": "yarn cross-env NODE_ENV=production yarn build", "build:js": "babel src -d dist --extensions \".js,.ts,.tsx\"", - "build:types": "tsc --build --verbose", + "build:types": "ttsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,ts,tsx\" --ignore dist --exec \"yarn build\"", "test": "jest", "test:watch": "yarn test --watch" diff --git a/packages/internal/src/paths.ts b/packages/internal/src/paths.ts index c53d310806f6..5c87b9cbaaae 100644 --- a/packages/internal/src/paths.ts +++ b/packages/internal/src/paths.ts @@ -1,5 +1,5 @@ -import path from 'path' import fs from 'fs' +import path from 'path' import findUp from 'findup-sync' diff --git a/packages/internal/tsconfig.json b/packages/internal/tsconfig.json index 1c931e5cc0f4..59a08836e960 100644 --- a/packages/internal/tsconfig.json +++ b/packages/internal/tsconfig.json @@ -5,6 +5,9 @@ "rootDir": "src", "tsBuildInfoFile": "dist/tsconfig.tsbuildinfo", "outDir": "dist", + "paths": { + "src/*": ["./src/*"] + } }, "include": ["src", "./ambient.d.ts"], } diff --git a/packages/router/src/__tests__/links.test.js b/packages/router/src/__tests__/links.test.js index ebbfa06077d9..c0d0d8c1bab7 100644 --- a/packages/router/src/__tests__/links.test.js +++ b/packages/router/src/__tests__/links.test.js @@ -1,6 +1,6 @@ +import { toHaveClass, toHaveStyle } from '@testing-library/jest-dom/matchers' import { render } from '@testing-library/react' // TODO: Remove when jest configs are in place -import { toHaveClass, toHaveStyle } from '@testing-library/jest-dom/matchers' expect.extend({ toHaveClass, toHaveStyle }) import { NavLink, useMatch, Link } from '../links' diff --git a/packages/router/src/links.js b/packages/router/src/links.js index e58b27e3b9ce..1f09420f6c2f 100644 --- a/packages/router/src/links.js +++ b/packages/router/src/links.js @@ -1,4 +1,5 @@ import { forwardRef, useEffect } from 'react' + import PropTypes from 'prop-types' import { navigate, matchPath, useLocation } from './internal' diff --git a/packages/router/src/page-loader.js b/packages/router/src/page-loader.js index 82ad625836ed..900239358c33 100644 --- a/packages/router/src/page-loader.js +++ b/packages/router/src/page-loader.js @@ -1,4 +1,5 @@ import { useContext } from 'react' + import isEqual from 'lodash.isequal' import { createNamedContext, ParamsContext } from './internal' diff --git a/packages/router/src/router.js b/packages/router/src/router.js index 4eb6c7f96a44..3287aa3219d9 100644 --- a/packages/router/src/router.js +++ b/packages/router/src/router.js @@ -12,7 +12,6 @@ import { PageLoader, Redirect, } from './internal' - import { SplashPage } from './splash-page' const Route = () => { diff --git a/packages/structure/package.json b/packages/structure/package.json index a2c171ec6038..8ab239431678 100644 --- a/packages/structure/package.json +++ b/packages/structure/package.json @@ -41,7 +41,6 @@ "eslintConfig": { "extends": "@redwoodjs/eslint-config", "rules": { - "import/order": "off", "@typescript-eslint/no-this-alias": "off", "@typescript-eslint/no-non-null-assertion": "off", "no-case-declarations": "off", @@ -60,7 +59,7 @@ "build": "yarn build:js && yarn build:types", "prepublishOnly": "yarn cross-env NODE_ENV=production yarn build", "build:js": "babel src -d dist --extensions \".js,.ts,.tsx\"", - "build:types": "tsc --build --verbose", + "build:types": "ttsc --build --verbose", "build:watch": "nodemon --watch src --ext \"js,ts,tsx\" --ignore dist --exec \"yarn build\"", "test": "jest", "test:watch": "yarn test --watch", diff --git a/packages/structure/src/ide.ts b/packages/structure/src/ide.ts index 3bbe7f900fa3..e8ed484a4b75 100644 --- a/packages/structure/src/ide.ts +++ b/packages/structure/src/ide.ts @@ -1,4 +1,5 @@ import { basename } from 'path' + import * as tsm from 'ts-morph' import { TextDocuments } from 'vscode-languageserver' import { TextDocument } from 'vscode-languageserver-textdocument' @@ -9,13 +10,14 @@ import { Location, Range, } from 'vscode-languageserver-types' + +import { Host, DefaultHost } from './hosts' import { ArrayLike, ArrayLike_normalize } from './x/Array' import { lazy, memo } from './x/decorators' import { basenameNoExt } from './x/path' import { createTSMSourceFile_cached } from './x/ts-morph' import { URL_file } from './x/URL' import { ExtendedDiagnostic } from './x/vscode-languageserver-types' -import { Host, DefaultHost } from './hosts' export type NodeID = string diff --git a/packages/structure/src/interactive_cli/RedwoodCommandString.ts b/packages/structure/src/interactive_cli/RedwoodCommandString.ts index 5bb555ddabe3..4a7c605e8499 100644 --- a/packages/structure/src/interactive_cli/RedwoodCommandString.ts +++ b/packages/structure/src/interactive_cli/RedwoodCommandString.ts @@ -1,4 +1,5 @@ import yargs_parser from 'yargs-parser' + import { lazy } from '../x/decorators' /** diff --git a/packages/structure/src/interactive_cli/command_builder.ts b/packages/structure/src/interactive_cli/command_builder.ts index 763bdaf2a6ce..05ef6ad013c7 100644 --- a/packages/structure/src/interactive_cli/command_builder.ts +++ b/packages/structure/src/interactive_cli/command_builder.ts @@ -1,7 +1,9 @@ import camelcase from 'camelcase' + import { RWProject } from '../model/RWProject' import { validateRoutePath } from '../util' import { lazy, memo } from '../x/decorators' + import { RedwoodCommandString } from './RedwoodCommandString' import { UI } from './ui' diff --git a/packages/structure/src/interactive_cli/dry_run.ts b/packages/structure/src/interactive_cli/dry_run.ts index 4bb72a41baff..bc3c62a3b32e 100644 --- a/packages/structure/src/interactive_cli/dry_run.ts +++ b/packages/structure/src/interactive_cli/dry_run.ts @@ -1,7 +1,10 @@ -import { outputFileSync } from 'fs-extra' import { join } from 'path' + +import { outputFileSync } from 'fs-extra' import proxyquire from 'proxyquire' + import { spawnCancellable } from '../x/child_process' + import { RedwoodCommandString } from './RedwoodCommandString' export type FileSet = { [filePath: string]: string | null } diff --git a/packages/structure/src/interactive_cli/ui.ts b/packages/structure/src/interactive_cli/ui.ts index 8266adbcd673..4c26ef2b04a2 100644 --- a/packages/structure/src/interactive_cli/ui.ts +++ b/packages/structure/src/interactive_cli/ui.ts @@ -1,4 +1,5 @@ import enquirer from 'enquirer' + import { VSCodeWindowMethods } from '../x/vscode' export type UIPickItem = { diff --git a/packages/structure/src/language_server/RWLanguageServer.ts b/packages/structure/src/language_server/RWLanguageServer.ts index 6837330a739a..480a67772142 100644 --- a/packages/structure/src/language_server/RWLanguageServer.ts +++ b/packages/structure/src/language_server/RWLanguageServer.ts @@ -7,6 +7,7 @@ import { } from 'vscode-languageserver' import { TextDocument } from 'vscode-languageserver-textdocument' import { CodeAction } from 'vscode-languageserver-types' + import { HostWithDocumentsStore, IDEInfo } from '../ide' import { RWProject } from '../model' import { lazy, memo } from '../x/decorators' @@ -17,6 +18,7 @@ import { ExtendedDiagnostic_findRelevantQuickFixes, Range_contains, } from '../x/vscode-languageserver-types' + import { CommandsManager } from './commands' import { DiagnosticsManager } from './diagnostics' import { OutlineManager } from './outline' diff --git a/packages/structure/src/language_server/commands.ts b/packages/structure/src/language_server/commands.ts index 664f2959330b..c6330016da94 100644 --- a/packages/structure/src/language_server/commands.ts +++ b/packages/structure/src/language_server/commands.ts @@ -1,4 +1,5 @@ import { ExecuteCommandOptions } from 'vscode-languageserver' + import { command_builder } from '../interactive_cli/command_builder' import { redwood_gen_dry_run as dry_run } from '../interactive_cli/dry_run' import { RedwoodCommandString } from '../interactive_cli/RedwoodCommandString' @@ -10,6 +11,7 @@ import { FileSet_fromTextDocuments, WorkspaceEdit_fromFileSet, } from '../x/vscode-languageserver-types' + import { RWLanguageServer } from './RWLanguageServer' export const redwoodjs_commands = { diff --git a/packages/structure/src/language_server/diagnostics.ts b/packages/structure/src/language_server/diagnostics.ts index 2cd146a377ac..f08ac49c77c5 100644 --- a/packages/structure/src/language_server/diagnostics.ts +++ b/packages/structure/src/language_server/diagnostics.ts @@ -1,5 +1,6 @@ import { debounce, memo } from '../x/decorators' import { ExtendedDiagnostic_groupByUri } from '../x/vscode-languageserver-types' + import { RWLanguageServer } from './RWLanguageServer' const REFRESH_DIAGNOSTICS_INTERVAL = 5000 diff --git a/packages/structure/src/language_server/outline.ts b/packages/structure/src/language_server/outline.ts index 8732084d2826..533744dfdf21 100644 --- a/packages/structure/src/language_server/outline.ts +++ b/packages/structure/src/language_server/outline.ts @@ -4,6 +4,7 @@ import { RemoteTreeDataProviderImpl, RemoteTreeDataProvider_publishOverLSPConnection, } from '../x/vscode' + import { RWLanguageServer } from './RWLanguageServer' export class OutlineManager { diff --git a/packages/structure/src/language_server/xmethods.ts b/packages/structure/src/language_server/xmethods.ts index e0b03c2c8b82..5aaab0043352 100644 --- a/packages/structure/src/language_server/xmethods.ts +++ b/packages/structure/src/language_server/xmethods.ts @@ -1,4 +1,5 @@ import { memo } from '../x/decorators' + import { RWLanguageServer } from './RWLanguageServer' /** diff --git a/packages/structure/src/model/RWCell.ts b/packages/structure/src/model/RWCell.ts index cfea786207cc..d4211b804e7e 100644 --- a/packages/structure/src/model/RWCell.ts +++ b/packages/structure/src/model/RWCell.ts @@ -1,12 +1,14 @@ import { parse as parseGraphQL } from 'graphql' import * as tsm from 'ts-morph' import { DiagnosticSeverity } from 'vscode-languageserver-types' + import { lazy } from '../x/decorators' import { err, ExtendedDiagnostic, Range_fromNode, } from '../x/vscode-languageserver-types' + import { RWComponent } from './RWComponent' export class RWCell extends RWComponent { diff --git a/packages/structure/src/model/RWComponent.ts b/packages/structure/src/model/RWComponent.ts index b9cd60e5d59a..462dab81d8a1 100644 --- a/packages/structure/src/model/RWComponent.ts +++ b/packages/structure/src/model/RWComponent.ts @@ -1,6 +1,8 @@ import * as tsm from 'ts-morph' + import { FileNode } from '../ide' import { lazy } from '../x/decorators' + import { RWProject } from './RWProject' export class RWComponent extends FileNode { diff --git a/packages/structure/src/model/RWEnvHelper.ts b/packages/structure/src/model/RWEnvHelper.ts index c928fff63799..d4f45c22d745 100644 --- a/packages/structure/src/model/RWEnvHelper.ts +++ b/packages/structure/src/model/RWEnvHelper.ts @@ -1,20 +1,23 @@ +import { join } from 'path' + import * as dotenv from 'dotenv-defaults' import { existsSync, readFileSync } from 'fs-extra' import { pickBy } from 'lodash' -import { join } from 'path' +import * as tsm from 'ts-morph' +import { DiagnosticSeverity, Location, Range } from 'vscode-languageserver' + +import { BaseNode, CodeLensX, Definition, HoverX, Reference } from 'src/ide' +import { lazy } from 'src/x/decorators' import { prisma_parseEnvExpressionsInFile } from 'src/x/prisma' import { URL_file } from 'src/x/URL' import { Command_open } from 'src/x/vscode' -import * as tsm from 'ts-morph' -import { DiagnosticSeverity, Location, Range } from 'vscode-languageserver' -import { BaseNode, CodeLensX, Definition, HoverX, Reference } from '../ide' -import { lazy } from '../x/decorators' import { ExtendedDiagnostic, ExtendedDiagnostic_is, LocationLike_toHashLink, LocationLike_toLocation, -} from '../x/vscode-languageserver-types' +} from 'src/x/vscode-languageserver-types' + import { RWProject } from './RWProject' import { process_env_findAll } from './util/process_env' diff --git a/packages/structure/src/model/RWFunction.ts b/packages/structure/src/model/RWFunction.ts index bdde4374f663..12d691ebbdf8 100644 --- a/packages/structure/src/model/RWFunction.ts +++ b/packages/structure/src/model/RWFunction.ts @@ -1,4 +1,5 @@ import { FileNode } from '../ide' + import { RWProject } from './RWProject' /** * functions exist in the /functions folder diff --git a/packages/structure/src/model/RWLayout.ts b/packages/structure/src/model/RWLayout.ts index 4c2039505231..0e9d20b9a32a 100644 --- a/packages/structure/src/model/RWLayout.ts +++ b/packages/structure/src/model/RWLayout.ts @@ -1,4 +1,5 @@ import { FileNode } from '../ide' + import { RWProject } from './RWProject' /** * layouts live in the src/layouts folder diff --git a/packages/structure/src/model/RWPage.ts b/packages/structure/src/model/RWPage.ts index b9c9247db2c8..77564678e95d 100644 --- a/packages/structure/src/model/RWPage.ts +++ b/packages/structure/src/model/RWPage.ts @@ -1,8 +1,11 @@ import { dirname } from 'path' + import * as tsm from 'ts-morph' + import { FileNode } from '../ide' import { lazy } from '../x/decorators' import { directoryNameResolver } from '../x/path' + import { RWProject } from './RWProject' export class RWPage extends FileNode { diff --git a/packages/structure/src/model/RWProject.ts b/packages/structure/src/model/RWProject.ts index 6566ff7e87a3..23e295ae3736 100644 --- a/packages/structure/src/model/RWProject.ts +++ b/packages/structure/src/model/RWProject.ts @@ -1,7 +1,10 @@ +import { join } from 'path' + import { getDMMF } from '@prisma/sdk' + // TODO: re-implement a higher quality version of these in ./project import { getPaths, processPagesDir } from '@redwoodjs/internal/dist/paths' -import { join } from 'path' + import { Host } from '../hosts' import { BaseNode } from '../ide' import { lazy, memo } from '../x/decorators' @@ -11,6 +14,7 @@ import { isLayoutFileName, } from '../x/path' import { URL_file } from '../x/URL' + import { RWCell } from './RWCell' import { RWComponent } from './RWComponent' import { RWEnvHelper } from './RWEnvHelper' diff --git a/packages/structure/src/model/RWRoute.ts b/packages/structure/src/model/RWRoute.ts index 256773dea43b..7485dad341bb 100644 --- a/packages/structure/src/model/RWRoute.ts +++ b/packages/structure/src/model/RWRoute.ts @@ -1,6 +1,8 @@ import { basename } from 'path' + import * as tsm from 'ts-morph' import { Location, Range } from 'vscode-languageserver-types' + import { RWError } from '../errors' import { BaseNode, Decoration, Definition, DocumentLinkX, HoverX } from '../ide' import { validateRoutePath } from '../util' @@ -14,6 +16,7 @@ import { Position_translate, Range_fromNode, } from '../x/vscode-languageserver-types' + import { RWRouter } from './RWRouter' import { advanced_path_parser } from './util/advanced_path_parser' diff --git a/packages/structure/src/model/RWRouter.ts b/packages/structure/src/model/RWRouter.ts index fa7e438ca9cc..45d69ec47ed7 100644 --- a/packages/structure/src/model/RWRouter.ts +++ b/packages/structure/src/model/RWRouter.ts @@ -1,3 +1,4 @@ +import { rangeRight } from 'lodash' import * as tsm from 'ts-morph' import { CodeAction, @@ -7,6 +8,7 @@ import { Position, WorkspaceChange, } from 'vscode-languageserver-types' + import { RWError } from '../errors' import { CodeLensX, FileNode } from '../ide' import { iter } from '../x/Array' @@ -18,9 +20,9 @@ import { LocationLike_toLocation, Location_fromNode, } from '../x/vscode-languageserver-types' + import { RWProject } from './RWProject' import { RWRoute } from './RWRoute' -import { rangeRight } from 'lodash' /** * one per Routes.js diff --git a/packages/structure/src/model/RWSDL.ts b/packages/structure/src/model/RWSDL.ts index f2e0c5ae318a..1c1566a52431 100644 --- a/packages/structure/src/model/RWSDL.ts +++ b/packages/structure/src/model/RWSDL.ts @@ -1,11 +1,14 @@ -import { parse as parseGraphQL } from 'graphql/language/parser' import { basename } from 'path' + +import { parse as parseGraphQL } from 'graphql/language/parser' import * as tsm from 'ts-morph' + import { RWError } from '../errors' import { FileNode } from '../ide' import { iter } from '../x/Array' import { lazy } from '../x/decorators' import { err } from '../x/vscode-languageserver-types' + import { RWProject } from './RWProject' import { RWSDLField } from './RWSDLField' diff --git a/packages/structure/src/model/RWSDLField.ts b/packages/structure/src/model/RWSDLField.ts index d48fbdca04db..28bc57011ac3 100644 --- a/packages/structure/src/model/RWSDLField.ts +++ b/packages/structure/src/model/RWSDLField.ts @@ -2,7 +2,6 @@ import { FieldDefinitionNode, ObjectTypeDefinitionNode, } from 'graphql/language/ast' -import { URL_file } from '../x/URL' import { CodeAction, DiagnosticSeverity, @@ -10,14 +9,17 @@ import { Position, WorkspaceChange, } from 'vscode-languageserver-types' + import { RWError } from '../errors' import { BaseNode, Implementation } from '../ide' import { lazy } from '../x/decorators' +import { URL_file } from '../x/URL' import { ExtendedDiagnostic, Location_fromNode, Position_fromTSMorphOffset, } from '../x/vscode-languageserver-types' + import { RWSDL } from './RWSDL' import { RWServiceFunction } from './RWServiceFunction' diff --git a/packages/structure/src/model/RWService.ts b/packages/structure/src/model/RWService.ts index 588c3d8f132f..83a60ed82002 100644 --- a/packages/structure/src/model/RWService.ts +++ b/packages/structure/src/model/RWService.ts @@ -1,8 +1,10 @@ import * as tsm from 'ts-morph' + import { FileNode } from '../ide' import { iter } from '../x/Array' import { lazy } from '../x/decorators' import { basenameNoExt } from '../x/path' + import { RWProject } from './RWProject' import { RWSDL } from './RWSDL' import { RWServiceFunction } from './RWServiceFunction' diff --git a/packages/structure/src/model/RWServiceFunction.ts b/packages/structure/src/model/RWServiceFunction.ts index 02af7575b17e..1996ca435b78 100644 --- a/packages/structure/src/model/RWServiceFunction.ts +++ b/packages/structure/src/model/RWServiceFunction.ts @@ -1,5 +1,6 @@ import * as tsm from 'ts-morph' import { DiagnosticSeverity } from 'vscode-languageserver-types' + import { BaseNode } from '../ide' import { iter } from '../x/Array' import { lazy } from '../x/decorators' @@ -7,6 +8,7 @@ import { ExtendedDiagnostic, Location_fromNode, } from '../x/vscode-languageserver-types' + import { RWSDLField } from './RWSDLField' import { RWService } from './RWService' diff --git a/packages/structure/src/model/RWTOML.ts b/packages/structure/src/model/RWTOML.ts index 9a7a65df3d57..d112e14305f1 100644 --- a/packages/structure/src/model/RWTOML.ts +++ b/packages/structure/src/model/RWTOML.ts @@ -1,8 +1,10 @@ import { parse as parseTOML } from 'toml' import { Range } from 'vscode-languageserver-types' + import { FileNode } from '../ide' import { lazy } from '../x/decorators' import { err } from '../x/vscode-languageserver-types' + import { RWProject } from './RWProject' export class RWTOML extends FileNode { diff --git a/packages/structure/src/model/__tests__/model.test.ts b/packages/structure/src/model/__tests__/model.test.ts index 941e2376a2d6..801c5482bec1 100644 --- a/packages/structure/src/model/__tests__/model.test.ts +++ b/packages/structure/src/model/__tests__/model.test.ts @@ -1,4 +1,5 @@ import { basename, resolve } from 'path' + import { DefaultHost } from '../../hosts' import { URL_file } from '../../x/URL' import { RWProject } from '../RWProject' diff --git a/packages/structure/src/model/util/__tests__/process_env_diagnostics.test.ts b/packages/structure/src/model/util/__tests__/process_env_diagnostics.test.ts index f395811b445b..4000b7fcc0e9 100644 --- a/packages/structure/src/model/util/__tests__/process_env_diagnostics.test.ts +++ b/packages/structure/src/model/util/__tests__/process_env_diagnostics.test.ts @@ -1,6 +1,7 @@ -import { process_env_findInFile, process_env_findAll } from '../process_env' import { resolve, join } from 'path' +import { process_env_findInFile, process_env_findAll } from '../process_env' + describe('process_env_findInFile', () => { test('can find process.env.FOO', () => { const code = ` diff --git a/packages/structure/src/model/util/process_env.ts b/packages/structure/src/model/util/process_env.ts index a17bb5b1b4b3..760a5ff226b8 100644 --- a/packages/structure/src/model/util/process_env.ts +++ b/packages/structure/src/model/util/process_env.ts @@ -1,9 +1,11 @@ -import glob from 'glob' import { join } from 'path' + +import { readFileSync } from 'fs-extra' +import glob from 'glob' import * as tsm from 'ts-morph' + import { iter } from '../../x/Array' import { createTSMSourceFile_cached } from '../../x/ts-morph' -import { readFileSync } from 'fs-extra' export function process_env_findAll(dir: string) { return iter(function* () { diff --git a/packages/structure/src/outline/__tests__/outline.test.ts b/packages/structure/src/outline/__tests__/outline.test.ts index 9e8777c43c72..9fd60e83c2b3 100644 --- a/packages/structure/src/outline/__tests__/outline.test.ts +++ b/packages/structure/src/outline/__tests__/outline.test.ts @@ -1,7 +1,8 @@ import { resolve } from 'path' + import { DefaultHost } from '../../hosts' -import { getOutline } from '../outline' import { RWProject } from '../../model' +import { getOutline } from '../outline' import { outlineToJSON } from '../types' describe('Redwood Project Outline', () => { diff --git a/packages/structure/src/x/__tests__/URL.test.ts b/packages/structure/src/x/__tests__/URL.test.ts index 30cb17d59cfd..e3ed431060b1 100644 --- a/packages/structure/src/x/__tests__/URL.test.ts +++ b/packages/structure/src/x/__tests__/URL.test.ts @@ -1,4 +1,5 @@ import { sep } from 'path' + import { URL_file, URL_toFile } from '../URL' describe('URL_fromFile', () => { diff --git a/packages/structure/src/x/__tests__/prisma.test.ts b/packages/structure/src/x/__tests__/prisma.test.ts index 974526616e10..7fa27b97de39 100644 --- a/packages/structure/src/x/__tests__/prisma.test.ts +++ b/packages/structure/src/x/__tests__/prisma.test.ts @@ -1,6 +1,7 @@ -import { prisma_parseEnvExpressions } from '../prisma' import { Range } from 'vscode-languageserver' +import { prisma_parseEnvExpressions } from '../prisma' + describe('prisma_parseEnvExpressions', () => { it('can find env() expressions in a prisma schema', async () => { const [r] = Array.from(prisma_parseEnvExpressions(`env("foo") `)) diff --git a/packages/structure/src/x/__tests__/vscode-languageserver-types-x.test.ts b/packages/structure/src/x/__tests__/vscode-languageserver-types-x.test.ts index 127cac65b199..fa7d583191a9 100644 --- a/packages/structure/src/x/__tests__/vscode-languageserver-types-x.test.ts +++ b/packages/structure/src/x/__tests__/vscode-languageserver-types-x.test.ts @@ -3,6 +3,7 @@ import { Position, Range, } from 'vscode-languageserver-types' + import { ExtendedDiagnostic, ExtendedDiagnostic_format, diff --git a/packages/structure/src/x/prisma.ts b/packages/structure/src/x/prisma.ts index e9d791bafa8d..b968aa5bc60e 100644 --- a/packages/structure/src/x/prisma.ts +++ b/packages/structure/src/x/prisma.ts @@ -1,5 +1,6 @@ import { existsSync, readFileSync } from 'fs-extra' import { Location, Range } from 'vscode-languageserver' + import { URL_file, URL_toFile } from './URL' import { Position_fromOffsetOrFail } from './vscode-languageserver-types' diff --git a/packages/structure/src/x/ts-morph.ts b/packages/structure/src/x/ts-morph.ts index 677bc137bee7..6557dc10f659 100644 --- a/packages/structure/src/x/ts-morph.ts +++ b/packages/structure/src/x/ts-morph.ts @@ -1,4 +1,5 @@ import * as crypto from 'crypto' + import { memoize } from 'lodash' import LRU from 'lru-cache' import * as tsm from 'ts-morph' diff --git a/packages/structure/src/x/vscode-languageserver-types.ts b/packages/structure/src/x/vscode-languageserver-types.ts index f2531db366d4..c75bc6cc4066 100644 --- a/packages/structure/src/x/vscode-languageserver-types.ts +++ b/packages/structure/src/x/vscode-languageserver-types.ts @@ -15,6 +15,7 @@ import { WorkspaceChange, WorkspaceEdit, } from 'vscode-languageserver-types' + import { URL_file } from './URL' export function Range_contains(range: Range, pos: Position): boolean { diff --git a/packages/structure/src/x/vscode.ts b/packages/structure/src/x/vscode.ts index 0485cfd54009..87cd80584b9c 100644 --- a/packages/structure/src/x/vscode.ts +++ b/packages/structure/src/x/vscode.ts @@ -3,11 +3,12 @@ // vscode is a compile-time only dependency // we only use it in type declarations // (we can't use "import type" since we need to do use it in some typeof expressions) +import { memoize } from 'lodash' import * as vscode from 'vscode' import { Connection as LSPConnection } from 'vscode-languageserver' import { Command, Location } from 'vscode-languageserver-types' + import { lazy, memo } from '../x/decorators' -import { memoize } from 'lodash' export type VSCodeWindowMethods = Pick< typeof vscode.window, diff --git a/packages/structure/tsconfig.json b/packages/structure/tsconfig.json index 0c92b1c05d44..72f51af6e8c0 100644 --- a/packages/structure/tsconfig.json +++ b/packages/structure/tsconfig.json @@ -5,6 +5,9 @@ "rootDir": "src", "tsBuildInfoFile": "dist/tsconfig.tsbuildinfo", "outDir": "dist", + "paths": { + "src/*": ["./src/*"] + }, "experimentalDecorators": true, "noImplicitReturns": false, "noImplicitAny": false, diff --git a/packages/testing/package.json b/packages/testing/package.json index cef15f365d48..a684f7697a73 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -18,7 +18,7 @@ "build": "yarn build:js && yarn build:types", "prepublishOnly": "yarn cross-env NODE_ENV=production yarn build", "build:js": "babel src -d dist --extensions \".js,.ts,.tsx\"", - "build:types": "tsc --build --verbose", + "build:types": "ttsc --build --verbose", "build:watch": "nodemon --watch src --ext 'js,ts,tsx' --ignore dist --exec 'yarn build'", "test": "jest", "test:watch": "yarn test --watch" diff --git a/packages/testing/src/MockProviders.tsx b/packages/testing/src/MockProviders.tsx index fd689b36cf1c..1627b3adbd73 100644 --- a/packages/testing/src/MockProviders.tsx +++ b/packages/testing/src/MockProviders.tsx @@ -3,8 +3,9 @@ * because it's also used by Storybook in the browser. */ import React from 'react' -import { RedwoodProvider } from '@redwoodjs/web' + import type { AuthContextInterface } from '@redwoodjs/auth' +import { RedwoodProvider } from '@redwoodjs/web' // Import the user's Router from `./web/src/Router.{tsx,js}`, // we pass the `children` from the user's Router to `./MockRouter.Router` diff --git a/packages/testing/src/MockRouter.tsx b/packages/testing/src/MockRouter.tsx index ecc5f0982b43..d0f9e2925b43 100644 --- a/packages/testing/src/MockRouter.tsx +++ b/packages/testing/src/MockRouter.tsx @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/ban-ts-comment */ import React from 'react' + // Bypass the `main` field in `package.json` because we alias `@redwoodjs/router` // for jest and Storybook. Not doing so would cause an infinite loop. // See: ./packages/core/config/jest.config.web.js diff --git a/packages/testing/src/__tests__/MockRouter.test.tsx b/packages/testing/src/__tests__/MockRouter.test.tsx index 7e699b1bc397..a2b0ee10af23 100644 --- a/packages/testing/src/__tests__/MockRouter.test.tsx +++ b/packages/testing/src/__tests__/MockRouter.test.tsx @@ -1,6 +1,8 @@ import React from 'react' -import { Route, Private } from '@redwoodjs/router' + import { render, screen, fireEvent, waitFor } from '@testing-library/react' + +import { Route, Private } from '@redwoodjs/router' import '@testing-library/jest-dom/extend-expect' import { routes, Router } from '../MockRouter' diff --git a/packages/testing/src/customRender.tsx b/packages/testing/src/customRender.tsx index e321443a3ddb..776e67b10b79 100644 --- a/packages/testing/src/customRender.tsx +++ b/packages/testing/src/customRender.tsx @@ -1,5 +1,6 @@ -import type { RenderResult } from '@testing-library/react' import React from 'react' + +import type { RenderResult } from '@testing-library/react' import { render } from '@testing-library/react' import { MockProviders } from './MockProviders' diff --git a/packages/testing/tsconfig.json b/packages/testing/tsconfig.json index 73e1f967b131..6cf930367c9e 100644 --- a/packages/testing/tsconfig.json +++ b/packages/testing/tsconfig.json @@ -5,6 +5,9 @@ "rootDir": "src", "tsBuildInfoFile": "dist/tsconfig.tsbuildinfo", "outDir": "dist", + "paths": { + "src/*": ["./src/*"] + } }, "include": [ "src" diff --git a/packages/web/package.json b/packages/web/package.json index 3e9502084f2a..e7859f9254e8 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -24,7 +24,7 @@ "build": "yarn build:js && yarn build:types", "prepublishOnly": "yarn cross-env NODE_ENV=production yarn build", "build:js": "babel src -d dist --extensions \".js,.ts,.tsx\"", - "build:types": "tsc --build --verbose && node ./scripts/postBuild.js", + "build:types": "ttsc --build --verbose && node ./scripts/postBuild.js", "build:watch": "nodemon --watch src --ext \"js,ts,tsx\" --ignore dist --exec \"yarn build\"", "test": "jest", "test:watch": "yarn test --watch" diff --git a/packages/web/scripts/postBuild.js b/packages/web/scripts/postBuild.js index e69b46e056a9..bb88feee6dc7 100644 --- a/packages/web/scripts/postBuild.js +++ b/packages/web/scripts/postBuild.js @@ -1,5 +1,5 @@ -const path = require('path') const fs = require('fs') +const path = require('path') console.warn( 'warning, remove this file "scripts/postBuild.js" once Flash is converted to TypeScript' diff --git a/packages/web/src/components/FetchConfigProvider.test.tsx b/packages/web/src/components/FetchConfigProvider.test.tsx index 31ecf23ad749..302d614f7ae3 100644 --- a/packages/web/src/components/FetchConfigProvider.test.tsx +++ b/packages/web/src/components/FetchConfigProvider.test.tsx @@ -1,5 +1,6 @@ -import type { AuthContextInterface } from '@redwoodjs/auth' import { render, screen, waitFor } from '@testing-library/react' + +import type { AuthContextInterface } from '@redwoodjs/auth' import '@testing-library/jest-dom/extend-expect' window.__REDWOOD__API_PROXY_PATH = 'https://api.example.com' diff --git a/packages/web/src/components/RedwoodApolloProvider.tsx b/packages/web/src/components/RedwoodApolloProvider.tsx index 5f5043239a51..83f678c2b984 100644 --- a/packages/web/src/components/RedwoodApolloProvider.tsx +++ b/packages/web/src/components/RedwoodApolloProvider.tsx @@ -1,4 +1,3 @@ -import type { AuthContextInterface } from '@redwoodjs/auth' import { ApolloProvider, ApolloClientOptions, @@ -8,6 +7,8 @@ import { useMutation, } from '@apollo/client' +import type { AuthContextInterface } from '@redwoodjs/auth' + import { FetchConfigProvider, useFetchConfig, diff --git a/packages/web/src/flash/__tests__/FlashContext.test.js b/packages/web/src/flash/__tests__/FlashContext.test.js index 976a24a58507..27ebd68c256a 100644 --- a/packages/web/src/flash/__tests__/FlashContext.test.js +++ b/packages/web/src/flash/__tests__/FlashContext.test.js @@ -1,6 +1,6 @@ +import { toHaveClass } from '@testing-library/jest-dom/matchers' import { render, fireEvent } from '@testing-library/react' // TODO: Remove when jest configs are in place -import { toHaveClass } from '@testing-library/jest-dom/matchers' expect.extend({ toHaveClass }) import { FlashProvider, useFlash } from 'src/flash/FlashContext' diff --git a/packages/web/src/flash/__tests__/flash.test.js b/packages/web/src/flash/__tests__/flash.test.js index 897804e3ae50..2aeb658bc1ee 100644 --- a/packages/web/src/flash/__tests__/flash.test.js +++ b/packages/web/src/flash/__tests__/flash.test.js @@ -1,7 +1,8 @@ import { useEffect } from 'react' + +import { toHaveClass, toHaveStyle } from '@testing-library/jest-dom/matchers' import { render, cleanup, fireEvent } from '@testing-library/react' // TODO: Remove when jest configs are in place -import { toHaveClass, toHaveStyle } from '@testing-library/jest-dom/matchers' expect.extend({ toHaveClass, toHaveStyle }) import Flash from 'src/flash/Flash' diff --git a/packages/web/src/flash/index.js b/packages/web/src/flash/index.js index e9e09adba992..20f5b33d593e 100644 --- a/packages/web/src/flash/index.js +++ b/packages/web/src/flash/index.js @@ -1,4 +1,4 @@ -import { FlashProvider, useFlash } from './FlashContext' import Flash from './Flash' +import { FlashProvider, useFlash } from './FlashContext' export { FlashProvider, useFlash, Flash } diff --git a/packages/web/src/global.web-auto-imports.ts b/packages/web/src/global.web-auto-imports.ts index 9806223c2d36..f90dae34f40a 100644 --- a/packages/web/src/global.web-auto-imports.ts +++ b/packages/web/src/global.web-auto-imports.ts @@ -1,5 +1,6 @@ -import type _gql from 'graphql-tag' import type _React from 'react' + +import type _gql from 'graphql-tag' import type _PropTypes from 'prop-types' declare global { diff --git a/packages/web/tsconfig.json b/packages/web/tsconfig.json index 3bda2ef0d225..56c47b5c9e8d 100644 --- a/packages/web/tsconfig.json +++ b/packages/web/tsconfig.json @@ -5,6 +5,9 @@ "rootDir": "src", "tsBuildInfoFile": "dist/tsconfig.tsbuildinfo", "outDir": "dist", + "paths": { + "src/*": ["./src/*"] + }, "allowJs": true }, "include": ["./src/**/*"], diff --git a/tsconfig.compilerOption.json b/tsconfig.compilerOption.json index 8ebdff993f01..0035ed7ab0c2 100644 --- a/tsconfig.compilerOption.json +++ b/tsconfig.compilerOption.json @@ -14,6 +14,9 @@ "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "jsx": "preserve", + "plugins": [ + { "transform": "typescript-transform-paths", "afterDeclarations": true } + ] }, "exclude": [ "dist", diff --git a/yarn.lock b/yarn.lock index f57ae9c950d9..d56a9a36273e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11139,6 +11139,13 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" +is-core-module@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.1.0.tgz#a4cc031d9b1aca63eecbd18a650e13cb4eeab946" + integrity sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA== + dependencies: + has "^1.0.3" + is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" @@ -16009,6 +16016,14 @@ resolve-url@^0.2.1: resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= +resolve@>=1.9.0: + version "1.18.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.18.1.tgz#018fcb2c5b207d2a6424aee361c5a266da8f4130" + integrity sha512-lDfCPaMKfOJXjy0dPayzPdF1phampNWr3qFCjAu+rw/qbQmr5jWH5xN2hwh9QKfw9E5v4hwV7A+jrCmL8yjjqA== + dependencies: + is-core-module "^2.0.0" + path-parse "^1.0.6" + resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.11.1, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.3.2, resolve@^1.8.1: version "1.17.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" @@ -17780,6 +17795,13 @@ tty-browserify@0.0.0: resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= +ttypescript@^1.5.12: + version "1.5.12" + resolved "https://registry.yarnpkg.com/ttypescript/-/ttypescript-1.5.12.tgz#27a8356d7d4e719d0075a8feb4df14b52384f044" + integrity sha512-1ojRyJvpnmgN9kIHmUnQPlEV1gq+VVsxVYjk/NfvMlHSmYxjK5hEvOOU2MQASrbekTUiUM7pR/nXeCc8bzvMOQ== + dependencies: + resolve ">=1.9.0" + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -17876,6 +17898,11 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= +typescript-transform-paths@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/typescript-transform-paths/-/typescript-transform-paths-2.0.2.tgz#7040eab666f1921fb4b08ee0a0f21d77403187df" + integrity sha512-LRGd/pf73zN275t6Zz6TA3N1jeEHYRnHuiNHUwrGZmFuwt+dmiWeNklz+/e1IcCc5dA6LDI+F+ALe5NyyVFSVQ== + typescript@^4.0.2, typescript@~4.0.2: version "4.0.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.3.tgz#153bbd468ef07725c1df9c77e8b453f8d36abba5"