Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Use TypeScript project references #962

Merged
merged 11 commits into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ lerna-debug.log

tmp
**/test.log

*.tsbuildinfo
4 changes: 0 additions & 4 deletions config/typescript/globals.d.ts

This file was deleted.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand Down Expand Up @@ -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": {
Expand Down
9 changes: 4 additions & 5 deletions packages/address-consts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
ismail-syed marked this conversation as resolved.
Show resolved Hide resolved
"build": "tsc --p tsconfig.json"
},
"sideEffects": false,
"publishConfig": {
"access": "public",
"@shopify:registry": "https://registry.npmjs.org"
Expand Down
Original file line number Diff line number Diff line change
@@ -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/**/*",
Expand Down
11 changes: 5 additions & 6 deletions packages/address-mocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 15 additions & 0 deletions packages/address-mocks/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"}]
}
11 changes: 5 additions & 6 deletions packages/address/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 15 additions & 0 deletions packages/address/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"}]
}
7 changes: 3 additions & 4 deletions packages/admin-graphql-api-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 14 additions & 0 deletions packages/admin-graphql-api-utilities/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}
2 changes: 1 addition & 1 deletion packages/ast-utilities/javascript.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './dist/javascript';
export * from './dist/src/javascript';
2 changes: 1 addition & 1 deletion packages/ast-utilities/javascript.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./dist/javascript');
module.exports = require('./dist/src/javascript');
2 changes: 1 addition & 1 deletion packages/ast-utilities/markdown.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './dist/markdown';
export * from './dist/src/markdown';
2 changes: 1 addition & 1 deletion packages/ast-utilities/markdown.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./dist/markdown');
module.exports = require('./dist/src/markdown');
9 changes: 4 additions & 5 deletions packages/ast-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 0 additions & 15 deletions packages/ast-utilities/tsconfig.build.json

This file was deleted.

14 changes: 14 additions & 0 deletions packages/ast-utilities/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}
4 changes: 2 additions & 2 deletions packages/async/babel.d.ts
Original file line number Diff line number Diff line change
@@ -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';
2 changes: 1 addition & 1 deletion packages/async/babel.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./dist/babel-plugin');
module.exports = require('./dist/src/babel-plugin');
9 changes: 4 additions & 5 deletions packages/async/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/async/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type RequestIdleCallback = (
deadline: RequestIdleCallbackDeadline,
) => void;

export interface WindowWithRequestIdleCallback {
export interface WindowWithRequestIdleCallback extends Window {
requestIdleCallback(
callback: RequestIdleCallback,
opts?: RequestIdleCallbackOptions,
Expand Down
15 changes: 0 additions & 15 deletions packages/async/tsconfig.build.json

This file was deleted.

14 changes: 14 additions & 0 deletions packages/async/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}
7 changes: 3 additions & 4 deletions packages/csrf-token-fetcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 0 additions & 15 deletions packages/csrf-token-fetcher/tsconfig.build.json

This file was deleted.

14 changes: 14 additions & 0 deletions packages/csrf-token-fetcher/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}
9 changes: 4 additions & 5 deletions packages/css-utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading