diff --git a/.eslintrc.js b/.eslintrc.js index 525d293e49..8d25986257 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,7 +7,11 @@ module.exports = { 'plugin:shopify/prettier', ], parserOptions: { - project: 'tsconfig.json', + project: [ + 'packages/tsconfig.json', + 'packages/tsconfig_base.json', + 'test/tsconfig.eslint.json', + ], }, rules: { 'jest/valid-expect-in-promise': 'off', diff --git a/.gitignore b/.gitignore index d1f19f691e..2911890ca1 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,5 @@ lerna-debug.log tmp **/test.log + +*.tsbuildinfo diff --git a/config/typescript/globals.d.ts b/config/typescript/globals.d.ts deleted file mode 100644 index 0356e2a001..0000000000 --- a/config/typescript/globals.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -// This type duplicates TypeScript’s `Omit`, because some of our dependencies -// assume TS 3.5+, which added this as a global type. Once we upgrade TypeScript, -// we can safely remove this type. -type Omit = Pick>; diff --git a/package.json b/package.json index d9a9b079d6..1b2b482e15 100644 --- a/package.json +++ b/package.json @@ -4,14 +4,14 @@ "description": "Shopify's javascript application utilities", "scripts": { "publish": "lerna publish", - "prebuild": "yarn run clean", - "build": "lerna run build", + "build": "yarn tsc --build packages", "lint": "eslint '**/*.{ts,tsx}'", "ci:lint-docs": "yarn generate docs && test -z \"$(git status --porcelain)\" || echo 'The root README has not been updated. Run `yarn generate docs` in the root of your quilt directory and try again.'", + "pretest": "yarn run build", "test": "NODE_ICU_DATA=node_modules/full-icu jest --maxWorkers=3 --coverage=false", "check": "lerna run check", "release": "lerna publish", - "clean": "rimraf './packages/*/dist/**/*.{js,d.ts}'", + "clean": "rimraf './packages/*/dist'", "generate": "plop", "generate:package": "plop package && yarn plop docs", "tophat": "tophat" @@ -33,6 +33,7 @@ "devDependencies": { "@babel/core": "^7.5.5", "@shopify/app-bridge": "^0.7.3", + "@shopify/tophat": "^0.0.3", "@types/enzyme": "^3.1.10", "@types/enzyme-adapter-react-16": "^1.0.3", "@types/faker": "^4.1.5", @@ -73,8 +74,7 @@ "rimraf": "^2.6.2", "ts-jest": "^23.10.4", "tslib": "^1.9.3", - "typescript": "~3.2.1", - "@shopify/tophat": "^0.0.3" + "typescript": "^3.6.2" }, "dependencies": {}, "resolutions": { diff --git a/packages/address-consts/package.json b/packages/address-consts/package.json index 47b485e515..ec6ff0ea1c 100644 --- a/packages/address-consts/package.json +++ b/packages/address-consts/package.json @@ -3,13 +3,12 @@ "version": "1.0.1", "license": "MIT", "description": "Constants and types relating to @shopify/address", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/address/tsconfig.build.json b/packages/address-consts/tsconfig.json similarity index 64% rename from packages/address/tsconfig.build.json rename to packages/address-consts/tsconfig.json index e836cbeb4e..4c83bd9c76 100644 --- a/packages/address/tsconfig.build.json +++ b/packages/address-consts/tsconfig.json @@ -1,10 +1,9 @@ { - "extends": "../../tsconfig.json", - "compileOnSave": false, + "extends": "../tsconfig_base.json", "compilerOptions": { "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" + "baseUrl": ".", + "rootDir": "." }, "include": [ "../../config/typescript/**/*", diff --git a/packages/address-mocks/package.json b/packages/address-mocks/package.json index 8ed60620b9..f5d9825b78 100644 --- a/packages/address-mocks/package.json +++ b/packages/address-mocks/package.json @@ -3,16 +3,15 @@ "version": "1.2.31", "license": "MIT", "description": "Address mocks for @shopify/address library.", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", + "scripts": { + "build": "tsc --p tsconfig.json" + }, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" }, - "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" - }, "author": "Shopify Inc.", "repository": { "type": "git", diff --git a/packages/address-mocks/tsconfig.json b/packages/address-mocks/tsconfig.json new file mode 100644 index 0000000000..ba5d567ab5 --- /dev/null +++ b/packages/address-mocks/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../address"}, {"path": "../jest-dom-mocks"}] +} diff --git a/packages/address/package.json b/packages/address/package.json index 0dcd416d46..d7cec1eec3 100644 --- a/packages/address/package.json +++ b/packages/address/package.json @@ -3,16 +3,15 @@ "version": "2.7.13", "license": "MIT", "description": "Address utilities for formatting addresses.", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", + "scripts": { + "build": "tsc --p tsconfig.json" + }, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" }, - "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" - }, "author": "Shopify Inc.", "repository": { "type": "git", diff --git a/packages/address/tsconfig.json b/packages/address/tsconfig.json new file mode 100644 index 0000000000..e7dcaccdd8 --- /dev/null +++ b/packages/address/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../address-consts"}] +} diff --git a/packages/admin-graphql-api-utilities/package.json b/packages/admin-graphql-api-utilities/package.json index 7b19f7e037..913f6436e4 100644 --- a/packages/admin-graphql-api-utilities/package.json +++ b/packages/admin-graphql-api-utilities/package.json @@ -3,11 +3,10 @@ "version": "0.0.8", "license": "MIT", "description": "A set of utilities to use when consuming Shopify’s admin graphql api.", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/admin-graphql-api-utilities/tsconfig.json b/packages/admin-graphql-api-utilities/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/admin-graphql-api-utilities/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/ast-utilities/javascript.d.ts b/packages/ast-utilities/javascript.d.ts index 664e613cae..7ee14eb43f 100644 --- a/packages/ast-utilities/javascript.d.ts +++ b/packages/ast-utilities/javascript.d.ts @@ -1 +1 @@ -export * from './dist/javascript'; +export * from './dist/src/javascript'; diff --git a/packages/ast-utilities/javascript.js b/packages/ast-utilities/javascript.js index b54b21d4e9..60bcbaeaaf 100644 --- a/packages/ast-utilities/javascript.js +++ b/packages/ast-utilities/javascript.js @@ -1 +1 @@ -module.exports = require('./dist/javascript'); +module.exports = require('./dist/src/javascript'); diff --git a/packages/ast-utilities/markdown.d.ts b/packages/ast-utilities/markdown.d.ts index e79056b573..1bb0183836 100644 --- a/packages/ast-utilities/markdown.d.ts +++ b/packages/ast-utilities/markdown.d.ts @@ -1 +1 @@ -export * from './dist/markdown'; +export * from './dist/src/markdown'; diff --git a/packages/ast-utilities/markdown.js b/packages/ast-utilities/markdown.js index 004aa10488..4f3c5846f3 100644 --- a/packages/ast-utilities/markdown.js +++ b/packages/ast-utilities/markdown.js @@ -1 +1 @@ -module.exports = require('./dist/markdown'); +module.exports = require('./dist/src/markdown'); diff --git a/packages/ast-utilities/package.json b/packages/ast-utilities/package.json index 56319f6012..fce20bad28 100644 --- a/packages/ast-utilities/package.json +++ b/packages/ast-utilities/package.json @@ -3,13 +3,12 @@ "version": "0.0.7", "license": "MIT", "description": "Utilities for working with Abstract Syntax Trees (ASTs)", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/ast-utilities/tsconfig.build.json b/packages/ast-utilities/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/ast-utilities/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/ast-utilities/tsconfig.json b/packages/ast-utilities/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/ast-utilities/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/async/babel.d.ts b/packages/async/babel.d.ts index f7a5261b74..89396c95af 100644 --- a/packages/async/babel.d.ts +++ b/packages/async/babel.d.ts @@ -1,2 +1,2 @@ -export {default} from './dist/babel-plugin'; -export * from './dist/babel-plugin'; +export {default} from './dist/src/babel-plugin'; +export * from './dist/src/babel-plugin'; diff --git a/packages/async/babel.js b/packages/async/babel.js index ecb6e1f242..e65b208720 100644 --- a/packages/async/babel.js +++ b/packages/async/babel.js @@ -1 +1 @@ -module.exports = require('./dist/babel-plugin'); +module.exports = require('./dist/src/babel-plugin'); diff --git a/packages/async/package.json b/packages/async/package.json index 97746ee85b..86e39a1cf1 100644 --- a/packages/async/package.json +++ b/packages/async/package.json @@ -3,13 +3,12 @@ "version": "2.1.0", "license": "MIT", "description": "Primitives for loading parts of an application asynchronously.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/async/src/types.ts b/packages/async/src/types.ts index b5d49fd14f..671625c591 100644 --- a/packages/async/src/types.ts +++ b/packages/async/src/types.ts @@ -21,7 +21,7 @@ export type RequestIdleCallback = ( deadline: RequestIdleCallbackDeadline, ) => void; -export interface WindowWithRequestIdleCallback { +export interface WindowWithRequestIdleCallback extends Window { requestIdleCallback( callback: RequestIdleCallback, opts?: RequestIdleCallbackOptions, diff --git a/packages/async/tsconfig.build.json b/packages/async/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/async/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/async/tsconfig.json b/packages/async/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/async/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/csrf-token-fetcher/package.json b/packages/csrf-token-fetcher/package.json index 37d4bf65ba..b33e3aa965 100644 --- a/packages/csrf-token-fetcher/package.json +++ b/packages/csrf-token-fetcher/package.json @@ -3,11 +3,10 @@ "version": "0.0.7", "license": "MIT", "description": "JavaScript utility function to fetch the CSRF token required to make requests to a Rails server", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/csrf-token-fetcher/tsconfig.build.json b/packages/csrf-token-fetcher/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/csrf-token-fetcher/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/csrf-token-fetcher/tsconfig.json b/packages/csrf-token-fetcher/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/csrf-token-fetcher/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/css-utilities/package.json b/packages/css-utilities/package.json index 05a8cf5b47..8188d7c4ea 100644 --- a/packages/css-utilities/package.json +++ b/packages/css-utilities/package.json @@ -3,13 +3,12 @@ "version": "1.0.1", "license": "MIT", "description": "A set of css styling related utilities.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/css-utilities/tsconfig.build.json b/packages/css-utilities/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/css-utilities/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/css-utilities/tsconfig.json b/packages/css-utilities/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/css-utilities/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/dates/package.json b/packages/dates/package.json index 16cc25e64b..a3242fdbf1 100644 --- a/packages/dates/package.json +++ b/packages/dates/package.json @@ -3,11 +3,10 @@ "version": "0.2.7", "license": "MIT", "description": "Lightweight date operations library.", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/dates/tsconfig.build.json b/packages/dates/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/dates/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/dates/tsconfig.json b/packages/dates/tsconfig.json new file mode 100644 index 0000000000..84c504e0e6 --- /dev/null +++ b/packages/dates/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../address"}, {"path": "../function-enhancers"}, {"path": "../decorators"}] +} diff --git a/packages/decorators/package.json b/packages/decorators/package.json index e96a3c7f56..0ad54a473b 100644 --- a/packages/decorators/package.json +++ b/packages/decorators/package.json @@ -3,13 +3,12 @@ "version": "1.1.5", "license": "MIT", "description": "A set of decorators to aid your JavaScript journey.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/decorators/tsconfig.build.json b/packages/decorators/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/decorators/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/decorators/tsconfig.json b/packages/decorators/tsconfig.json new file mode 100644 index 0000000000..6d49883dfa --- /dev/null +++ b/packages/decorators/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../address"}, {"path": "../function-enhancers"}] +} diff --git a/packages/enzyme-utilities/package.json b/packages/enzyme-utilities/package.json index a2b0853fd8..23abc4d111 100644 --- a/packages/enzyme-utilities/package.json +++ b/packages/enzyme-utilities/package.json @@ -3,16 +3,15 @@ "version": "2.1.5", "license": "MIT", "description": "Enzyme utilities for testing React components.", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", + "scripts": { + "build": "tsc --p tsconfig.json" + }, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" }, - "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" - }, "author": "Shopify Inc.", "repository": { "type": "git", diff --git a/packages/enzyme-utilities/tsconfig.build.json b/packages/enzyme-utilities/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/enzyme-utilities/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/enzyme-utilities/tsconfig.json b/packages/enzyme-utilities/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/enzyme-utilities/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/function-enhancers/package.json b/packages/function-enhancers/package.json index 57e8918b3e..17db23a80e 100644 --- a/packages/function-enhancers/package.json +++ b/packages/function-enhancers/package.json @@ -3,13 +3,12 @@ "version": "1.0.5", "license": "MIT", "description": "A set of helpers to enhance functions.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/function-enhancers/tsconfig.build.json b/packages/function-enhancers/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/function-enhancers/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/function-enhancers/tsconfig.json b/packages/function-enhancers/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/function-enhancers/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/graphql-persisted/apollo.d.ts b/packages/graphql-persisted/apollo.d.ts index aa08d3ea29..1fbe94ef57 100644 --- a/packages/graphql-persisted/apollo.d.ts +++ b/packages/graphql-persisted/apollo.d.ts @@ -1 +1 @@ -export * from './dist/apollo'; +export * from './dist/src/apollo'; diff --git a/packages/graphql-persisted/apollo.js b/packages/graphql-persisted/apollo.js index 5ae280ee63..ac8fd657da 100644 --- a/packages/graphql-persisted/apollo.js +++ b/packages/graphql-persisted/apollo.js @@ -1 +1 @@ -module.exports = require('./dist/apollo'); +module.exports = require('./dist/src/apollo'); diff --git a/packages/graphql-persisted/koa.d.ts b/packages/graphql-persisted/koa.d.ts index f468ab7ece..5b59838b5a 100644 --- a/packages/graphql-persisted/koa.d.ts +++ b/packages/graphql-persisted/koa.d.ts @@ -1 +1 @@ -export * from './dist/koa-middleware'; +export * from './dist/src/koa-middleware'; diff --git a/packages/graphql-persisted/koa.js b/packages/graphql-persisted/koa.js index c411145c5d..6b43658dad 100644 --- a/packages/graphql-persisted/koa.js +++ b/packages/graphql-persisted/koa.js @@ -1 +1 @@ -module.exports = require('./dist/koa-middleware'); +module.exports = require('./dist/src/koa-middleware'); diff --git a/packages/graphql-persisted/package.json b/packages/graphql-persisted/package.json index 94d29ac8d9..5672dacc02 100644 --- a/packages/graphql-persisted/package.json +++ b/packages/graphql-persisted/package.json @@ -5,8 +5,7 @@ "description": "Apollo and Koa integrations for persisted GraphQL queries.", "sideEffects": false, "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/graphql-persisted/src/apollo.ts b/packages/graphql-persisted/src/apollo.ts index 9df8dbb15f..c67a48489d 100644 --- a/packages/graphql-persisted/src/apollo.ts +++ b/packages/graphql-persisted/src/apollo.ts @@ -1,4 +1,10 @@ -import {ApolloLink, Operation, NextLink, Observable} from 'apollo-link'; +import { + ApolloLink, + Operation, + NextLink, + Observable, + FetchResult, +} from 'apollo-link'; import {CacheMissBehavior} from './shared'; @@ -17,7 +23,10 @@ export class PersistedLink extends ApolloLink { super(); } - request(operation: Operation, forward?: NextLink) { + request( + operation: Operation, + forward?: NextLink, + ): Observable | null { if (forward == null) { throw new Error('Persisted link can’t be a terminating link.'); } diff --git a/packages/graphql-persisted/src/tests/utilities.ts b/packages/graphql-persisted/src/tests/utilities.ts index bfeb09ab61..7042863fd1 100644 --- a/packages/graphql-persisted/src/tests/utilities.ts +++ b/packages/graphql-persisted/src/tests/utilities.ts @@ -60,7 +60,7 @@ export class SimpleLink extends ApolloLink { super(); } - request(operation: Operation, nextLink?: NextLink) { + request(operation: Operation, nextLink?: NextLink): Observable { this.beforeResult(operation); if (nextLink != null) { diff --git a/packages/graphql-persisted/tsconfig.build.json b/packages/graphql-persisted/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/graphql-persisted/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/graphql-persisted/tsconfig.json b/packages/graphql-persisted/tsconfig.json new file mode 100644 index 0000000000..6b7780d310 --- /dev/null +++ b/packages/graphql-persisted/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": ".", + "paths": { + "koa": ["node_modules/koa"] + } + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../sewing-kit-koa"}] +} diff --git a/packages/graphql-testing/matchers.d.ts b/packages/graphql-testing/matchers.d.ts index 0a3fde6dde..6bd602938e 100644 --- a/packages/graphql-testing/matchers.d.ts +++ b/packages/graphql-testing/matchers.d.ts @@ -1 +1 @@ -export * from './dist/matchers'; +export * from './dist/src/matchers'; diff --git a/packages/graphql-testing/matchers.js b/packages/graphql-testing/matchers.js index 5d88f6c92f..8cbf091cd5 100644 --- a/packages/graphql-testing/matchers.js +++ b/packages/graphql-testing/matchers.js @@ -1 +1 @@ -module.exports = require('./dist/matchers'); +module.exports = require('./dist/src/matchers'); diff --git a/packages/graphql-testing/package.json b/packages/graphql-testing/package.json index 9c815fb9ac..472ddfac72 100644 --- a/packages/graphql-testing/package.json +++ b/packages/graphql-testing/package.json @@ -3,13 +3,12 @@ "version": "4.0.6", "license": "MIT", "description": "Utilities to create mock graphql factory.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/graphql-testing/src/links/inflight.ts b/packages/graphql-testing/src/links/inflight.ts index 16580cc2ef..9c843d2a1d 100644 --- a/packages/graphql-testing/src/links/inflight.ts +++ b/packages/graphql-testing/src/links/inflight.ts @@ -1,4 +1,10 @@ -import {ApolloLink, Observable, Operation, NextLink} from 'apollo-link'; +import { + ApolloLink, + Observable, + Operation, + NextLink, + FetchResult, +} from 'apollo-link'; import {MockRequest} from '../types'; @@ -12,7 +18,10 @@ export class InflightLink extends ApolloLink { super(); } - request(operation: Operation, nextLink?: NextLink) { + request( + operation: Operation, + nextLink?: NextLink, + ): Observable | null { if (nextLink == null || !nextLink) { throw new Error('The memory link must not be a terminating link'); } diff --git a/packages/graphql-testing/src/links/mocks.ts b/packages/graphql-testing/src/links/mocks.ts index 6561149f73..616e2b8094 100644 --- a/packages/graphql-testing/src/links/mocks.ts +++ b/packages/graphql-testing/src/links/mocks.ts @@ -8,7 +8,7 @@ export class MockLink extends ApolloLink { super(); } - request(operation: Operation) { + request(operation: Operation): Observable { return new Observable(obs => { const {mock} = this; const {operationName = ''} = operation; diff --git a/packages/graphql-testing/src/links/tests/utilities.ts b/packages/graphql-testing/src/links/tests/utilities.ts index acb23d06e8..787ad78830 100644 --- a/packages/graphql-testing/src/links/tests/utilities.ts +++ b/packages/graphql-testing/src/links/tests/utilities.ts @@ -50,7 +50,10 @@ export class SimpleLink extends ApolloLink { super(); } - request(operation: Operation, nextLink?: NextLink) { + request( + operation: Operation, + nextLink?: NextLink, + ): Observable | null { this.beforeResult(operation); if (nextLink != null) { diff --git a/packages/graphql-testing/tsconfig.build.json b/packages/graphql-testing/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/graphql-testing/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/graphql-testing/tsconfig.json b/packages/graphql-testing/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/graphql-testing/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/i18n/package.json b/packages/i18n/package.json index f7a95c1143..99ada052e1 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -3,16 +3,15 @@ "version": "0.1.6", "license": "MIT", "description": "Generic i18n-related utilities.", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", + "scripts": { + "build": "tsc --p tsconfig.json" + }, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" }, - "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" - }, "author": "Shopify Inc.", "repository": { "type": "git", diff --git a/packages/i18n/tsconfig.build.json b/packages/i18n/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/i18n/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/i18n/tsconfig.json b/packages/i18n/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/i18n/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/jest-dom-mocks/package.json b/packages/jest-dom-mocks/package.json index 6a6d9cfae7..ebc74bc0aa 100644 --- a/packages/jest-dom-mocks/package.json +++ b/packages/jest-dom-mocks/package.json @@ -3,16 +3,15 @@ "version": "2.8.5", "license": "MIT", "description": "", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", + "scripts": { + "build": "tsc --p tsconfig.json" + }, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" }, - "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" - }, "author": "Shopify Inc.", "repository": { "type": "git", diff --git a/packages/jest-dom-mocks/tsconfig.build.json b/packages/jest-dom-mocks/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/jest-dom-mocks/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/jest-dom-mocks/tsconfig.json b/packages/jest-dom-mocks/tsconfig.json new file mode 100644 index 0000000000..11678233b5 --- /dev/null +++ b/packages/jest-dom-mocks/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../async"}, {"path": "../decorators"}] +} diff --git a/packages/jest-koa-mocks/package.json b/packages/jest-koa-mocks/package.json index a6df6b095d..dedfdf1807 100644 --- a/packages/jest-koa-mocks/package.json +++ b/packages/jest-koa-mocks/package.json @@ -3,16 +3,15 @@ "version": "2.1.8", "license": "MIT", "description": "", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", + "scripts": { + "build": "tsc --p tsconfig.json" + }, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" }, - "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" - }, "author": "Shopify Inc.", "repository": { "type": "git", diff --git a/packages/jest-koa-mocks/tsconfig.build.json b/packages/jest-koa-mocks/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/jest-koa-mocks/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/jest-koa-mocks/tsconfig.json b/packages/jest-koa-mocks/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/jest-koa-mocks/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/jest-mock-apollo/package.json b/packages/jest-mock-apollo/package.json index 3c4d129f26..6829cc7f43 100644 --- a/packages/jest-mock-apollo/package.json +++ b/packages/jest-mock-apollo/package.json @@ -3,16 +3,15 @@ "version": "4.0.1", "license": "MIT", "description": "Jest + Enzyme mocks for Apollo 2.x.", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", + "scripts": { + "build": "tsc --p tsconfig.json" + }, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" }, - "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" - }, "author": "Shopify Inc.", "repository": { "type": "git", diff --git a/packages/jest-mock-apollo/src/MockApolloLink.ts b/packages/jest-mock-apollo/src/MockApolloLink.ts index 4752350a0d..40c19e5047 100644 --- a/packages/jest-mock-apollo/src/MockApolloLink.ts +++ b/packages/jest-mock-apollo/src/MockApolloLink.ts @@ -1,4 +1,4 @@ -import {ApolloLink, Observable, Operation} from 'apollo-link'; +import {ApolloLink, Observable, Operation, NextLink} from 'apollo-link'; import { GraphQLType, ExecutionResult, @@ -20,7 +20,7 @@ export default class MockApolloLink extends ApolloLink { super(); } - request(operation: Operation) { + request(operation: Operation, _forward?: NextLink): Observable { return new Observable(obs => { const {mock} = this; const {operationName = ''} = operation; diff --git a/packages/jest-mock-apollo/tsconfig.build.json b/packages/jest-mock-apollo/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/jest-mock-apollo/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/jest-mock-apollo/tsconfig.json b/packages/jest-mock-apollo/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/jest-mock-apollo/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/jest-mock-router/package.json b/packages/jest-mock-router/package.json index 2c624a2656..5d6c52eda9 100644 --- a/packages/jest-mock-router/package.json +++ b/packages/jest-mock-router/package.json @@ -3,16 +3,15 @@ "version": "1.0.20", "license": "MIT", "description": "Jest + Enzyme mocks for React Router 3.x.", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", + "scripts": { + "build": "tsc --p tsconfig.json" + }, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" }, - "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" - }, "author": "Shopify Inc.", "repository": { "type": "git", diff --git a/packages/jest-mock-router/tsconfig.build.json b/packages/jest-mock-router/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/jest-mock-router/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/jest-mock-router/tsconfig.json b/packages/jest-mock-router/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/jest-mock-router/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/koa-liveness-ping/package.json b/packages/koa-liveness-ping/package.json index 7b6e8f1f93..72f55b82b0 100644 --- a/packages/koa-liveness-ping/package.json +++ b/packages/koa-liveness-ping/package.json @@ -3,11 +3,10 @@ "version": "0.1.21", "license": "MIT", "description": "A package for creating a liveness ping middleware for use with koa", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/koa-liveness-ping/tsconfig.build.json b/packages/koa-liveness-ping/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/koa-liveness-ping/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/koa-liveness-ping/tsconfig.json b/packages/koa-liveness-ping/tsconfig.json index e836cbeb4e..99660c095c 100644 --- a/packages/koa-liveness-ping/tsconfig.json +++ b/packages/koa-liveness-ping/tsconfig.json @@ -1,15 +1,15 @@ { - "extends": "../../tsconfig.json", - "compileOnSave": false, + "extends": "../tsconfig_base.json", "compilerOptions": { "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" + "baseUrl": ".", + "rootDir": "." }, "include": [ "../../config/typescript/**/*", "./src/**/*.ts", "./src/**/*.tsx" ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../jest-koa-mocks"}] } diff --git a/packages/koa-metrics/package.json b/packages/koa-metrics/package.json index 67805526c2..69526b2853 100644 --- a/packages/koa-metrics/package.json +++ b/packages/koa-metrics/package.json @@ -3,11 +3,10 @@ "version": "0.3.4", "license": "MIT", "description": "Aims to provide standard middlewares and instrumentation tooling for metrics in Koa.", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/koa-metrics/tsconfig.build.json b/packages/koa-metrics/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/koa-metrics/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/koa-metrics/tsconfig.json b/packages/koa-metrics/tsconfig.json new file mode 100644 index 0000000000..1bf4f246df --- /dev/null +++ b/packages/koa-metrics/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [ + {"path": "../jest-koa-mocks"}, + {"path": "../with-env"}, + {"path": "../statsd"} + ] +} diff --git a/packages/koa-performance/package.json b/packages/koa-performance/package.json index d053005dfa..f634acc70f 100644 --- a/packages/koa-performance/package.json +++ b/packages/koa-performance/package.json @@ -3,13 +3,12 @@ "version": "1.1.0", "license": "MIT", "description": "Creating a middleware that send performance related data through StatsD.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/koa-performance/tsconfig.build.json b/packages/koa-performance/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/koa-performance/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/koa-performance/tsconfig.json b/packages/koa-performance/tsconfig.json new file mode 100644 index 0000000000..42bfbfd241 --- /dev/null +++ b/packages/koa-performance/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../tsconfig_base.json", + "compileOnSave": false, + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../performance"}, {"path": "../statsd"}] +} diff --git a/packages/koa-shopify-auth/package.json b/packages/koa-shopify-auth/package.json index 9a72f45812..f71aa2367b 100644 --- a/packages/koa-shopify-auth/package.json +++ b/packages/koa-shopify-auth/package.json @@ -3,16 +3,15 @@ "version": "3.1.49", "license": "MIT", "description": "", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", + "scripts": { + "build": "tsc --p tsconfig.json" + }, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" }, - "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" - }, "author": "Shopify Inc.", "repository": { "type": "git", diff --git a/packages/koa-shopify-auth/tsconfig.build.json b/packages/koa-shopify-auth/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/koa-shopify-auth/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/koa-shopify-auth/tsconfig.json b/packages/koa-shopify-auth/tsconfig.json new file mode 100644 index 0000000000..1806c35257 --- /dev/null +++ b/packages/koa-shopify-auth/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../jest-koa-mocks"}, {"path": "../network"}] +} diff --git a/packages/koa-shopify-graphql-proxy/package.json b/packages/koa-shopify-graphql-proxy/package.json index 4ad9e6ec47..520368d826 100644 --- a/packages/koa-shopify-graphql-proxy/package.json +++ b/packages/koa-shopify-graphql-proxy/package.json @@ -3,11 +3,10 @@ "version": "3.2.1", "license": "MIT", "description": "A wrapper around koa-better-http-proxy which allows easy proxying of graphql requests from an embedded shopify app.", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/koa-shopify-graphql-proxy/tsconfig.build.json b/packages/koa-shopify-graphql-proxy/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/koa-shopify-graphql-proxy/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/koa-shopify-graphql-proxy/tsconfig.json b/packages/koa-shopify-graphql-proxy/tsconfig.json new file mode 100644 index 0000000000..99660c095c --- /dev/null +++ b/packages/koa-shopify-graphql-proxy/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../jest-koa-mocks"}] +} diff --git a/packages/koa-shopify-webhooks/package.json b/packages/koa-shopify-webhooks/package.json index 736b8f5c8d..80782702d9 100644 --- a/packages/koa-shopify-webhooks/package.json +++ b/packages/koa-shopify-webhooks/package.json @@ -3,13 +3,12 @@ "version": "2.2.0", "license": "MIT", "description": "Receive webhooks from Shopify with ease.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/koa-shopify-webhooks/tsconfig.build.json b/packages/koa-shopify-webhooks/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/koa-shopify-webhooks/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/koa-shopify-webhooks/tsconfig.json b/packages/koa-shopify-webhooks/tsconfig.json new file mode 100644 index 0000000000..ba01cba646 --- /dev/null +++ b/packages/koa-shopify-webhooks/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../jest-koa-mocks"}, {"path": "../jest-dom-mocks"}] +} diff --git a/packages/logger/package.json b/packages/logger/package.json index 3d4f6fb2c3..b1de4e18f0 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -3,11 +3,10 @@ "version": "0.1.8", "license": "MIT", "description": "Opinionated logger for production-scale applications", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/logger/tsconfig.build.json b/packages/logger/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/logger/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/logger/tsconfig.json b/packages/logger/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/logger/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/network/package.json b/packages/network/package.json index f301fdf51c..b2ec3954b8 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -3,13 +3,12 @@ "version": "1.4.2", "license": "MIT", "description": "Common values related to dealing with the network", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/network/tsconfig.build.json b/packages/network/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/network/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/network/tsconfig.json b/packages/network/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/network/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/performance/package.json b/packages/performance/package.json index 3de5b73f87..979b63c460 100644 --- a/packages/performance/package.json +++ b/packages/performance/package.json @@ -3,13 +3,12 @@ "version": "1.2.2", "license": "MIT", "description": "Primitives for collecting browser performance metrics.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/performance/src/utilities.ts b/packages/performance/src/utilities.ts index e2a4f775a1..784d0ee725 100644 --- a/packages/performance/src/utilities.ts +++ b/packages/performance/src/utilities.ts @@ -29,14 +29,16 @@ export function withEntriesOfType( ) { try { const initialEntries = performance.getEntriesByType(type); - initialEntries.forEach(entry => handler(entry)); + initialEntries.forEach(entry => handler(entry as EntryMap[T])); if (!hasGlobal('PerformanceObserver')) { return; } const observer = new PerformanceObserver(entries => { - entries.getEntriesByType(type).forEach(entry => handler(entry)); + entries + .getEntriesByType(type) + .forEach(entry => handler(entry as EntryMap[T])); }); observer.observe({ diff --git a/packages/performance/tsconfig.build.json b/packages/performance/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/performance/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/performance/tsconfig.json b/packages/performance/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/performance/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/polyfills/package.json b/packages/polyfills/package.json index 79c55c3147..d0c1587879 100644 --- a/packages/polyfills/package.json +++ b/packages/polyfills/package.json @@ -4,13 +4,8 @@ "license": "MIT", "description": "Blessed polyfills for web platform features.", "sideEffects": true, - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "scripts": { - "build": "yarn run clean && tsc --p tsconfig.build.json", - "clean": "rimraf 'dist'", - "prepublishOnly": "yarn run build" - }, + "main": "./dist/src/index.js", + "types": "./dist/src/index.d.ts", "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" @@ -26,6 +21,7 @@ "homepage": "https://github.com/Shopify/quilt/blob/master/packages/polyfills/README.md", "dependencies": { "@babel/polyfill": "^7.0.0", + "@shopify/useful-types": "^2.1.0", "browser-unhandled-rejection": "^1.0.2", "caniuse-api": "^3.0.0", "formdata-polyfill": "^3.0.18", diff --git a/packages/polyfills/src/idle-callback.browser.ts b/packages/polyfills/src/idle-callback.browser.ts index 7ec1f00a5c..4f139f5539 100644 --- a/packages/polyfills/src/idle-callback.browser.ts +++ b/packages/polyfills/src/idle-callback.browser.ts @@ -1,4 +1,5 @@ // reference: https://developers.google.com/web/updates/2015/08/using-requestidlecallback +import {ExtendedWindow} from '@shopify/useful-types'; interface IdleCallback { (params: CallbackParams): void; @@ -8,7 +9,6 @@ interface CallbackParams { didTimeout: boolean; timeRemaining(): number; } - interface PolyfilledWindow extends Window { requestIdleCallback(cb: IdleCallback): any; cancelIdleCallback(): any; @@ -29,7 +29,7 @@ function fallbackQueueingFunction(cb: IdleCallback) { }); } -const extendedWindow = window as PolyfilledWindow; +const extendedWindow = window as ExtendedWindow; extendedWindow.requestIdleCallback = extendedWindow.requestIdleCallback || fallbackQueueingFunction; diff --git a/packages/polyfills/src/idle-callback.jest.ts b/packages/polyfills/src/idle-callback.jest.ts index 38d1717822..2688f2b15b 100644 --- a/packages/polyfills/src/idle-callback.jest.ts +++ b/packages/polyfills/src/idle-callback.jest.ts @@ -1,4 +1,5 @@ // reference: https://developers.google.com/web/updates/2015/08/using-requestidlecallback +import {ExtendedWindow} from '@shopify/useful-types'; interface IdleCallback { (params: CallbackParams): void; @@ -30,7 +31,7 @@ function fallbackQueueingFunction(cb: IdleCallback) { } if (typeof window !== 'undefined') { - const extendedWindow = window as PolyfilledWindow; + const extendedWindow = window as ExtendedWindow; extendedWindow.requestIdleCallback = extendedWindow.requestIdleCallback || fallbackQueueingFunction; diff --git a/packages/polyfills/tsconfig.build.json b/packages/polyfills/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/polyfills/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/polyfills/tsconfig.json b/packages/polyfills/tsconfig.json new file mode 100644 index 0000000000..a392b60c3e --- /dev/null +++ b/packages/polyfills/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../useful-types"}] +} diff --git a/packages/predicates/package.json b/packages/predicates/package.json index e81fe9a30e..4918383a13 100644 --- a/packages/predicates/package.json +++ b/packages/predicates/package.json @@ -3,13 +3,12 @@ "version": "1.2.1", "license": "MIT", "description": "A set of common Javascript predicates", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/predicates/tsconfig.build.json b/packages/predicates/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/predicates/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/predicates/tsconfig.json b/packages/predicates/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/predicates/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/react-app-bridge-universal-provider/package.json b/packages/react-app-bridge-universal-provider/package.json index d92fae62f6..87548a6bcb 100644 --- a/packages/react-app-bridge-universal-provider/package.json +++ b/packages/react-app-bridge-universal-provider/package.json @@ -3,13 +3,12 @@ "version": "1.0.12", "license": "MIT", "description": "A self-serializing/deserializing app-bridge-react provider that works for isomorphic applications.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-app-bridge-universal-provider/tsconfig.build.json b/packages/react-app-bridge-universal-provider/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-app-bridge-universal-provider/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-app-bridge-universal-provider/tsconfig.json b/packages/react-app-bridge-universal-provider/tsconfig.json new file mode 100644 index 0000000000..a6a6bc9562 --- /dev/null +++ b/packages/react-app-bridge-universal-provider/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../react-html"}] +} diff --git a/packages/react-async/package.json b/packages/react-async/package.json index 3252b85c42..454b371d36 100644 --- a/packages/react-async/package.json +++ b/packages/react-async/package.json @@ -3,13 +3,12 @@ "version": "3.1.2", "license": "MIT", "description": "Tools for creating powerful, asynchronously-loaded React components.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-async/src/Prefetcher.tsx b/packages/react-async/src/Prefetcher.tsx index b9058ea576..d4f14d8329 100644 --- a/packages/react-async/src/Prefetcher.tsx +++ b/packages/react-async/src/Prefetcher.tsx @@ -180,7 +180,7 @@ function shouldPrefetchAggressively() { ); } -function urlsEqual(first?: URL, second?: URL) { +function urlsEqual(first?: URL | null, second?: URL) { return ( (first == null && first === second) || (first != null && second != null && first.href === second.href) diff --git a/packages/react-async/testing.d.ts b/packages/react-async/testing.d.ts index 7e429f3423..ecd70437b7 100644 --- a/packages/react-async/testing.d.ts +++ b/packages/react-async/testing.d.ts @@ -1 +1 @@ -export * from './dist/testing'; +export * from './dist/src/testing'; diff --git a/packages/react-async/testing.js b/packages/react-async/testing.js index 7061901352..707503ace5 100644 --- a/packages/react-async/testing.js +++ b/packages/react-async/testing.js @@ -1 +1 @@ -module.exports = require('./dist/testing'); +module.exports = require('./dist/src/testing'); diff --git a/packages/react-async/tsconfig.build.json b/packages/react-async/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-async/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-async/tsconfig.json b/packages/react-async/tsconfig.json new file mode 100644 index 0000000000..4525593c92 --- /dev/null +++ b/packages/react-async/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [ + {"path": "../react-effect"}, + {"path": "../react-hooks"}, + {"path": "../useful-types"}, + {"path": "../react-idle"}, + {"path": "../react-intersection-observer"}, + {"path": "../react-hydrate"} + ] +} diff --git a/packages/react-compose/package.json b/packages/react-compose/package.json index 4432a0e786..4ef83e4b98 100644 --- a/packages/react-compose/package.json +++ b/packages/react-compose/package.json @@ -3,11 +3,10 @@ "version": "1.0.7", "license": "MIT", "description": "Cleanly compose multiple component enhancers together with minimal fuss", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/react-compose/tsconfig.build.json b/packages/react-compose/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-compose/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-compose/tsconfig.json b/packages/react-compose/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/react-compose/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/react-cookie/package.json b/packages/react-cookie/package.json index 0c0a2447d1..b9aad1f495 100644 --- a/packages/react-cookie/package.json +++ b/packages/react-cookie/package.json @@ -3,13 +3,12 @@ "version": "0.0.9", "license": "MIT", "description": "Cookies in React for the server and client", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-cookie/tsconfig.build.json b/packages/react-cookie/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-cookie/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-cookie/tsconfig.json b/packages/react-cookie/tsconfig.json new file mode 100644 index 0000000000..ecad5bd1a5 --- /dev/null +++ b/packages/react-cookie/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../tsconfig_base.json", + "compileOnSave": false, + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../react-network"}] +} diff --git a/packages/react-csrf-universal-provider/package.json b/packages/react-csrf-universal-provider/package.json index 58366c6871..3e6baeca56 100644 --- a/packages/react-csrf-universal-provider/package.json +++ b/packages/react-csrf-universal-provider/package.json @@ -3,13 +3,12 @@ "version": "1.0.12", "license": "MIT", "description": "A self-serializing/deserializing CSRF token provider that works for for isomorphic applications.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-csrf-universal-provider/tsconfig.build.json b/packages/react-csrf-universal-provider/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-csrf-universal-provider/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-csrf-universal-provider/tsconfig.json b/packages/react-csrf-universal-provider/tsconfig.json new file mode 100644 index 0000000000..a1f30c8ac2 --- /dev/null +++ b/packages/react-csrf-universal-provider/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [ + {"path": "../react-universal-provider"}, + {"path": "../react-csrf"} + ] +} diff --git a/packages/react-csrf/package.json b/packages/react-csrf/package.json index f12ba79c15..fe6bbf44ae 100644 --- a/packages/react-csrf/package.json +++ b/packages/react-csrf/package.json @@ -3,13 +3,12 @@ "version": "1.0.7", "license": "MIT", "description": "Share csrf token throughout a react application.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-csrf/tsconfig.build.json b/packages/react-csrf/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-csrf/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-csrf/tsconfig.json b/packages/react-csrf/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/react-csrf/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/react-effect-apollo/package.json b/packages/react-effect-apollo/package.json index 46855945a3..66691612f2 100644 --- a/packages/react-effect-apollo/package.json +++ b/packages/react-effect-apollo/package.json @@ -3,13 +3,12 @@ "version": "4.0.0", "license": "MIT", "description": "A bridging layer between react-apollo and react-effect.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-effect-apollo/tsconfig.build.json b/packages/react-effect-apollo/tsconfig.json similarity index 67% rename from packages/react-effect-apollo/tsconfig.build.json rename to packages/react-effect-apollo/tsconfig.json index c258a0379d..856608ca2a 100644 --- a/packages/react-effect-apollo/tsconfig.build.json +++ b/packages/react-effect-apollo/tsconfig.json @@ -1,10 +1,9 @@ { - "extends": "../../tsconfig.json", - "compileOnSave": false, + "extends": "../tsconfig_base.json", "compilerOptions": { "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src", + "baseUrl": ".", + "rootDir": ".", "skipLibCheck": true }, "include": [ diff --git a/packages/react-effect/package.json b/packages/react-effect/package.json index d0077551c3..f435a07417 100644 --- a/packages/react-effect/package.json +++ b/packages/react-effect/package.json @@ -3,11 +3,10 @@ "version": "3.2.7", "license": "MIT", "description": "A component and set of utilities for performing effects within a universal React app", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/react-effect/server.d.ts b/packages/react-effect/server.d.ts index 699fd532ab..b940dac216 100644 --- a/packages/react-effect/server.d.ts +++ b/packages/react-effect/server.d.ts @@ -1 +1 @@ -export * from './dist/server'; +export * from './dist/src/server'; diff --git a/packages/react-effect/server.js b/packages/react-effect/server.js index 0e07caec85..6747a13a2d 100644 --- a/packages/react-effect/server.js +++ b/packages/react-effect/server.js @@ -1 +1 @@ -module.exports = require('./dist/server'); +module.exports = require('./dist/src/server'); diff --git a/packages/react-effect/tsconfig.build.json b/packages/react-effect/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-effect/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-effect/tsconfig.json b/packages/react-effect/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/react-effect/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/react-form-state/package.json b/packages/react-form-state/package.json index 88380a9ea1..c73b73e947 100644 --- a/packages/react-form-state/package.json +++ b/packages/react-form-state/package.json @@ -3,11 +3,10 @@ "version": "0.11.14", "license": "MIT", "description": "Manage react forms tersely and type-safe with no magic.", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/react-form-state/src/FormState.ts b/packages/react-form-state/src/FormState.ts index f6150be16a..bc3fe82cf7 100644 --- a/packages/react-form-state/src/FormState.ts +++ b/packages/react-form-state/src/FormState.ts @@ -393,7 +393,9 @@ export default class FormState< return; } - const {validators = {}} = this.props; + const { + validators = {} as Partial>, + } = this.props; const {fields} = this.state; return runValidator(validators[fieldPath], value, fields); diff --git a/packages/react-form-state/tsconfig.build.json b/packages/react-form-state/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-form-state/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-form-state/tsconfig.json b/packages/react-form-state/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/react-form-state/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/react-form/package.json b/packages/react-form/package.json index 4cf06e1481..1dbd72d303 100644 --- a/packages/react-form/package.json +++ b/packages/react-form/package.json @@ -3,13 +3,12 @@ "version": "0.3.28", "license": "MIT", "description": "Manage react forms tersely and safely-typed with no magic using React hooks.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-form/tsconfig.build.json b/packages/react-form/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-form/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-form/tsconfig.json b/packages/react-form/tsconfig.json new file mode 100644 index 0000000000..e2ad5c0fa0 --- /dev/null +++ b/packages/react-form/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../react-hooks"}, {"path": "../predicates"}] +} diff --git a/packages/react-google-analytics/package.json b/packages/react-google-analytics/package.json index 41e451cb8a..9ef0f26c99 100644 --- a/packages/react-google-analytics/package.json +++ b/packages/react-google-analytics/package.json @@ -3,11 +3,10 @@ "version": "3.0.20", "license": "MIT", "description": "Google Analytics", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/react-google-analytics/tsconfig.build.json b/packages/react-google-analytics/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-google-analytics/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-google-analytics/tsconfig.json b/packages/react-google-analytics/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/react-google-analytics/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/react-graphql-universal-provider/package.json b/packages/react-graphql-universal-provider/package.json index d130184e7e..5b58ff01d4 100644 --- a/packages/react-graphql-universal-provider/package.json +++ b/packages/react-graphql-universal-provider/package.json @@ -3,13 +3,12 @@ "version": "2.1.2", "license": "MIT", "description": "A self-serializing/deserializing GraphQL provider that works for isomorphic applications.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-graphql-universal-provider/tsconfig.build.json b/packages/react-graphql-universal-provider/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-graphql-universal-provider/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-graphql-universal-provider/tsconfig.json b/packages/react-graphql-universal-provider/tsconfig.json new file mode 100644 index 0000000000..3563903a00 --- /dev/null +++ b/packages/react-graphql-universal-provider/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [ + {"path": "../react-html"}, + {"path": "../react-graphql"}, + {"path": "../react-hooks"} + ] +} diff --git a/packages/react-graphql/package.json b/packages/react-graphql/package.json index a184ef3a76..84cb39a0c0 100644 --- a/packages/react-graphql/package.json +++ b/packages/react-graphql/package.json @@ -3,13 +3,12 @@ "version": "6.0.2", "license": "MIT", "description": "Tools for creating type-safe and asynchronous GraphQL components for React.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-graphql/src/hooks/mutation.ts b/packages/react-graphql/src/hooks/mutation.ts index 8de080fdaf..4a45cf86af 100644 --- a/packages/react-graphql/src/hooks/mutation.ts +++ b/packages/react-graphql/src/hooks/mutation.ts @@ -59,5 +59,5 @@ export default function useMutation( ], ); - return runMutation; + return runMutation as MutationHookResult; } diff --git a/packages/react-graphql/tsconfig.build.json b/packages/react-graphql/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-graphql/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-graphql/tsconfig.json b/packages/react-graphql/tsconfig.json new file mode 100644 index 0000000000..81f5a8852f --- /dev/null +++ b/packages/react-graphql/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [ + {"path": "../react-async"}, + {"path": "../react-hooks"}, + {"path": "../react-testing"}, + {"path": "../react-idle"}, + {"path": "../useful-types"} + ] +} diff --git a/packages/react-hooks/package.json b/packages/react-hooks/package.json index 7fb9da7bcf..a719fa8aa0 100644 --- a/packages/react-hooks/package.json +++ b/packages/react-hooks/package.json @@ -3,13 +3,12 @@ "version": "1.3.0", "license": "MIT", "description": "A collection of primitive React hooks.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-hooks/tsconfig.build.json b/packages/react-hooks/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-hooks/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-hooks/tsconfig.json b/packages/react-hooks/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/react-hooks/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/react-html/package.json b/packages/react-html/package.json index 6a0e851a97..05646bfd2f 100644 --- a/packages/react-html/package.json +++ b/packages/react-html/package.json @@ -3,11 +3,10 @@ "version": "9.2.8", "license": "MIT", "description": "A component to render your react app with no static HTML.", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/react-html/server.d.ts b/packages/react-html/server.d.ts index 699fd532ab..b940dac216 100644 --- a/packages/react-html/server.d.ts +++ b/packages/react-html/server.d.ts @@ -1 +1 @@ -export * from './dist/server'; +export * from './dist/src/server'; diff --git a/packages/react-html/server.js b/packages/react-html/server.js index 0e07caec85..6747a13a2d 100644 --- a/packages/react-html/server.js +++ b/packages/react-html/server.js @@ -1 +1 @@ -module.exports = require('./dist/server'); +module.exports = require('./dist/src/server'); diff --git a/packages/react-html/tsconfig.build.json b/packages/react-html/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-html/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-html/tsconfig.json b/packages/react-html/tsconfig.json new file mode 100644 index 0000000000..7ff0ff6458 --- /dev/null +++ b/packages/react-html/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../react-testing"}, {"path": "../react-hydrate"}] +} diff --git a/packages/react-hydrate/package.json b/packages/react-hydrate/package.json index 6435f4510d..43f9e41d6c 100644 --- a/packages/react-hydrate/package.json +++ b/packages/react-hydrate/package.json @@ -3,13 +3,12 @@ "version": "1.1.9", "license": "MIT", "description": "Utilities for hydrating server-rendered React apps", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-hydrate/tsconfig.build.json b/packages/react-hydrate/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-hydrate/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-hydrate/tsconfig.json b/packages/react-hydrate/tsconfig.json new file mode 100644 index 0000000000..6354acd60f --- /dev/null +++ b/packages/react-hydrate/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../react-effect"}, {"path": "../react-hooks"}] +} diff --git a/packages/react-i18n-universal-provider/package.json b/packages/react-i18n-universal-provider/package.json index d58a611eed..65cce61bac 100644 --- a/packages/react-i18n-universal-provider/package.json +++ b/packages/react-i18n-universal-provider/package.json @@ -3,13 +3,12 @@ "version": "1.0.24", "license": "MIT", "description": "A self-serializing/deserializing i18n provider that works for isomorphic applications.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-i18n-universal-provider/tsconfig.build.json b/packages/react-i18n-universal-provider/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-i18n-universal-provider/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-i18n-universal-provider/tsconfig.json b/packages/react-i18n-universal-provider/tsconfig.json new file mode 100644 index 0000000000..2c298d0c24 --- /dev/null +++ b/packages/react-i18n-universal-provider/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../react-i18n"}] +} diff --git a/packages/react-i18n/babel.d.ts b/packages/react-i18n/babel.d.ts index f7a5261b74..89396c95af 100644 --- a/packages/react-i18n/babel.d.ts +++ b/packages/react-i18n/babel.d.ts @@ -1,2 +1,2 @@ -export {default} from './dist/babel-plugin'; -export * from './dist/babel-plugin'; +export {default} from './dist/src/babel-plugin'; +export * from './dist/src/babel-plugin'; diff --git a/packages/react-i18n/babel.js b/packages/react-i18n/babel.js index ecb6e1f242..e65b208720 100644 --- a/packages/react-i18n/babel.js +++ b/packages/react-i18n/babel.js @@ -1 +1 @@ -module.exports = require('./dist/babel-plugin'); +module.exports = require('./dist/src/babel-plugin'); diff --git a/packages/react-i18n/package.json b/packages/react-i18n/package.json index 4da3740ac1..609070f48c 100644 --- a/packages/react-i18n/package.json +++ b/packages/react-i18n/package.json @@ -3,12 +3,10 @@ "version": "2.1.7", "license": "MIT", "description": "i18n utilities for React handling translations, formatting, and more.", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build", - "test": "jest --config ./config/jest/config.json" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/react-i18n/tsconfig.build.json b/packages/react-i18n/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-i18n/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-i18n/tsconfig.json b/packages/react-i18n/tsconfig.json new file mode 100644 index 0000000000..f4402a6dc8 --- /dev/null +++ b/packages/react-i18n/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [ + {"path": "../function-enhancers"}, + {"path": "../decorators"}, + {"path": "../i18n"}, + {"path": "../dates"} + ] +} diff --git a/packages/react-idle/package.json b/packages/react-idle/package.json index a7cb418897..e7f519cd35 100644 --- a/packages/react-idle/package.json +++ b/packages/react-idle/package.json @@ -3,13 +3,12 @@ "version": "1.0.12", "license": "MIT", "description": "Utilities for working with idle callbacks in React", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" @@ -24,7 +23,8 @@ }, "homepage": "https://github.com/Shopify/quilt/blob/master/packages/react-idle/README.md", "dependencies": { - "@shopify/async": "^2.1.0" + "@shopify/async": "^2.1.0", + "@shopify/useful-types": "^2.1.0" }, "peerDependencies": { "react": "^16.8.0" diff --git a/packages/react-idle/src/hooks.ts b/packages/react-idle/src/hooks.ts index ef4ae43dcc..90bfd49431 100644 --- a/packages/react-idle/src/hooks.ts +++ b/packages/react-idle/src/hooks.ts @@ -1,4 +1,5 @@ import {useEffect, useRef} from 'react'; +import {ExtendedWindow} from '@shopify/useful-types'; import { RequestIdleCallbackHandle, @@ -14,9 +15,9 @@ export function useIdleCallback( useEffect(() => { if ('requestIdleCallback' in window) { - handle.current = (window as WindowWithRequestIdleCallback).requestIdleCallback( - () => callback(), - ); + handle.current = (window as ExtendedWindow< + WindowWithRequestIdleCallback + >).requestIdleCallback(() => callback()); } else if (unsupportedBehavior === UnsupportedBehavior.AnimationFrame) { handle.current = window.requestAnimationFrame(() => { callback(); @@ -34,9 +35,9 @@ export function useIdleCallback( } if ('cancelIdleCallback' in window) { - (window as WindowWithRequestIdleCallback).cancelIdleCallback( - currentHandle, - ); + (window as ExtendedWindow< + WindowWithRequestIdleCallback + >).cancelIdleCallback(currentHandle); } else if (unsupportedBehavior === UnsupportedBehavior.AnimationFrame) { window.cancelAnimationFrame(currentHandle); } diff --git a/packages/react-idle/tsconfig.build.json b/packages/react-idle/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-idle/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-idle/tsconfig.json b/packages/react-idle/tsconfig.json new file mode 100644 index 0000000000..c4654c0e7d --- /dev/null +++ b/packages/react-idle/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../useful-types"}, {"path": "../async"}] +} diff --git a/packages/react-import-remote/package.json b/packages/react-import-remote/package.json index 47d5e4edd8..774fe110a7 100644 --- a/packages/react-import-remote/package.json +++ b/packages/react-import-remote/package.json @@ -3,11 +3,10 @@ "version": "1.0.23", "license": "MIT", "description": "Asynchronous script loading for React", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", @@ -27,6 +26,7 @@ "@shopify/react-hooks": "^1.3.0", "@shopify/react-html": "^9.2.8", "@shopify/react-intersection-observer": "^2.0.9", + "@shopify/useful-types": "^2.1.0", "tslib": "^1.9.3" }, "peerDependencies": { diff --git a/packages/react-import-remote/src/hooks.ts b/packages/react-import-remote/src/hooks.ts index 34c81aba67..941a881025 100644 --- a/packages/react-import-remote/src/hooks.ts +++ b/packages/react-import-remote/src/hooks.ts @@ -1,4 +1,5 @@ import React from 'react'; +import {ExtendedWindow} from '@shopify/useful-types'; import {useIntersection} from '@shopify/react-intersection-observer'; import { DeferTiming, @@ -97,9 +98,9 @@ export function useImportRemote( React.useEffect(() => { if (defer === DeferTiming.Idle) { if ('requestIdleCallback' in window) { - idleCallbackHandle.current = (window as WindowWithRequestIdleCallback).requestIdleCallback( - loadRemote, - ); + idleCallbackHandle.current = (window as ExtendedWindow< + WindowWithRequestIdleCallback + >).requestIdleCallback(loadRemote); } else { loadRemote(); } diff --git a/packages/react-import-remote/src/load.ts b/packages/react-import-remote/src/load.ts index db11cf1689..6a1bbf49a5 100644 --- a/packages/react-import-remote/src/load.ts +++ b/packages/react-import-remote/src/load.ts @@ -1,3 +1,5 @@ +import {ExtendedWindow} from '@shopify/useful-types'; + const cache = new Map>(); export default function load< @@ -27,7 +29,7 @@ export default function load< function scriptTagOnLoad() { scriptTag.removeEventListener('load', scriptTagOnLoad); scriptTag.removeEventListener('error', scriptTagOnError); - resolve(getImport(window as CustomWindow)); + resolve(getImport(window as ExtendedWindow)); } function scriptTagOnError() { diff --git a/packages/react-import-remote/tsconfig.build.json b/packages/react-import-remote/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-import-remote/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-import-remote/tsconfig.json b/packages/react-import-remote/tsconfig.json new file mode 100644 index 0000000000..a6a6bc9562 --- /dev/null +++ b/packages/react-import-remote/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../react-html"}] +} diff --git a/packages/react-intersection-observer/package.json b/packages/react-intersection-observer/package.json index 9570856a11..bcdf2aebd6 100644 --- a/packages/react-intersection-observer/package.json +++ b/packages/react-intersection-observer/package.json @@ -3,13 +3,12 @@ "version": "2.0.9", "license": "MIT", "description": "A React wrapper around the IntersectionObserver API", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-intersection-observer/tsconfig.build.json b/packages/react-intersection-observer/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-intersection-observer/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-intersection-observer/tsconfig.json b/packages/react-intersection-observer/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/react-intersection-observer/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/react-network/package.json b/packages/react-network/package.json index dd7fddc542..a602200b8d 100644 --- a/packages/react-network/package.json +++ b/packages/react-network/package.json @@ -3,13 +3,12 @@ "version": "3.3.6", "license": "MIT", "description": "A collection of components that allow you to set common HTTP headers from within your React application.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-network/server.d.ts b/packages/react-network/server.d.ts index 699fd532ab..b940dac216 100644 --- a/packages/react-network/server.d.ts +++ b/packages/react-network/server.d.ts @@ -1 +1 @@ -export * from './dist/server'; +export * from './dist/src/server'; diff --git a/packages/react-network/server.js b/packages/react-network/server.js index 0e07caec85..6747a13a2d 100644 --- a/packages/react-network/server.js +++ b/packages/react-network/server.js @@ -1 +1 @@ -module.exports = require('./dist/server'); +module.exports = require('./dist/src/server'); diff --git a/packages/react-network/tsconfig.build.json b/packages/react-network/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-network/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-network/tsconfig.json b/packages/react-network/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/react-network/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/react-performance/package.json b/packages/react-performance/package.json index 8e798630cc..56b8cc4bed 100644 --- a/packages/react-performance/package.json +++ b/packages/react-performance/package.json @@ -3,13 +3,12 @@ "version": "1.2.1", "license": "MIT", "description": "Primitives to measure your React application's performance using @shopify/performance", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" @@ -31,8 +30,7 @@ "react": ">=16.8.0 <17.0.0" }, "devDependencies": { - "@shopify/network": "^1.4.2", - "typescript": "~3.2.1" + "@shopify/network": "^1.4.2" }, "files": [ "dist/*" diff --git a/packages/react-performance/tsconfig.build.json b/packages/react-performance/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-performance/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/admin-graphql-api-utilities/tsconfig.build.json b/packages/react-performance/tsconfig.json similarity index 73% rename from packages/admin-graphql-api-utilities/tsconfig.build.json rename to packages/react-performance/tsconfig.json index e836cbeb4e..960606e35b 100644 --- a/packages/admin-graphql-api-utilities/tsconfig.build.json +++ b/packages/react-performance/tsconfig.json @@ -1,10 +1,10 @@ { - "extends": "../../tsconfig.json", + "extends": "../tsconfig_base.json", "compileOnSave": false, "compilerOptions": { "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" + "baseUrl": ".", + "rootDir": "." }, "include": [ "../../config/typescript/**/*", diff --git a/packages/react-preconnect/tsconfig.json b/packages/react-preconnect/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/react-preconnect/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/react-router/package.json b/packages/react-router/package.json index 71e8cd97f5..ec9aead7ef 100644 --- a/packages/react-router/package.json +++ b/packages/react-router/package.json @@ -3,13 +3,12 @@ "version": "0.0.16", "license": "MIT", "description": "A universal router for React.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-router/tsconfig.build.json b/packages/react-router/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-router/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-router/tsconfig.json b/packages/react-router/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/react-router/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/react-serialize/package.json b/packages/react-serialize/package.json index 791b0c1819..b729fdf57d 100644 --- a/packages/react-serialize/package.json +++ b/packages/react-serialize/package.json @@ -3,11 +3,10 @@ "version": "1.0.18", "license": "MIT", "description": "Provides an idiomatic way to serialize data for rehydration in a universal react application.", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/react-serialize/tsconfig.build.json b/packages/react-serialize/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-serialize/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-serialize/tsconfig.json b/packages/react-serialize/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/react-serialize/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/react-server-webpack-plugin/package.json b/packages/react-server-webpack-plugin/package.json index 1d576be7a9..044d0fcee3 100644 --- a/packages/react-server-webpack-plugin/package.json +++ b/packages/react-server-webpack-plugin/package.json @@ -3,13 +3,12 @@ "version": "2.2.14", "license": "MIT", "description": "A webpack plugin that generates entrypoints for @shopify/react-server based applications", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-server-webpack-plugin/tsconfig.build.json b/packages/react-server-webpack-plugin/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-server-webpack-plugin/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-server-webpack-plugin/tsconfig.json b/packages/react-server-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..e06fece6c6 --- /dev/null +++ b/packages/react-server-webpack-plugin/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../tsconfig_base.json", + "compileOnSave": false, + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../react-html"}, {"path": "../react-server"}] +} diff --git a/packages/react-server/package.json b/packages/react-server/package.json index a43ead4a31..3042acceb2 100644 --- a/packages/react-server/package.json +++ b/packages/react-server/package.json @@ -3,13 +3,12 @@ "version": "0.8.2", "license": "MIT", "description": "Utilities for React server-side rendering.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-server/tsconfig.build.json b/packages/react-server/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-server/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-server/tsconfig.json b/packages/react-server/tsconfig.json new file mode 100644 index 0000000000..c8e85fc50e --- /dev/null +++ b/packages/react-server/tsconfig.json @@ -0,0 +1,28 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [ + {"path": "../react-async"}, + {"path": "../sewing-kit-koa"}, + {"path": "../network"}, + {"path": "../react-network"}, + {"path": "../react-cookie"}, + {"path": "../react-csrf-universal-provider"}, + {"path": "../with-env"}, + {"path": "../sewing-kit-koa"}, + {"path": "../react-html"}, + {"path": "../useful-types"}, + {"path": "../react-hydrate"}, + {"path": "../react-effect"} + ] +} diff --git a/packages/react-shopify-app-route-propagator/package.json b/packages/react-shopify-app-route-propagator/package.json index d4e236f135..cceb1a2c87 100644 --- a/packages/react-shopify-app-route-propagator/package.json +++ b/packages/react-shopify-app-route-propagator/package.json @@ -3,11 +3,10 @@ "version": "3.0.4", "license": "MIT", "description": "", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/react-shopify-app-route-propagator/tsconfig.build.json b/packages/react-shopify-app-route-propagator/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-shopify-app-route-propagator/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-shopify-app-route-propagator/tsconfig.json b/packages/react-shopify-app-route-propagator/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/react-shopify-app-route-propagator/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/react-shortcuts/package.json b/packages/react-shortcuts/package.json index c9b43d01b9..c2144f0cb1 100644 --- a/packages/react-shortcuts/package.json +++ b/packages/react-shortcuts/package.json @@ -3,11 +3,10 @@ "version": "3.0.9", "license": "MIT", "description": "Declaratively and efficiently match shortcut combinations in your react application", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/react-shortcuts/tsconfig.build.json b/packages/react-shortcuts/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-shortcuts/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-shortcuts/tsconfig.json b/packages/react-shortcuts/tsconfig.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/packages/react-shortcuts/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/packages/react-testing/matchers.d.ts b/packages/react-testing/matchers.d.ts index 0a3fde6dde..6bd602938e 100644 --- a/packages/react-testing/matchers.d.ts +++ b/packages/react-testing/matchers.d.ts @@ -1 +1 @@ -export * from './dist/matchers'; +export * from './dist/src/matchers'; diff --git a/packages/react-testing/matchers.js b/packages/react-testing/matchers.js index 5d88f6c92f..8cbf091cd5 100644 --- a/packages/react-testing/matchers.js +++ b/packages/react-testing/matchers.js @@ -1 +1 @@ -module.exports = require('./dist/matchers'); +module.exports = require('./dist/src/matchers'); diff --git a/packages/react-testing/package.json b/packages/react-testing/package.json index 1b3e7980b3..9b09fd22cc 100644 --- a/packages/react-testing/package.json +++ b/packages/react-testing/package.json @@ -3,13 +3,12 @@ "version": "1.8.4", "license": "MIT", "description": "A library for testing React components according to our conventions.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-testing/tsconfig.build.json b/packages/react-testing/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-testing/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-testing/tsconfig.json b/packages/react-testing/tsconfig.json new file mode 100644 index 0000000000..a392b60c3e --- /dev/null +++ b/packages/react-testing/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../useful-types"}] +} diff --git a/packages/react-tracking-pixel/package.json b/packages/react-tracking-pixel/package.json index c9097b0be1..b8d0e5d320 100644 --- a/packages/react-tracking-pixel/package.json +++ b/packages/react-tracking-pixel/package.json @@ -3,11 +3,10 @@ "version": "3.0.28", "license": "MIT", "description": "Allows React apps to easily embed tracking pixel iframes", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/react-tracking-pixel/tsconfig.build.json b/packages/react-tracking-pixel/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-tracking-pixel/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-tracking-pixel/tsconfig.json b/packages/react-tracking-pixel/tsconfig.json new file mode 100644 index 0000000000..a6a6bc9562 --- /dev/null +++ b/packages/react-tracking-pixel/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../react-html"}] +} diff --git a/packages/react-universal-provider/package.json b/packages/react-universal-provider/package.json index 39f0515bd5..73e4eecef0 100644 --- a/packages/react-universal-provider/package.json +++ b/packages/react-universal-provider/package.json @@ -3,13 +3,12 @@ "version": "1.0.14", "license": "MIT", "description": "Factory function and utilities to create self-serializing/deserializing provider that works for isomorphic applications.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-universal-provider/tsconfig.build.json b/packages/react-universal-provider/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/react-universal-provider/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-universal-provider/tsconfig.json b/packages/react-universal-provider/tsconfig.json new file mode 100644 index 0000000000..a6a6bc9562 --- /dev/null +++ b/packages/react-universal-provider/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../react-html"}] +} diff --git a/packages/react-web-worker/package.json b/packages/react-web-worker/package.json index b542660340..4129fe0152 100644 --- a/packages/react-web-worker/package.json +++ b/packages/react-web-worker/package.json @@ -3,13 +3,12 @@ "version": "1.2.1", "license": "MIT", "description": "A hook for using web workers in React applications", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/react-web-worker/tsconfig.build.json b/packages/react-web-worker/tsconfig.build.json deleted file mode 100644 index ebe676b5ff..0000000000 --- a/packages/react-web-worker/tsconfig.build.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": ["./src/**/*.ts", "./src/**/*.tsx"], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/react-web-worker/tsconfig.json b/packages/react-web-worker/tsconfig.json new file mode 100644 index 0000000000..9027b1c81d --- /dev/null +++ b/packages/react-web-worker/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../tsconfig_base.json", + "compileOnSave": false, + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": ["./src/**/*.ts", "./src/**/*.tsx"], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../web-worker"}] +} diff --git a/packages/rpc/package.json b/packages/rpc/package.json index b46ccf0f2f..aabee6089f 100644 --- a/packages/rpc/package.json +++ b/packages/rpc/package.json @@ -3,13 +3,12 @@ "version": "1.0.1", "license": "MIT", "description": "Utilities for postmessage-based remote procedure calls.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/rpc/src/adaptors/message-port.ts b/packages/rpc/src/adaptors/message-port.ts index ac13d7f6c3..4d254c81fe 100644 --- a/packages/rpc/src/adaptors/message-port.ts +++ b/packages/rpc/src/adaptors/message-port.ts @@ -2,7 +2,8 @@ import {MessageEndpoint} from '../types'; export function fromMessagePort(messagePort: MessagePort): MessageEndpoint { return { - postMessage: (...args) => messagePort.postMessage(...args), + postMessage: (...args: [any, Transferable[]]) => + messagePort.postMessage(...args), addEventListener: (...args) => messagePort.addEventListener(...args), removeEventListener: (...args) => messagePort.removeEventListener(...args), terminate() { diff --git a/packages/rpc/src/strategies/channel.ts b/packages/rpc/src/strategies/channel.ts index 22dda772b1..db3259c8cf 100644 --- a/packages/rpc/src/strategies/channel.ts +++ b/packages/rpc/src/strategies/channel.ts @@ -64,7 +64,7 @@ export function createChannelFunctionStrategy({ const [serializedResult, transferables] = toWire(result); port1.postMessage( [RESULT, id, undefined, serializedResult], - transferables, + transferables as Transferable[], ); } catch (error) { const {name, message, stack} = error; @@ -182,7 +182,10 @@ export function createChannelFunctionStrategy({ }); const [serializedArgs, transferables] = toWire(args); - port.postMessage([APPLY, id, serializedArgs], transferables); + port.postMessage( + [APPLY, id, serializedArgs], + transferables as Transferable[], + ); return done; }, diff --git a/packages/rpc/tsconfig.build.json b/packages/rpc/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/rpc/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/address-consts/tsconfig.build.json b/packages/rpc/tsconfig.json similarity index 73% rename from packages/address-consts/tsconfig.build.json rename to packages/rpc/tsconfig.json index e836cbeb4e..960606e35b 100644 --- a/packages/address-consts/tsconfig.build.json +++ b/packages/rpc/tsconfig.json @@ -1,10 +1,10 @@ { - "extends": "../../tsconfig.json", + "extends": "../tsconfig_base.json", "compileOnSave": false, "compilerOptions": { "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" + "baseUrl": ".", + "rootDir": "." }, "include": [ "../../config/typescript/**/*", diff --git a/packages/semaphore/package.json b/packages/semaphore/package.json index 5f58707e81..fbaff4838e 100644 --- a/packages/semaphore/package.json +++ b/packages/semaphore/package.json @@ -3,13 +3,12 @@ "version": "1.0.1", "license": "MIT", "description": "Counting semaphore", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/semaphore/tsconfig.build.json b/packages/semaphore/tsconfig.json similarity index 60% rename from packages/semaphore/tsconfig.build.json rename to packages/semaphore/tsconfig.json index ac90b03fee..9c050af46c 100644 --- a/packages/semaphore/tsconfig.build.json +++ b/packages/semaphore/tsconfig.json @@ -1,10 +1,9 @@ { - "extends": "../../tsconfig.json", - "compileOnSave": false, + "extends": "../tsconfig_base.json", "compilerOptions": { "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" + "baseUrl": ".", + "rootDir": "." }, "include": [ "../../config/typescript/**/*", diff --git a/packages/sewing-kit-koa/package.json b/packages/sewing-kit-koa/package.json index 5012799e73..16ad45f2dc 100644 --- a/packages/sewing-kit-koa/package.json +++ b/packages/sewing-kit-koa/package.json @@ -3,13 +3,12 @@ "version": "6.1.5", "license": "MIT", "description": "Easily access Sewing Kit assets from a Koa server.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/sewing-kit-koa/tsconfig.build.json b/packages/sewing-kit-koa/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/sewing-kit-koa/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/sewing-kit-koa/tsconfig.json b/packages/sewing-kit-koa/tsconfig.json new file mode 100644 index 0000000000..35f07c9b4f --- /dev/null +++ b/packages/sewing-kit-koa/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../network"}] +} diff --git a/packages/statsd/package.json b/packages/statsd/package.json index a3e50358be..b0265295d3 100644 --- a/packages/statsd/package.json +++ b/packages/statsd/package.json @@ -3,13 +3,12 @@ "version": "1.1.0", "license": "MIT", "description": "An opinionated StatsD client for Shopify Node.js server and other StatsD utilities.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/statsd/tsconfig.build.json b/packages/statsd/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/statsd/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/address-mocks/tsconfig.build.json b/packages/statsd/tsconfig.json similarity index 73% rename from packages/address-mocks/tsconfig.build.json rename to packages/statsd/tsconfig.json index e836cbeb4e..960606e35b 100644 --- a/packages/address-mocks/tsconfig.build.json +++ b/packages/statsd/tsconfig.json @@ -1,10 +1,10 @@ { - "extends": "../../tsconfig.json", + "extends": "../tsconfig_base.json", "compileOnSave": false, "compilerOptions": { "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" + "baseUrl": ".", + "rootDir": "." }, "include": [ "../../config/typescript/**/*", diff --git a/packages/tsconfig.json b/packages/tsconfig.json new file mode 100644 index 0000000000..1c1e2f90d2 --- /dev/null +++ b/packages/tsconfig.json @@ -0,0 +1,77 @@ +{ + "files": [], + "include": [], + "references": [ + {"path": "./address"}, + {"path": "./address-consts"}, + {"path": "./address-mocks"}, + {"path": "./admin-graphql-api-utilities"}, + {"path": "./ast-utilities"}, + {"path": "./async"}, + {"path": "./csrf-token-fetcher"}, + {"path": "./css-utilities"}, + {"path": "./dates"}, + {"path": "./decorators"}, + {"path": "./enzyme-utilities"}, + {"path": "./function-enhancers"}, + {"path": "./graphql-persisted"}, + {"path": "./graphql-testing"}, + {"path": "./i18n"}, + {"path": "./jest-dom-mocks"}, + {"path": "./jest-koa-mocks"}, + {"path": "./jest-mock-apollo"}, + {"path": "./jest-mock-router"}, + {"path": "./koa-liveness-ping"}, + {"path": "./koa-metrics"}, + {"path": "./koa-performance"}, + {"path": "./koa-shopify-auth"}, + {"path": "./koa-shopify-graphql-proxy"}, + {"path": "./koa-shopify-webhooks"}, + {"path": "./logger"}, + {"path": "./network"}, + {"path": "./performance"}, + {"path": "./polyfills"}, + {"path": "./predicates"}, + {"path": "./react-app-bridge-universal-provider"}, + {"path": "./react-async"}, + {"path": "./react-compose"}, + {"path": "./react-cookie"}, + {"path": "./react-csrf"}, + {"path": "./react-csrf-universal-provider"}, + {"path": "./react-effect"}, + {"path": "./react-effect-apollo"}, + {"path": "./react-form"}, + {"path": "./react-form-state"}, + {"path": "./react-google-analytics"}, + {"path": "./react-graphql"}, + {"path": "./react-graphql-universal-provider"}, + {"path": "./react-hooks"}, + {"path": "./react-html"}, + {"path": "./react-hydrate"}, + {"path": "./react-i18n"}, + {"path": "./react-i18n-universal-provider"}, + {"path": "./react-idle"}, + {"path": "./react-import-remote"}, + {"path": "./react-intersection-observer"}, + {"path": "./react-network"}, + {"path": "./react-performance"}, + {"path": "./react-preconnect"}, + {"path": "./react-router"}, + {"path": "./react-serialize"}, + {"path": "./react-server"}, + {"path": "./react-server-webpack-plugin"}, + {"path": "./react-shopify-app-route-propagator"}, + {"path": "./react-shortcuts"}, + {"path": "./react-testing"}, + {"path": "./react-tracking-pixel"}, + {"path": "./react-universal-provider"}, + {"path": "./react-web-worker"}, + {"path": "./rpc"}, + {"path": "./semaphore"}, + {"path": "./sewing-kit-koa"}, + {"path": "./statsd"}, + {"path": "./useful-types"}, + {"path": "./web-worker"}, + {"path": "./with-env"} + ] +} diff --git a/tsconfig.base.json b/packages/tsconfig_base.json similarity index 78% rename from tsconfig.base.json rename to packages/tsconfig_base.json index 0245b7487c..2f72b727f1 100644 --- a/tsconfig.base.json +++ b/packages/tsconfig_base.json @@ -1,10 +1,14 @@ { + "compileOnSave": false, "compilerOptions": { + "composite": true, + "declaration": true, + "declarationMap": true, + "pretty": true, "moduleResolution": "node", "target": "es5", "downlevelIteration": true, "esModuleInterop": true, - "declaration": true, "jsx": "react", "strictNullChecks": true, "noImplicitAny": false, @@ -22,8 +26,7 @@ "es2017", "es2018", "esnext.asynciterable" - ] - }, - "include": ["./config/typescript/**/*.d.ts", "./**/*.ts", "./**/*.tsx"], - "exclude": ["./node_modules"] + ], + "typeRoots": ["../node_modules/@types"] + } } diff --git a/packages/useful-types/package.json b/packages/useful-types/package.json index c9bf459fa5..cf90a7ecd8 100644 --- a/packages/useful-types/package.json +++ b/packages/useful-types/package.json @@ -3,11 +3,10 @@ "version": "2.1.0", "license": "MIT", "description": "A few handy TypeScript types", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/useful-types/src/types.ts b/packages/useful-types/src/types.ts index ee1556273e..698f1db8e1 100644 --- a/packages/useful-types/src/types.ts +++ b/packages/useful-types/src/types.ts @@ -64,3 +64,5 @@ type ReactStatics = | 'getDefaultProps' | 'propTypes'; export type NonReactStatics = Pick>; + +export type ExtendedWindow = Window & typeof globalThis & T; diff --git a/packages/useful-types/tsconfig.build.json b/packages/useful-types/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/useful-types/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/useful-types/tsconfig.json b/packages/useful-types/tsconfig.json new file mode 100644 index 0000000000..c9c8ebc2a0 --- /dev/null +++ b/packages/useful-types/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": ["./src/**/*.ts"] +} diff --git a/packages/web-worker/babel.d.ts b/packages/web-worker/babel.d.ts index f7a5261b74..89396c95af 100644 --- a/packages/web-worker/babel.d.ts +++ b/packages/web-worker/babel.d.ts @@ -1,2 +1,2 @@ -export {default} from './dist/babel-plugin'; -export * from './dist/babel-plugin'; +export {default} from './dist/src/babel-plugin'; +export * from './dist/src/babel-plugin'; diff --git a/packages/web-worker/babel.js b/packages/web-worker/babel.js index ecb6e1f242..e65b208720 100644 --- a/packages/web-worker/babel.js +++ b/packages/web-worker/babel.js @@ -1 +1 @@ -module.exports = require('./dist/babel-plugin'); +module.exports = require('./dist/src/babel-plugin'); diff --git a/packages/web-worker/package.json b/packages/web-worker/package.json index 6197dbd722..9b7050e9bc 100644 --- a/packages/web-worker/package.json +++ b/packages/web-worker/package.json @@ -3,13 +3,12 @@ "version": "1.3.1", "license": "MIT", "description": "Tools for making web workers fun to use.", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/packages/web-worker/src/messenger/iframe.ts b/packages/web-worker/src/messenger/iframe.ts index 58e37ac60c..26a2ad366e 100644 --- a/packages/web-worker/src/messenger/iframe.ts +++ b/packages/web-worker/src/messenger/iframe.ts @@ -35,7 +35,7 @@ export function createIframeWorkerMessenger(url: URL): MessageEndpoint { document.body.appendChild(iframe); return { - postMessage: (...args) => port1.postMessage(...args), + postMessage: (...args: [any, Transferable[]]) => port1.postMessage(...args), addEventListener: (...args) => port1.addEventListener(...args), removeEventListener: (...args) => port1.removeEventListener(...args), terminate() { diff --git a/packages/web-worker/tsconfig.build.json b/packages/web-worker/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/web-worker/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/web-worker/tsconfig.json b/packages/web-worker/tsconfig.json new file mode 100644 index 0000000000..4e519176e6 --- /dev/null +++ b/packages/web-worker/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../tsconfig_base.json", + "compileOnSave": false, + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": ".", + "paths": { + "webpack": ["node_modules/webpack"] + } + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"], + "references": [{"path": "../rpc"}] +} diff --git a/packages/web-worker/webpack.d.ts b/packages/web-worker/webpack.d.ts index c36c1c3864..71d795fd8b 100644 --- a/packages/web-worker/webpack.d.ts +++ b/packages/web-worker/webpack.d.ts @@ -1,2 +1,2 @@ -export {default} from './dist/webpack-parts'; -export * from './dist/webpack-parts'; +export {default} from './dist/src/webpack-parts'; +export * from './dist/src/webpack-parts'; diff --git a/packages/web-worker/webpack.js b/packages/web-worker/webpack.js index 9ab2e0815a..50b1219cf1 100644 --- a/packages/web-worker/webpack.js +++ b/packages/web-worker/webpack.js @@ -1 +1 @@ -module.exports = require('./dist/webpack-parts'); +module.exports = require('./dist/src/webpack-parts'); diff --git a/packages/web-worker/worker.d.ts b/packages/web-worker/worker.d.ts index dca3663106..feafe83456 100644 --- a/packages/web-worker/worker.d.ts +++ b/packages/web-worker/worker.d.ts @@ -1,2 +1,2 @@ -export {default} from './dist/worker'; -export * from './dist/worker'; +export {default} from './dist/src/worker'; +export * from './dist/src/worker'; diff --git a/packages/web-worker/worker.js b/packages/web-worker/worker.js index 16e10be898..7f964edf0f 100644 --- a/packages/web-worker/worker.js +++ b/packages/web-worker/worker.js @@ -1 +1 @@ -module.exports = require('./dist/worker'); +module.exports = require('./dist/src/worker'); diff --git a/packages/with-env/package.json b/packages/with-env/package.json index 29fe2babe3..00a064293d 100644 --- a/packages/with-env/package.json +++ b/packages/with-env/package.json @@ -3,11 +3,10 @@ "version": "1.1.2", "license": "MIT", "description": "A utility for executing code under a specific NODE_ENV.", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, "publishConfig": { "access": "public", diff --git a/packages/with-env/tsconfig.build.json b/packages/with-env/tsconfig.build.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/packages/with-env/tsconfig.build.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/packages/with-env/tsconfig.json b/packages/with-env/tsconfig.json new file mode 100644 index 0000000000..1d7acfe46f --- /dev/null +++ b/packages/with-env/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": ["./src/**/*.ts"], + "exclude": ["**/*.test.ts"] +} diff --git a/plopfile.js b/plopfile.js index 943f406acb..bba7cd8b28 100644 --- a/plopfile.js +++ b/plopfile.js @@ -32,8 +32,8 @@ module.exports = function(plop) { }, { type: 'add', - path: 'packages/{{kebabCase name}}/tsconfig.build.json', - templateFile: 'templates/tsconfig.build.hbs.json', + path: 'packages/{{kebabCase name}}/tsconfig.json', + templateFile: 'templates/tsconfig.hbs.json', }, { type: 'add', diff --git a/templates/package.hbs.json b/templates/package.hbs.json index 3b251be3d1..9d3ac268fb 100644 --- a/templates/package.hbs.json +++ b/templates/package.hbs.json @@ -3,13 +3,12 @@ "version": "0.0.0", "license": "MIT", "description": "{{description}}", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "sideEffects": false, + "main": "dist/src/index.js", + "types": "dist/src/index.d.ts", "scripts": { - "build": "tsc --p tsconfig.build.json", - "prepublishOnly": "yarn run build" + "build": "tsc --p tsconfig.json" }, + "sideEffects": false, "publishConfig": { "access": "public", "@shopify:registry": "https://registry.npmjs.org" diff --git a/templates/tsconfig.build.hbs.json b/templates/tsconfig.build.hbs.json deleted file mode 100644 index e836cbeb4e..0000000000 --- a/templates/tsconfig.build.hbs.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compileOnSave": false, - "compilerOptions": { - "outDir": "./dist", - "baseUrl": "./src", - "rootDir": "./src" - }, - "include": [ - "../../config/typescript/**/*", - "./src/**/*.ts", - "./src/**/*.tsx" - ], - "exclude": ["**/*.test.ts", "**/*.test.tsx"] -} diff --git a/templates/tsconfig.hbs.json b/templates/tsconfig.hbs.json new file mode 100644 index 0000000000..4c83bd9c76 --- /dev/null +++ b/templates/tsconfig.hbs.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig_base.json", + "compilerOptions": { + "outDir": "./dist", + "baseUrl": ".", + "rootDir": "." + }, + "include": [ + "../../config/typescript/**/*", + "./src/**/*.ts", + "./src/**/*.tsx" + ], + "exclude": ["**/*.test.ts", "**/*.test.tsx"] +} diff --git a/test/tsconfig.eslint.json b/test/tsconfig.eslint.json new file mode 100644 index 0000000000..4fca01f5d9 --- /dev/null +++ b/test/tsconfig.eslint.json @@ -0,0 +1,7 @@ +{ + "extends": "../packages/tsconfig_base.json", + "compilerOptions": { + "noEmit": true + }, + "include": ["./**/*.ts"] +} diff --git a/test/typescript-project-references.test.ts b/test/typescript-project-references.test.ts new file mode 100644 index 0000000000..e0d199ae36 --- /dev/null +++ b/test/typescript-project-references.test.ts @@ -0,0 +1,29 @@ +import {resolve} from 'path'; + +import {readJSONSync} from 'fs-extra'; +import glob from 'glob'; + +const IGNORE_REGEX = [ + /tsconfig\.json/, + /tsconfig_base\.json/, + /react-self-serializer/, +]; + +const ROOT = resolve(__dirname, '..'); +const projectReferencesConfig = resolve(ROOT, 'packages', 'tsconfig.json'); + +describe('typescript project references', () => { + it('includes all the packages', () => { + const referencesConfig = readJSONSync(projectReferencesConfig); + const references = referencesConfig.references.map(({path}) => + path.replace('./', ''), + ); + + const packages = glob + .sync(resolve(ROOT, 'packages', '*')) + .filter(filePath => !IGNORE_REGEX.some(regex => regex.test(filePath))) + .map(packagePath => packagePath.split('quilt/packages/')[1]); + + expect(packages).toStrictEqual(references); + }); +}); diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index 935ca7ba0c..0000000000 --- a/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./tsconfig.base.json", - "compilerOptions": { - "baseUrl": ".", - "paths": { - "@shopify/react-effect/server": ["packages/react-effect/src/server"], - "@shopify/*": ["packages/*/src/index"] - } - } -} diff --git a/yarn.lock b/yarn.lock index 1093a4dc42..d939531d7f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1506,7 +1506,7 @@ resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c" integrity sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA== -"@types/react-dom@^16.0.11", "@types/react-dom@^16.8.3": +"@types/react-dom@16.8.3", "@types/react-dom@^16.0.11", "@types/react-dom@^16.8.3": version "16.8.3" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.8.3.tgz#6131b7b6158bc7ed1925a3374b88b7c00481f0cb" integrity sha512-HF5hD5YR3z9Mn6kXcW1VKe4AQ04ZlZj1EdLBae61hzQ3eEWWxMgNLUbIxeZp40BnSxqY1eAYLsH9QopQcxzScA== @@ -10606,10 +10606,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@~3.2.1: - version "3.2.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.4.tgz#c585cb952912263d915b462726ce244ba510ef3d" - integrity sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg== +typescript@^3.6.2: + version "3.6.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.2.tgz#105b0f1934119dde543ac8eb71af3a91009efe54" + integrity sha512-lmQ4L+J6mnu3xweP8+rOrUwzmN+MRAj7TgtJtDaXE5PMyX2kCrklhg3rvOsOIfNeAWMQWO2F1GPc1kMD2vLAfw== ua-parser-js@^0.7.18: version "0.7.20"