Skip to content

Commit

Permalink
feat(build): Reduce external dependencies (#622)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmeku authored Apr 6, 2019
1 parent 841c843 commit c5a2a52
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 28 deletions.
16 changes: 8 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: 2
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node:8.12.0-stretch-browsers
- image: circleci/node:11.13.0-stretch-browsers

jobs:
build:
Expand All @@ -16,13 +16,13 @@ jobs:
- checkout
- restore_cache:
keys:
- yarn-dependencies-v10-{{ .Branch }}-{{ checksum "yarn.lock" }}
- yarn-dependencies-v10-{{ .Branch }}-
- yarn-dependencies-11.13.0-{{ .Branch }}-{{ checksum "yarn.lock" }}
- yarn-dependencies-11.13.0-{{ .Branch }}-
# fallback to using the latest cache if no exact match is found
- yarn-dependencies-v10-
- yarn-dependencies-11.13.0-
- run: yarn install --frozen-lockfile --non-interactive
- save_cache:
key: yarn-dependencies-v10-{{ .Branch }}-{{ checksum "yarn.lock" }}
key: yarn-dependencies-11.13.0-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- ~/.cache
- run: yarn start format.and.lint.check
Expand All @@ -40,10 +40,10 @@ jobs:
- checkout
- restore_cache:
keys:
- yarn-dependencies-v10-{{ .Branch }}-{{ checksum "yarn.lock" }}
- yarn-dependencies-v10-{{ .Branch }}-
- yarn-dependencies-11.13.0-{{ .Branch }}-{{ checksum "yarn.lock" }}
- yarn-dependencies-11.13.0-{{ .Branch }}-
# fallback to using the latest cache if no exact match is found
- yarn-dependencies-v10-
- yarn-dependencies-11.13.0-
- run: yarn install --frozen-lockfile --non-interactive
- run: yarn start prepare.e2e
- run:
Expand Down
23 changes: 20 additions & 3 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,13 @@
"outputPath": "dist/apps/vscode",
"main": "apps/vscode/src/main.ts",
"sourceMap": false,
"externalDependencies": ["vscode", "node-pty-prebuilt"],
"externalDependencies": [
"vscode",
"source-map-explorer",
"semver",
"tmp",
"node-pty-prebuilt"
],
"tsConfig": "apps/vscode/tsconfig.app.json",
"assets": [
"apps/vscode/src/package.json",
Expand Down Expand Up @@ -220,7 +226,13 @@
"build": {
"builder": "@nrwl/builders:node-build",
"options": {
"externalDependencies": ["electron", "node-pty-prebuilt"],
"externalDependencies": [
"electron",
"source-map-explorer",
"semver",
"tmp",
"node-pty-prebuilt"
],
"outputPath": "dist/apps/electron",
"main": "apps/electron/src/main.ts",
"tsConfig": "apps/electron/tsconfig.app.json",
Expand Down Expand Up @@ -267,7 +279,12 @@
"outputPath": "dist/apps/intellij",
"main": "apps/intellij/src/main.ts",
"sourceMap": false,
"externalDependencies": ["node-pty-prebuilt"],
"externalDependencies": [
"source-map-explorer",
"semver",
"tmp",
"node-pty-prebuilt"
],
"tsConfig": "apps/intellij/tsconfig.app.json",
"assets": [
"apps/intellij/src/package.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Workspaces', () => {
beforeEach(() => {
whitelistGraphql();
cy.visit('/workspaces');
cy.get('.add-workspace-container').trigger('mouseover');
cy.get('.add-workspace-container').trigger('mouseover', { force: true });
});

it('creates new workspaces', () => {
Expand Down
2 changes: 1 addition & 1 deletion apps/electron/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"license": "MIT",
"dependencies": {
"semver": "5.6.0",
"tmp": "0.0.33",
"tmp": "^0.1.0",
"node-pty-prebuilt": "0.7.6",
"source-map-explorer": "^1.7.0"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/intellij/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"license": "MIT",
"dependencies": {
"semver": "5.6.0",
"tmp": "0.0.33",
"tmp": "^0.1.0",
"node-pty-prebuilt": "0.7.6",
"source-map-explorer": "^1.7.0"
}
Expand Down
2 changes: 1 addition & 1 deletion apps/vscode/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"dependencies": {
"semver": "5.6.0",
"tmp": "0.0.33",
"tmp": "^0.1.0",
"node-pty-prebuilt": "0.7.6",
"source-map-explorer": "^1.7.0"
}
Expand Down
5 changes: 0 additions & 5 deletions libs/server/src/lib/api/detailed-status-calculator.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
(global as any).__non_webpack_require__ = () => {
return () => {
throw new Error();
};
};
import {
StatusType,
BuildDetailedStatusCalculator,
Expand Down
5 changes: 0 additions & 5 deletions libs/server/src/lib/utils/stats.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
(global as any).__non_webpack_require__ = () => {
return () => {
throw new Error();
};
};
import { parseStats, calculateStatsFromChunks } from './stats';
import { join } from 'path';

Expand Down
2 changes: 1 addition & 1 deletion libs/server/src/lib/utils/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { join } from 'path';
import { SPECIAL_SOURCE_FILE_MAPPINGS } from './stats.constants';

// @ts-ignore
const exploreSourceMap = __non_webpack_require__('source-map-explorer');
import * as exploreSourceMap from 'source-map-explorer';

export interface Chunk {
name: string;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"node-pty-prebuilt": "0.7.6",
"semver": "5.6.0",
"source-map-explorer": "^1.7.0",
"tmp": "0.0.33"
"tmp": "^0.1.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.13.1",
Expand Down
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11129,7 +11129,7 @@ retry@^0.10.0:
resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4"
integrity sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q=

rimraf@2, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@~2.6.2:
rimraf@2, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3, rimraf@~2.6.2:
version "2.6.3"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"
integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==
Expand Down Expand Up @@ -12566,6 +12566,13 @@ [email protected], tmp@^0.0.33:
dependencies:
os-tmpdir "~1.0.2"

tmp@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.1.0.tgz#ee434a4e22543082e294ba6201dcc6eafefa2877"
integrity sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw==
dependencies:
rimraf "^2.6.3"

[email protected]:
version "1.0.4"
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1"
Expand Down

0 comments on commit c5a2a52

Please sign in to comment.