Skip to content

Commit

Permalink
Update TypeScript to v2.9 (#1500)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaelig authored Jun 7, 2018
1 parent d43e11c commit 8fcc093
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 22 deletions.
9 changes: 0 additions & 9 deletions config/typescript/json.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"stylelint-config-shopify": "^5.0.1",
"svgo": "^0.7.2",
"tslint": "^5.8.0",
"typescript": "^2.8.3",
"typescript": "^2.9.1",
"url-loader": "^0.6.2",
"webpack": "^3.7.1",
"webpack-bundle-analyzer": "^2.11.1",
Expand Down
1 change: 1 addition & 0 deletions playground/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"jsx": "react",
"strictNullChecks": true,
"noImplicitAny": true,
"resolveJsonModule": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"noUnusedParameters": true,
Expand Down
8 changes: 7 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {execSync} from 'child_process';
import {ensureDirSync, writeFileSync, readFileSync} from 'fs-extra';
import {join, resolve as resolvePath} from 'path';
import {rollup} from 'rollup';
import {cp} from 'shelljs';
import {cp, mv, rm} from 'shelljs';
import copyfiles from 'copyfiles';

import createRollupConfig from '../config/rollup';
Expand All @@ -20,14 +20,20 @@ const mainEntry = resolvePath(intermediateBuild, './index.js');
const embeddedEntry = resolvePath(intermediateBuild, './embedded/index.js');

const scripts = resolvePath(root, 'scripts');
const types = resolvePath(root, 'types');
const tsBuild = resolvePath(scripts, 'tsconfig.json');

execSync(`${resolvePath(root, './node_modules/.bin/tsc')} --outDir ${intermediateBuild} --project ${tsBuild}`, {
stdio: 'inherit',
});

mv(resolvePath(root, 'types/src/*'), types);
rm(resolvePath(root, 'types/src'));

writeFileSync(resolvePath(root, 'embedded.d.ts'), "export * from './types/embedded';\n");

mv(resolvePath(intermediateBuild, 'src/*'), intermediateBuild);

const srcReadme = resolvePath(root, './src/components/README.md');
const destinationReadme = resolvePath(docs, './components/README.md');

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppProvider/Intl.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import merge from 'lodash/merge';
import {autobind} from '@shopify/javascript-utilities/decorators';

import {en as defaultTranslation} from '../../locales';
import defaultTranslation from '../../locales';

import {
TranslationDictionary,
Expand Down
6 changes: 3 additions & 3 deletions src/components/AppProvider/utils/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import {Props as AppProviderProps, Context} from '../AppProvider';
import EASDK from '../EASDK';
import StickyManager from '../StickyManager';

import {name, version} from '../../../../package.json';
import packageJSON from '../../../../package.json';

const METADATA = {
interface: {
name,
version,
name: packageJSON.name,
version: packageJSON.version,
},
};

Expand Down
4 changes: 3 additions & 1 deletion src/locales/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export {default as en} from './en.json';
import en from './en.json';

export default en;
8 changes: 5 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"compilerOptions": {
"baseUrl": "./src",
"rootDir": "./src",
"baseUrl": "./",
"rootDir": "./",
"target": "es2016",
"module": "es2015",
"moduleResolution": "node",
"resolveJsonModule": true,
"declaration": true,
"declarationDir": "types",
"jsx": "react-native",
Expand All @@ -27,6 +28,7 @@
},
"include": [
"./config/typescript/**/*",
"./src/**/*"
"./src/**/*",
"./package.json"
]
}
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9807,9 +9807,9 @@ typescript-eslint-parser@^11.0.0:
lodash.unescape "4.0.1"
semver "5.4.1"

typescript@^2.8.3:
version "2.8.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.3.tgz#5d817f9b6f31bb871835f4edf0089f21abe6c170"
typescript@^2.9.1:
version "2.9.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.1.tgz#fdb19d2c67a15d11995fd15640e373e09ab09961"

ua-parser-js@^0.7.9:
version "0.7.17"
Expand Down

0 comments on commit 8fcc093

Please sign in to comment.