Skip to content

Commit

Permalink
[Other packages] Upgrade 3rd party dependencies (#1321)
Browse files Browse the repository at this point in the history
* upgrade create-sitecore-jss

* upgraded sitecore-jss-cli

* upgrade sitecore-jss-forms

* upgrade sitecore-jss-proxy

* upgrade sitecore-jss-rendering-host

* upgrade sitecore-jss-dev-tools

* upgrade webpack for rendering-host

* fix failing tests

* review comments: refactor types

* refactored webpack config file  type

* fixed linting error

* removed obsolete code
  • Loading branch information
addy-pathania authored Feb 7, 2023
1 parent 04517c0 commit 041a6c5
Show file tree
Hide file tree
Showing 23 changed files with 866 additions and 2,262 deletions.
50 changes: 25 additions & 25 deletions packages/create-sitecore-jss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,37 @@
],
"dependencies": {
"chalk": "^4.1.2",
"cross-spawn": "^7.0.0",
"diff": "^5.0.0",
"dotenv": "^16.0.0",
"cross-spawn": "^7.0.3",
"diff": "^5.1.0",
"dotenv": "^16.0.3",
"ejs": "^3.1.8",
"fs-extra": "^10.0.0",
"glob": "^7.2.0",
"inquirer": "^8.2.0",
"minimist": "^1.2.6"
"fs-extra": "^11.1.0",
"glob": "^8.1.0",
"inquirer": "^8.2.4",
"minimist": "^1.2.7"
},
"devDependencies": {
"@types/chai": "^4.2.22",
"@types/cross-spawn": "^6.0.0",
"@types/diff": "^5.0.1",
"@types/ejs": "^3.1.0",
"@types/fs-extra": "^9.0.13",
"@types/glob": "^7.2.0",
"@types/inquirer": "^8.1.3",
"@types/chai": "^4.3.4",
"@types/cross-spawn": "^6.0.2",
"@types/diff": "^5.0.2",
"@types/ejs": "^3.1.1",
"@types/fs-extra": "^11.0.1",
"@types/glob": "^8.0.1",
"@types/inquirer": "^9.0.3",
"@types/minimist": "^1.2.2",
"@types/mocha": "^9.0.0",
"@types/node": "^16.11.7",
"@types/sinon": "^10.0.6",
"@types/sinon-chai": "^3.2.8",
"chai": "^4.3.4",
"chokidar": "^3.5.2",
"@types/mocha": "^10.0.1",
"@types/node": "^18.11.18",
"@types/sinon": "10.0.6",
"@types/sinon-chai": "^3.2.9",
"chai": "^4.3.7",
"chokidar": "^3.5.3",
"del-cli": "^5.0.0",
"eslint": "^7.15.0",
"mocha": "^9.1.3",
"eslint": "^8.32.0",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"sinon": "^12.0.1",
"sinon": "^15.0.1",
"sinon-chai": "^3.7.0",
"ts-node": "^10.4.0",
"typescript": "~4.3.5"
"ts-node": "^10.9.1",
"typescript": "~4.9.5"
}
}
2 changes: 1 addition & 1 deletion packages/create-sitecore-jss/scripts/build-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const templatesFolder = path.resolve(__dirname, '../src/templates');
const distFolder = path.resolve(__dirname, '../dist/templates');

// Copy templates to dist
fs.copy(templatesFolder, distFolder, (err: Error) => {
fs.copy(templatesFolder, distFolder, (err) => {
if (err) {
console.log('An error occurred while copying the folder.');
throw err;
Expand Down
8 changes: 4 additions & 4 deletions packages/create-sitecore-jss/src/bin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs';
import path, { sep } from 'path';
import chalk from 'chalk';
import { prompt } from 'inquirer';
import inquirer from 'inquirer';
import { initRunner } from './init-runner';
import minimist, { ParsedArgs } from 'minimist';
import { getAllTemplates, getBaseTemplates } from './common';
Expand Down Expand Up @@ -53,7 +53,7 @@ export const main = async (args: ParsedArgs) => {
}
if (!templates.length) {
const baseTemplates = await getBaseTemplates(templatePath);
const answer = await prompt({
const answer = await inquirer.prompt({
type: 'list',
name: 'template',
message: 'Which template would you like to create?',
Expand All @@ -74,7 +74,7 @@ export const main = async (args: ParsedArgs) => {
if (args.yes) {
destination = defaultDestination;
} else {
const answer = await prompt({
const answer = await inquirer.prompt({
type: 'input',
name: 'destination',
message: 'Where would you like your new app created?',
Expand All @@ -86,7 +86,7 @@ export const main = async (args: ParsedArgs) => {
}

if (!args.force && fs.existsSync(destination) && fs.readdirSync(destination).length > 0) {
const answer = await prompt({
const answer = await inquirer.prompt({
type: 'confirm',
name: 'continue',
message: `Directory '${destination}' not empty. Are you sure you want to continue?`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import glob from 'glob';
import path, { sep } from 'path';
import { parse } from 'dotenv';
import { Data, renderFile } from 'ejs';
import { prompt } from 'inquirer';
import inquirer from 'inquirer';
import {
getPascalCaseName,
getAppPrefix,
Expand Down Expand Up @@ -111,7 +111,7 @@ export const diffFiles = async (

console.log(`Showing potential changes in ${chalk.yellow(targetFilePath.replace('/', '\\'))}`);

const answer = await prompt({
const answer = await inquirer.prompt({
type: 'list',
name: 'choice',
choices: ['yes', 'skip', 'yes to all', 'abort'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';
import chalk from 'chalk';
import { prompt } from 'inquirer';
import inquirer from 'inquirer';
import { AngularArgs } from './args';
import { AngularAnswer, prompts } from './prompts';
import { Initializer, transform } from '../../common';
Expand All @@ -11,7 +11,7 @@ export default class AngularInitializer implements Initializer {
}

async init(args: AngularArgs) {
const answers = await prompt<AngularAnswer>(prompts, args);
const answers = await inquirer.prompt<AngularAnswer>(prompts, args);

const mergedArgs = {
...args,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import chalk from 'chalk';
import path, { sep } from 'path';
import { prompt } from 'inquirer';
import inquirer from 'inquirer';
import {
Initializer,
openPackageJson,
Expand All @@ -22,7 +22,7 @@ export default class NextjsStyleguideInitializer implements Initializer {
async init(args: NextjsStyleguideArgs) {
const pkg = openPackageJson(`${args.destination}${sep}package.json`);

const answers = await prompt<StyleguideAnswer>(styleguidePrompts, args);
const answers = await inquirer.prompt<StyleguideAnswer>(styleguidePrompts, args);

const mergedArgs = {
...args,
Expand Down
6 changes: 3 additions & 3 deletions packages/create-sitecore-jss/src/initializers/nextjs/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import chalk from 'chalk';
import path, { sep } from 'path';
import inquirer, { prompt } from 'inquirer';
import inquirer from 'inquirer';
import { prompts, NextjsAnswer, NextjsCheckbox } from './prompts';
import {
Initializer,
Expand All @@ -20,7 +20,7 @@ export default class NextjsInitializer implements Initializer {
}

async init(args: NextjsArgs) {
const answers = await prompt<NextjsAnswer>(prompts, args);
const answers = await inquirer.prompt<NextjsAnswer>(prompts, args);

const pkgPath = path.resolve(`${answers.destination}${sep}package.json`);
const templatePath = path.resolve(__dirname, '../../templates/nextjs');
Expand All @@ -36,7 +36,7 @@ export default class NextjsInitializer implements Initializer {
// don't prompt for add-on initializers if --yes or they've already specified
// multiple via --templates (assume they know what they're doing)
if (!args.yes && args.templates.length === 1) {
const addInitAnswer = await prompt({
const addInitAnswer = await inquirer.prompt({
type: 'nextjs-checkbox' as 'checkbox',
name: 'addInitializers',
message: 'Would you like to include any add-on initializers?',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';
import { prompt } from 'inquirer';
import inquirer from 'inquirer';
import { prompts, ReactNativeAnswer } from './prompts';
import { Initializer, transform } from '../../common';
import { ReactNativeArgs } from './args';
Expand All @@ -10,7 +10,7 @@ export default class ReactNativeInitializer implements Initializer {
}

async init(args: ReactNativeArgs) {
const answers = await prompt<ReactNativeAnswer>(prompts, args);
const answers = await inquirer.prompt<ReactNativeAnswer>(prompts, args);

const mergedArgs = {
...args,
Expand Down
4 changes: 2 additions & 2 deletions packages/create-sitecore-jss/src/initializers/react/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import chalk from 'chalk';
import path, { sep } from 'path';
import { prompt } from 'inquirer';
import inquirer from 'inquirer';
import {
Initializer,
isDevEnvironment,
Expand All @@ -18,7 +18,7 @@ export default class ReactInitializer implements Initializer {
}

async init(args: ReactArgs) {
const answers = await prompt<ReactAnswer>(prompts, args);
const answers = await inquirer.prompt<ReactAnswer>(prompts, args);

const mergedArgs = {
...args,
Expand Down
4 changes: 2 additions & 2 deletions packages/create-sitecore-jss/src/initializers/vue/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';
import { prompt } from 'inquirer';
import inquirer from 'inquirer';
import { prompts, VueAnswer } from './prompts';
import { Initializer, transform } from '../../common';
import { VueArgs } from './args';
Expand All @@ -11,7 +11,7 @@ export default class VueInitializer implements Initializer {
}

async init(args: VueArgs) {
const answers = await prompt<VueAnswer>(prompts, args);
const answers = await inquirer.prompt<VueAnswer>(prompts, args);

const mergedArgs = {
...args,
Expand Down
42 changes: 21 additions & 21 deletions packages/sitecore-jss-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,34 +34,34 @@
},
"dependencies": {
"@sitecore-jss/sitecore-jss-dev-tools": "^21.1.0-canary.93",
"chalk": "^2.4.2",
"cross-spawn": "^7.0.0",
"dotenv": "^16.0.1",
"dotenv-expand": "^8.0.3",
"chalk": "^4.1.2",
"cross-spawn": "^7.0.3",
"dotenv": "^16.0.3",
"dotenv-expand": "^10.0.0",
"readline-sync": "^1.4.10",
"resolve": "^1.22.1",
"tmp": "^0.2.1",
"yargs": "^17.5.1"
"yargs": "^17.6.2"
},
"devDependencies": {
"@types/chai": "^4.2.3",
"@types/cross-spawn": "^6.0.0",
"@types/mocha": "^9.0.0",
"@types/node": "^12.7.11",
"@types/readline-sync": "^1.4.3",
"@types/resolve": "^0.0.8",
"@types/sinon": "^7.5.0",
"@types/tmp": "^0.1.0",
"@types/yargs": "^17.0.7",
"chai": "^4.2.0",
"cross-env": "^6.0.3",
"@types/chai": "^4.2.4",
"@types/cross-spawn": "^6.0.2",
"@types/mocha": "^10.0.1",
"@types/node": "^18.11.18",
"@types/readline-sync": "^1.4.4",
"@types/resolve": "^1.20.2",
"@types/sinon": "^10.0.13",
"@types/tmp": "^0.2.3",
"@types/yargs": "^17.0.20",
"chai": "^4.3.7",
"cross-env": "^7.0.3",
"del-cli": "^5.0.0",
"eslint": "^7.15.0",
"mocha": "^9.1.3",
"eslint": "^8.32.0",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"sinon": "^7.5.0",
"ts-node": "^8.4.1",
"typescript": "~4.3.5"
"sinon": "^15.0.1",
"ts-node": "^10.9.1",
"typescript": "~4.9.4"
},
"gitHead": "2f4820efddf4454eeee58ed1b2cc251969efdf5b",
"files": [
Expand Down
1 change: 1 addition & 0 deletions packages/sitecore-jss-cli/src/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ describe('cli', () => {
third: 'do --all',
},
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { jss: _, ...expectedScripts } = packageJson.scripts;

sinon.stub(resolvePkg, 'default').resolves(packageJson);
Expand Down
2 changes: 1 addition & 1 deletion packages/sitecore-jss-cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export async function getPackageScriptCommands() {
}

/**
* @param script
* @param {string} script script name
*/
export function makeCommand(script: string) {
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/sitecore-jss-cli/src/run-package-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function runPackageManagerCommand(
}

/**
* @param args
* @param {string[]} args to transform
*/
export function transformPackageArgs(args: string[]) {
return ['run', ...args.slice(0, 1), '--', ...args.slice(1)];
Expand Down
Loading

0 comments on commit 041a6c5

Please sign in to comment.