Skip to content

Commit

Permalink
feat(node): upgraded to node v16 and all corresponding packages
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Running on v14 will most likely crash. Without v16 all Oyster commands will
probably break

fix #57
  • Loading branch information
ashblue committed Sep 19, 2022
1 parent 2dd1051 commit 68395a8
Show file tree
Hide file tree
Showing 16 changed files with 2,530 additions and 2,685 deletions.
6 changes: 3 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install commitlint --edit
npx --no -- commitlint --edit
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.17.0
16.17.0
5,121 changes: 2,474 additions & 2,647 deletions package-lock.json

Large diffs are not rendered by default.

23 changes: 11 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"author": "Ash Blue",
"license": "MIT",
"devDependencies": {
"@commitlint/cli": "^12.1.1",
"@commitlint/config-conventional": "^12.0.1",
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/commit-analyzer": "^8.0.1",
"@semantic-release/git": "^9.0.0",
Expand All @@ -38,24 +38,23 @@
"@types/jest": "^29.0.3",
"@types/node": "^14.14.36",
"@types/shelljs": "^0.8.8",
"@typescript-eslint/eslint-plugin": "^4.19.0",
"@typescript-eslint/parser": "^4.19.0",
"commitizen": "^4.2.3",
"@typescript-eslint/eslint-plugin": "^5.37.0",
"@typescript-eslint/parser": "^5.37.0",
"commitizen": "^4.2.5",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^7.23.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-jsdoc": "^32.3.0",
"eslint": "^8.23.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^27.0.4",
"eslint-plugin-jsdoc": "^39.3.6",
"eslint-plugin-node": "^11.1.0",
"husky": "^5.2.0",
"husky": "^8.0.1",
"jest": "^29.0.3",
"nodemon": "^2.0.7",
"prettier": "~2.3.0",
"pretty-quick": "^3.1.0",
"semantic-release": "^17.4.2",
"ts-jest": "^29.0.1",
"tslint": "^6.1.3",
"typescript": "^4.2.3"
"typescript": "^4.8.3"
},
"dependencies": {
"chalk": "^4.1.0",
Expand Down
1 change: 1 addition & 0 deletions src/commands/install/command-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default class CommandInstall {

private runPackageBuilder() {
const terminal = new InstallQuestions(inquirer);
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
const gitDetector = new GitDetector(gitRemoteOriginUrl);
const configManager = new ConfigManager();
const packageBuilder = new PackageBuilder(
Expand Down
5 changes: 5 additions & 0 deletions src/commands/install/git-detector/git-detector.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ describe('GitDetector', () => {
.fn()
.mockImplementation(() => Promise.resolve());

// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
const gitDetector = new GitDetector(gitRemoteOriginUrl as any);
const result = await gitDetector.checkIfGitRepo();

Expand All @@ -18,6 +19,7 @@ describe('GitDetector', () => {
.fn()
.mockImplementation(() => Promise.reject());

// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
const gitDetector = new GitDetector(gitRemoteOriginUrl as any);
const result = await gitDetector.checkIfGitRepo();

Expand All @@ -29,6 +31,7 @@ describe('GitDetector', () => {
.fn()
.mockImplementation(() => Promise.reject('a'));

// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
const gitDetector = new GitDetector(gitRemoteOriginUrl as any);
const result = await gitDetector.checkIfGitRepo();

Expand All @@ -46,6 +49,7 @@ describe('GitDetector', () => {
.fn()
.mockImplementation(() => Promise.resolve(remote));

// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
const gitDetector = new GitDetector(gitRemoteOriginUrl as any);
const details = await gitDetector.getDetails();

Expand All @@ -61,6 +65,7 @@ describe('GitDetector', () => {
.fn()
.mockImplementation(() => Promise.resolve(remote));

// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
const gitDetector = new GitDetector(gitRemoteOriginUrl as any);
const details = await gitDetector.getDetails();

Expand Down
16 changes: 8 additions & 8 deletions src/commands/install/install-questions/install-questions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('InstallQuestions class', () => {
await terminal.askName();

const match = findQuestionMatch(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
_inquirerStub.prompt.mock.calls[0][0],
'name',
'input',
Expand All @@ -86,7 +86,7 @@ describe('InstallQuestions class', () => {

it('should ask for the display name', () => {
const match = findQuestionMatch(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
_inquirerStub.prompt.mock.calls[0][0],
'displayName',
'input',
Expand All @@ -97,7 +97,7 @@ describe('InstallQuestions class', () => {

it('should ask for the description', () => {
const match = findQuestionMatch(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
_inquirerStub.prompt.mock.calls[0][0],
'description',
'input',
Expand All @@ -108,7 +108,7 @@ describe('InstallQuestions class', () => {

it('should ask for the unity version', () => {
const match = findQuestionMatch(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
_inquirerStub.prompt.mock.calls[0][0],
'unityVersion',
'input',
Expand All @@ -119,7 +119,7 @@ describe('InstallQuestions class', () => {

it('should ask for the author name', () => {
const match = findQuestionMatch(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
_inquirerStub.prompt.mock.calls[0][0],
'authorName',
'input',
Expand All @@ -130,7 +130,7 @@ describe('InstallQuestions class', () => {

it('should ask for the author email', () => {
const match = findQuestionMatch(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
_inquirerStub.prompt.mock.calls[0][0],
'authorEmail',
'input',
Expand All @@ -141,7 +141,7 @@ describe('InstallQuestions class', () => {

it('should ask for the author url', () => {
const match = findQuestionMatch(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
_inquirerStub.prompt.mock.calls[0][0],
'authorUrl',
'input',
Expand All @@ -152,7 +152,7 @@ describe('InstallQuestions class', () => {

it('should ask for keywords', () => {
const match = findQuestionMatch(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
_inquirerStub.prompt.mock.calls[0][0],
'keywords',
'input',
Expand Down
3 changes: 3 additions & 0 deletions src/commands/install/install-questions/install-questions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default class InstallQuestions {
this.questionKeywords(),
]);

// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
answers.keywords = this.keywordsToJsonStringArray(answers.keywords);

return answers as IQuestionsToAnswers;
Expand All @@ -65,6 +66,7 @@ export default class InstallQuestions {
message: `Package name? Internal ID that's permanent. Example ${packageNameFormat} or ${packageNameExample}`,
name: 'name',
type: 'input',
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
validate: (value) => InstallQuestions.requiredString(value),
};
}
Expand All @@ -78,6 +80,7 @@ export default class InstallQuestions {
message: `Package display name? Should be user-friendly. Example ${example} or ${exampleAlt}`,
name: 'displayName',
type: 'input',
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
validate: (value) => InstallQuestions.requiredString(value),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ describe('PackageBuilder class', () => {
packageBuilder: new PackageBuilder(
copyFolder,
findPreExistingFiles,
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
installQuestions,
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
gitDetector,
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
config as any,
),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ describe('PackageBuilder class', () => {
_packageBuilder = new PackageBuilder(
_copyFolder,
_findPreExistingFiles,
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
_terminal,
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
_gitDetector,
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
{ generate: jest.fn() } as any,
);
});
Expand All @@ -88,7 +91,7 @@ describe('PackageBuilder class', () => {

it('should add a replace variable to copyFolder for packageScope', () => {
const match = findVariableMatch(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
_copyFolder.mock.calls[0][2].replaceVariables,
'packageScope',
'com.a',
Expand All @@ -99,7 +102,7 @@ describe('PackageBuilder class', () => {

it('should add a replace variable to copyFolder for .gitignore', () => {
const match = findVariableMatch(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
_copyFolder.mock.calls[0][2].replaceVariables,
'gitignore',
'.gitignore',
Expand All @@ -110,7 +113,7 @@ describe('PackageBuilder class', () => {

it('should add a replace variable to copyFolder for year', () => {
const match = findVariableMatch(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
_copyFolder.mock.calls[0][2].replaceVariables,
'year',
new Date().getFullYear().toString(),
Expand Down Expand Up @@ -146,7 +149,7 @@ describe('PackageBuilder class', () => {
await _packageBuilder.build(SOURCE, DESTINATION);

const matchA = findVariableMatch(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
_copyFolder.mock.calls[0][2].replaceVariables,
'packageName',
name,
Expand All @@ -155,7 +158,7 @@ describe('PackageBuilder class', () => {
expect(matchA).not.toBeUndefined();

const matchB = findVariableMatch(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
_copyFolder.mock.calls[0][2].replaceVariables,
replaceVariables[0].key,
replaceVariables[0].value,
Expand Down Expand Up @@ -188,7 +191,7 @@ describe('PackageBuilder class', () => {

replacements.forEach((replace) => {
const match = findVariableMatch(
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
_copyFolder.mock.calls[0][2].replaceVariables,
replace.key,
replace.value,
Expand Down
2 changes: 2 additions & 0 deletions src/commands/shared/config/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ describe('Config class', () => {
...options,
};

// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
jest.spyOn(path, 'resolve').mockReturnValue(packageJsonPath as any);
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
jest.spyOn(fs, 'readFileSync').mockReturnValue(packageJsonContents as any);

return {
Expand Down
1 change: 1 addition & 0 deletions src/commands/shared/copy-folder/copy-folder__mocks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('copyFolder helpers', () => {
};

jest.spyOn(glob, 'sync').mockReturnValue([]);
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
jest.spyOn(fs, 'statSync').mockReturnValue({
isFile: () => isFile,
isDirectory: () => !isFile,
Expand Down
1 change: 1 addition & 0 deletions src/commands/upgrade/command-upgrade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ describe('CommandUpgrade class', () => {
generate: jest.fn(),
};

// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
spySimpleGit.mockReturnValue({
status: () => Promise.resolve({ isClean: () => !gitModifiedStatus }),
} as any);
Expand Down
6 changes: 3 additions & 3 deletions src/templates/.husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install commitlint --edit
npx --no -- commitlint --edit
2 changes: 1 addition & 1 deletion src/templates/.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.16.0
16.17.0
8 changes: 4 additions & 4 deletions src/templates/{packageJson}
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@
},
"homepage": "{gitUrl}#readme",
"devDependencies": {
"@commitlint/cli": "~12.0.1",
"@commitlint/config-conventional": "~12.0.1",
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@semantic-release/changelog": "~5.0.1",
"@semantic-release/commit-analyzer": "~8.0.1",
"@semantic-release/exec": "~5.0.0",
"@semantic-release/git": "~9.0.0",
"@semantic-release/github": "~7.2.0",
"@semantic-release/npm": "~7.0.10",
"@semantic-release/release-notes-generator": "~9.0.2",
"commitizen": "~4.2.3",
"commitizen": "^4.2.5",
"cz-conventional-changelog": "~3.3.0",
"husky": "~5.1.3",
"husky": "^8.0.1",
"semantic-release": "~17.4.2",
"upm-package-populator": "^2.0.0"
},
Expand Down

0 comments on commit 68395a8

Please sign in to comment.