Skip to content

Commit e3e8ba1

Browse files
author
Miles Johnson
committed
internal: Fix build based on changes.
1 parent 91084fe commit e3e8ba1

File tree

11 files changed

+33
-16
lines changed

11 files changed

+33
-16
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"setup": "tsc --build && beemo create-config eslint prettier",
77
"build": "beemo typescript --build --reference-workspaces",
88
"clean": "rm -rf packages/*/{lib,*.tsbuildinfo}",
9-
"test": "yarn run build && yarn run jest && yarn run eslint",
10-
"eslint": "beemo eslint .",
9+
"test": "yarn run build && yarn run jest && yarn run lint",
10+
"lint": "beemo eslint .",
1111
"jest": "beemo jest",
1212
"prettier": "beemo prettier",
1313
"prerelease": "yarn run clean && yarn run test",

packages/config-webpack/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"webpack-graphql-loader": "^1.0.2"
4545
},
4646
"devDependencies": {
47+
"@types/html-minifier-terser": "^5.0.0",
4748
"@types/html-webpack-plugin": "^3.2.2",
4849
"@types/terser-webpack-plugin": "^2.2.0",
4950
"@types/webpack-bundle-analyzer": "^2.13.3"

packages/config-webpack/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import path from 'path';
44
import webpack from 'webpack';
55
import HtmlWebpackPlugin from 'html-webpack-plugin';
6-
// @ts-ignore Not typed
76
import InlineManifestWebpackPlugin from 'inline-manifest-webpack-plugin';
87
import TerserPlugin from 'terser-webpack-plugin';
98
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
@@ -51,7 +50,6 @@ export function getConfig({
5150
}),
5251
new HtmlWebpackPlugin({
5352
chunks: ['runtime', 'core'],
54-
chunksSortMode: 'none',
5553
template: `${srcFolder}/index.html`,
5654
filename: 'index.html',
5755
favicon: getFavIcon(srcPath),

packages/nimbus/src/bins/eject.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import fs from 'fs';
44
import chalk from 'chalk';
55
import execa from 'execa';
6-
// @ts-ignore Not typed
76
import editJsonFile from 'edit-json-file';
87
import { prompt } from 'enquirer';
98
import { Path } from '@beemo/core';
@@ -28,8 +27,8 @@ async function copyAndInstallDepsFromModule(
2827
isYarn: boolean,
2928
isMonorepo: boolean,
3029
) {
31-
const pkg = require(`${moduleName}/package.json`);
32-
const deps = Object.keys(pkg.dependencies).filter(
30+
const pkg: NimbusPackage = require(`${moduleName}/package.json`);
31+
const deps = Object.keys(pkg.dependencies || {}).filter(
3332
(dep) => !dep.includes('@beemo') && !dep.includes('@airbnb/nimbus'),
3433
);
3534

@@ -75,7 +74,7 @@ function migrateDotfiles() {
7574

7675
function migratePackageScripts(nimbus: NimbusPackage['nimbus']) {
7776
const pkg = editJsonFile(pkgPath);
78-
const scripts = pkg.get('scripts') || {};
77+
const scripts = pkg.get<NimbusPackage['scripts']>('scripts') ?? {};
7978
const srcFolder = nimbus.settings.srcFolder || 'src';
8079
const testFolder = nimbus.settings.testFolder || 'test';
8180

@@ -142,7 +141,7 @@ function migrateEslint() {
142141

143142
function migrateJest() {
144143
const configPath = Path.resolve('jest.config.js').path();
145-
const config = require(configPath);
144+
const config: { [key: string]: unknown } = require(configPath);
146145

147146
delete config.moduleNameMapper;
148147
delete config.setupFiles;
@@ -184,7 +183,7 @@ export async function eject() {
184183
console.log(BANNER);
185184
console.log(`${chalk.cyan('[1/5]')} Ejecting Nimbus`);
186185

187-
const nimbus = editJsonFile(pkgPath).get('nimbus');
186+
const nimbus = editJsonFile(pkgPath).get<NimbusPackage['nimbus']>('nimbus');
188187

189188
if (!nimbus) {
190189
throw new Error("Project isn't Nimbus enabled.");

packages/nimbus/src/bins/setup.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import chalk from 'chalk';
22
import execa from 'execa';
3-
// @ts-ignore Not typed
43
import editJsonFile from 'edit-json-file';
54
import { prompt } from 'enquirer';
65
import { Path } from '@beemo/core';
@@ -57,7 +56,7 @@ function addScriptsToPackage(response: SetupPrompt) {
5756
const pkg = editJsonFile(pkgPath);
5857
const client = response.yarn ? 'yarn' : 'npm';
5958
const monorepo = response.type === 'monolib';
60-
const scripts = pkg.get('scripts') || {};
59+
const scripts = pkg.get<NimbusPackage['scripts']>('scripts') ?? {};
6160

6261
scripts.prepare = 'nimbus create-config --silent';
6362

packages/nimbus/src/helpers/createGitHubClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Octokit from '@octokit/rest';
1+
import { Octokit } from '@octokit/rest';
22
import { VERSION } from '../constants';
33

44
export default function createGitHubClient(token?: string): Octokit {

packages/nimbus/src/scripts/AutoRelease.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ExecaReturnValue } from 'execa';
1+
import { ExecaReturnValue, ExecaError } from 'execa';
22
import { Script } from '@beemo/core';
33
import { LERNA_VERSION_ARGS } from '../constants';
44

@@ -90,7 +90,7 @@ export default class AutoReleaseScript extends Script {
9090

9191
return response;
9292
})
93-
.catch((error) => {
93+
.catch((error: ExecaError) => {
9494
this.tool.log.error(error.stderr);
9595

9696
throw error;

packages/nimbus/src/scripts/PullRequestChecks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from 'path';
22
import { Script } from '@beemo/core';
3-
import Octokit from '@octokit/rest';
3+
import { Octokit } from '@octokit/rest';
44
import { checkCommitFormat } from 'conventional-changelog-beemo';
55
import createGitHubClient from '../helpers/createGitHubClient';
66

types/edit-json-file.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
declare module 'edit-json-file' {
2+
class Editor {
3+
get<T = unknown>(key: string): T | undefined;
4+
save(): void;
5+
set<T = unknown>(key: string, value: T): void;
6+
unset(key: string): void;
7+
}
8+
9+
export default function editJsonFile(path: string): Editor;
10+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
declare module 'inline-manifest-webpack-plugin' {
2+
export default class InlineManifestWebpackPlugin {
3+
apply(): this;
4+
}
5+
}

0 commit comments

Comments
 (0)