Skip to content

Commit c85ed14

Browse files
ShadowCat567ShadowCat567aws-amplify-bot
authored
fix: upgrade most packages that use rimraf and glob (#14153)
* chore: updage packages * chore: adjust glob imports * chore: updated another glob import * chore: fix glob install * chore: adjust rimraf imports * chore: moved to dev * chore: updated yarn lock * chore: fixing test/lint issues * chore: updated e2e workflow files * fix: trying something * fix: update some imports, tried reverting change to generated files * fix: revert generated changed to e2e files * chore: rebuilt e2e tests * fix: downgrading rimraf * fix: adjusted some package versions * chore: fix yarn lock * chore: fixed yarn lock * fix: updated glob imports * fix: updated globOptions to try to fix e2e tests * fix: installed glob in amplify-e2e-core * fix: package upgrades * chore: update yarn lock * fix: move typescript-json-schema to prod deps * chore: update rimraf (again) * fix: adjust eslint package * chore: appeasing linter --------- Co-authored-by: ShadowCat567 <[email protected]> Co-authored-by: aws-amplify-bot <[email protected]>
1 parent ef7f5eb commit c85ed14

File tree

67 files changed

+2481
-2573
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2481
-2573
lines changed

codebuild_specs/e2e_workflow_generated.yml

Lines changed: 429 additions & 429 deletions
Large diffs are not rendered by default.

codebuild_specs/wait_for_ids.json

Lines changed: 193 additions & 193 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
"tagged-release-without-e2e-local": "bash -c 'source ./scripts/cloud-release.sh && TaggedRCLocal'",
5252
"tagged-release-without-e2e-beta": "bash -c 'source ./scripts/cloud-release.sh && TaggedRCBeta'",
5353
"tagged-release-without-e2e-prod": "bash -c 'source ./scripts/cloud-release.sh && TaggedRCProd'",
54-
"rm-aa-dev-link": "rimraf -f \".bin/amplify-app-dev\"",
55-
"rm-dev-link": "rimraf -f \".bin/amplify-dev\"",
54+
"rm-aa-dev-link": "rimraf \".bin/amplify-app-dev\"",
55+
"rm-dev-link": "rimraf \".bin/amplify-dev\"",
5656
"setup-dev-win": "yarn build && yarn link-win && yarn link-aa-win",
5757
"setup-dev": "yarn build && yarn rm-dev-link && yarn link-dev && yarn rm-aa-dev-link && yarn link-aa-dev",
5858
"smoketest": "lerna run smoketest",
@@ -89,7 +89,7 @@
8989
"license": "Apache-2.0",
9090
"dependencies": {
9191
"lerna": "^8.2.1",
92-
"node-gyp": "^9.3.1",
92+
"node-gyp": "^11.2.0",
9393
"strip-ansi": "^6.0.0",
9494
"yargs": "^17.7.2"
9595
},
@@ -99,14 +99,14 @@
9999
]
100100
},
101101
"devDependencies": {
102-
"@babel/cli": "^7.10.5",
102+
"@babel/cli": "^7.27.0",
103103
"@babel/core": "^7.23.2",
104104
"@babel/plugin-proposal-numeric-separator": "^7.10.4",
105105
"@babel/plugin-transform-modules-commonjs": "7.10.4",
106106
"@babel/plugin-transform-typescript": "7.10.5",
107-
"@commitlint/cli": "^17.6.1",
107+
"@commitlint/cli": "^19.8.0",
108108
"@commitlint/config-conventional": "^17.6.1",
109-
"@commitlint/config-lerna-scopes": "^17.6.3",
109+
"@commitlint/config-lerna-scopes": "^19.7.0",
110110
"@commitlint/cz-commitlint": "^17.5.0",
111111
"@commitlint/prompt": "^17.6.1",
112112
"@microsoft/api-extractor": "^7.34.6",
@@ -123,7 +123,7 @@
123123
"babel-loader": "^8.3.0",
124124
"codecov": "^3.7.0",
125125
"copyfiles": "^2.2.0",
126-
"eslint": "^7.19.0",
126+
"eslint": "^8.57.1",
127127
"eslint-config-airbnb": "^18.0.1",
128128
"eslint-config-prettier": "^8.5.0",
129129
"eslint-import-resolver-typescript": "^3.5.5",
@@ -136,20 +136,20 @@
136136
"eslint-plugin-react": "^7.29.4",
137137
"eslint-plugin-spellcheck": "^0.0.17",
138138
"execa": "^5.1.1",
139-
"glob": "^7.2.0",
139+
"glob": "^11.0.1",
140140
"husky": "^8.0.3",
141141
"istanbul-lib-coverage": "^3.2.0",
142142
"istanbul-lib-report": "^3.0.0",
143143
"istanbul-reports": "^3.1.5",
144-
"jest": "^29.0.0",
144+
"jest": "^29.7.0",
145145
"jest-circus": "^29.0.0",
146146
"jest-junit": "^12.0.0",
147147
"js-yaml": "^4.0.0",
148148
"lnk": "1.1.0",
149149
"lodash": "^4.17.21",
150-
"npm-check-updates": "^16.1.0",
150+
"npm-check-updates": "^17.1.16",
151151
"prettier": "^2.8.4",
152-
"rimraf": "^3.0.0",
152+
"rimraf": "^6.0.1",
153153
"ts-jest": "^29.0.0",
154154
"ts-node": "^10.4.0",
155155
"typescript": "^4.9.5"

packages/amplify-app/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@
3333
"chalk": "^4.1.1",
3434
"execa": "^5.1.1",
3535
"fs-extra": "^8.1.0",
36+
"glob": "^11.0.1",
3637
"ini": "^1.3.5",
3738
"inquirer": "^7.3.3",
3839
"node-emoji": "^1.10.0",
3940
"ora": "^4.0.3",
40-
"rimraf": "^3.0.0",
41+
"rimraf": "^6.0.1",
4142
"semver": "^7.5.4",
4243
"xcode": "^2.1.0",
4344
"yargs": "^15.1.0"

packages/amplify-app/src/xcodeHelpers.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const fs = require('fs-extra');
2-
const glob = require('glob');
2+
const { globSync } = require('glob');
33
const path = require('path');
44
const xcode = require('xcode');
55

@@ -118,7 +118,7 @@ function groupHasFile(group, name) {
118118
*/
119119
function getSchemaFile(rootDir) {
120120
const schemaFilePattern = path.join(rootDir, 'amplify', 'backend', 'api', '*', GRAPHQL_SCHEMA);
121-
const [schemaFile] = glob.sync(schemaFilePattern);
121+
const [schemaFile] = globSync(schemaFilePattern);
122122
return schemaFile;
123123
}
124124

@@ -137,7 +137,7 @@ function addAmplifyModels(rootDir, schemaFile, xcodeProject) {
137137

138138
// add generated model
139139
const modelsFilePattern = path.join(rootDir, 'amplify', 'generated', 'models', '*.swift');
140-
const modelFiles = glob.sync(modelsFilePattern).map((file) => {
140+
const modelFiles = globSync(modelsFilePattern).map((file) => {
141141
return path.relative(rootDir, file);
142142
});
143143
if (modelFiles && modelFiles.length > 0) {

packages/amplify-category-auth/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
"@aws-sdk/client-iam": "3.624.0",
5757
"@types/mime-types": "^2.1.1",
5858
"cloudform-types": "^4.2.0",
59-
"jest": "^29.5.0",
60-
"rimraf": "^3.0.2"
59+
"jest": "^29.7.0",
60+
"rimraf": "^6.0.1"
6161
},
6262
"jest": {
6363
"collectCoverage": true,

packages/amplify-category-custom/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
"aws-cdk-lib": "~2.189.1",
3232
"execa": "^5.1.1",
3333
"fs-extra": "^8.1.0",
34-
"glob": "^7.2.0",
34+
"glob": "^11.0.1",
3535
"ora": "^4.0.3",
3636
"uuid": "^8.3.2"
3737
},
3838
"devDependencies": {
3939
"@types/lodash": "^4.14.149",
40-
"jest": "^29.5.0",
41-
"rimraf": "^3.0.2"
40+
"jest": "^29.7.0",
41+
"rimraf": "^6.0.1"
4242
},
4343
"jest": {
4444
"testEnvironmentOptions": {

packages/amplify-category-custom/src/__tests__/utils/dependency-management-utils.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { $TSContext, CFNTemplateFormat, readCFNTemplate, pathManager, stateManager, writeCFNTemplate } from '@aws-amplify/amplify-cli-core';
2-
import { glob } from 'glob';
2+
import * as glob from 'glob';
33
import { prompter } from '@aws-amplify/amplify-prompts';
44
import * as fs from 'fs-extra';
55
import * as cdk from 'aws-cdk-lib';
@@ -37,7 +37,7 @@ describe('getResourceCfnOutputAttributes() scenarios', () => {
3737
templateFormat: CFNTemplateFormat.JSON,
3838
cfnTemplate: { Outputs: { mockKey: { Value: 'mockValue' } } },
3939
});
40-
glob_mock.sync.mockReturnValueOnce(['mockFileName']);
40+
glob_mock.globSync.mockReturnValueOnce(['mockFileName']);
4141

4242
expect(getResourceCfnOutputAttributes('mockCategory', 'mockResourceName')).toEqual(['mockKey']);
4343
});
@@ -50,7 +50,7 @@ describe('getResourceCfnOutputAttributes() scenarios', () => {
5050
cfnTemplate: { Outputs: { mockKey: { Value: 'mockValue' } } },
5151
});
5252

53-
glob_mock.sync.mockReturnValueOnce(['mockFileName1', 'mockFileName2']);
53+
glob_mock.globSync.mockReturnValueOnce(['mockFileName1', 'mockFileName2']);
5454

5555
expect(getResourceCfnOutputAttributes('mockCategory', 'mockResourceName')).toEqual([]);
5656
});
@@ -62,7 +62,7 @@ describe('getResourceCfnOutputAttributes() scenarios', () => {
6262
templateFormat: CFNTemplateFormat.JSON,
6363
cfnTemplate: { Outputs: { mockKey: { Value: 'mockValue' } } },
6464
});
65-
glob_mock.sync.mockReturnValueOnce(['mockFileName']);
65+
glob_mock.globSync.mockReturnValueOnce(['mockFileName']);
6666

6767
expect(getResourceCfnOutputAttributes('mockCategory', 'mockResourceName')).toEqual(['mockKey']);
6868
});
@@ -74,14 +74,14 @@ describe('getResourceCfnOutputAttributes() scenarios', () => {
7474
templateFormat: CFNTemplateFormat.JSON,
7575
cfnTemplate: { Outputs: { mockKey: { Value: 'mockValue' } } },
7676
});
77-
glob_mock.sync.mockReturnValueOnce(['mockFileName1', 'mockFileName2']);
77+
glob_mock.globSync.mockReturnValueOnce(['mockFileName1', 'mockFileName2']);
7878

7979
expect(getResourceCfnOutputAttributes('mockCategory', 'mockResourceName')).toEqual([]);
8080
});
8181

8282
it('get resource attr for resources without any cfn files', async () => {
8383
fs_mock.existsSync.mockReturnValue(false); // if build dir exists
84-
glob_mock.sync.mockReturnValueOnce([]);
84+
glob_mock.globSync.mockReturnValueOnce([]);
8585

8686
expect(getResourceCfnOutputAttributes('mockCategory', 'mockResourceName')).toEqual([]);
8787
});
@@ -100,7 +100,7 @@ describe('getAllResources() scenarios', () => {
100100
cfnTemplate: { Outputs: { mockKey: { Value: 'mockValue' } } },
101101
});
102102

103-
glob_mock.sync.mockReturnValue(['mockFileName']);
103+
glob_mock.globSync.mockReturnValue(['mockFileName']);
104104

105105
stateManager.getMeta = jest.fn().mockReturnValue({
106106
mockCategory1: {
@@ -131,7 +131,7 @@ describe('addCDKResourceDependency() scenarios', () => {
131131
cfnTemplate: { Outputs: { mockKey: { Value: 'mockValue' } } },
132132
});
133133

134-
glob_mock.sync.mockReturnValue(['mockFileName']);
134+
glob_mock.globSync.mockReturnValue(['mockFileName']);
135135

136136
const mockBackendConfig = {
137137
mockCategory1: {
@@ -263,7 +263,7 @@ describe('addCFNResourceDependency() scenarios', () => {
263263
cfnTemplate: { Outputs: { mockKey: { Value: 'mockValue' } } },
264264
});
265265

266-
glob_mock.sync.mockReturnValue(['mockFileName']);
266+
glob_mock.globSync.mockReturnValue(['mockFileName']);
267267

268268
const mockBackendConfig = {
269269
mockCategory1: {

packages/amplify-category-custom/src/utils/dependency-management-utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as cdk from 'aws-cdk-lib';
22
import { $TSContext, $TSObject, pathManager, readCFNTemplate, stateManager, writeCFNTemplate } from '@aws-amplify/amplify-cli-core';
33
import { byValues, printer, prompter } from '@aws-amplify/amplify-prompts';
44
import * as fs from 'fs-extra';
5-
import { glob } from 'glob';
5+
import { globSync } from 'glob';
66
import _ from 'lodash';
77
import * as path from 'path';
88
import { categoryName, customResourceCFNFilenameSuffix } from '../utils/constants';
@@ -26,7 +26,7 @@ export function getResourceCfnOutputAttributes(category: string, resourceName: s
2626
* Otherwise falls back to the default behavior.
2727
*/
2828
if (fs.existsSync(resourceBuildDir)) {
29-
const cfnFiles = glob.sync(cfnTemplateGlobPattern, {
29+
const cfnFiles = globSync(cfnTemplateGlobPattern, {
3030
cwd: resourceBuildDir,
3131
ignore: [AUTH_TRIGGER_TEMPLATE],
3232
});
@@ -45,7 +45,7 @@ export function getResourceCfnOutputAttributes(category: string, resourceName: s
4545
}
4646
if (!cfnFilePath) {
4747
// For categories which do not store cfn files in build/ dir
48-
const cfnFiles = glob.sync(cfnTemplateGlobPattern, {
48+
const cfnFiles = globSync(cfnTemplateGlobPattern, {
4949
cwd: resourceDir,
5050
ignore: [AUTH_TRIGGER_TEMPLATE],
5151
});

packages/amplify-category-function/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@aws-amplify/amplify-environment-parameters": "1.9.19",
3131
"@aws-amplify/amplify-function-plugin-interface": "1.12.1",
3232
"@aws-amplify/amplify-prompts": "2.8.6",
33-
"archiver": "^5.3.0",
33+
"archiver": "^7.0.1",
3434
"aws-sdk": "^2.1464.0",
3535
"chalk": "^4.1.1",
3636
"cloudform-types": "^4.2.0",
@@ -48,7 +48,7 @@
4848
},
4949
"devDependencies": {
5050
"@types/folder-hash": "^4.0.1",
51-
"jest": "^29.5.0"
51+
"jest": "^29.7.0"
5252
},
5353
"jest": {
5454
"collectCoverage": true,

packages/amplify-category-storage/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
"devDependencies": {
4848
"cloudform-types": "^4.2.0",
49-
"rimraf": "^3.0.2"
49+
"rimraf": "^6.0.1"
5050
},
5151
"jest": {
5252
"testEnvironmentOptions": {

packages/amplify-cli-core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@
7272
"@types/rimraf": "^3.0.0",
7373
"@types/uuid": "^8.0.0",
7474
"@types/yarnpkg__lockfile": "^1.1.5",
75-
"jest": "^29.5.0",
75+
"jest": "^29.7.0",
7676
"nock": "^13.5.0",
77-
"rimraf": "^3.0.0",
77+
"rimraf": "^6.0.1",
7878
"strip-ansi": "^6.0.0",
7979
"uuid": "^8.3.2"
8080
},

packages/amplify-cli-core/src/__tests__/featureFlags.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import * as fs from 'fs-extra';
33
import * as os from 'os';
44
import * as path from 'path';
5-
import * as rimraf from 'rimraf';
5+
import { rimrafSync } from 'rimraf';
66
import { v4 as uuid } from 'uuid';
77
import {
88
EnvVarFormatError,
@@ -58,7 +58,7 @@ describe('feature flags', () => {
5858
expect(updatedConfig.usageTracking).toBeDefined();
5959
expect(updatedConfig.features).toMatchObject(FeatureFlags.getNewProjectDefaults());
6060
} finally {
61-
rimraf.sync(tempProjectDir);
61+
rimrafSync(tempProjectDir);
6262
}
6363
});
6464

@@ -87,7 +87,7 @@ describe('feature flags', () => {
8787

8888
expect(updatedConfig).toEqual(originalConfig);
8989
} finally {
90-
rimraf.sync(tempProjectDir);
90+
rimrafSync(tempProjectDir);
9191
}
9292
});
9393

@@ -111,7 +111,7 @@ describe('feature flags', () => {
111111

112112
expect(createdConfig).not.toBe('');
113113
} finally {
114-
rimraf.sync(tempProjectDir);
114+
rimrafSync(tempProjectDir);
115115
}
116116
});
117117

@@ -136,7 +136,7 @@ describe('feature flags', () => {
136136

137137
expect(FeatureFlags.getBoolean('graphQLTransformer.validateTypeNameReservedWords')).toBe(false);
138138
} finally {
139-
rimraf.sync(tempProjectDir);
139+
rimrafSync(tempProjectDir);
140140
}
141141
});
142142

@@ -185,7 +185,7 @@ describe('feature flags', () => {
185185
expect(customTransformerVersion).toBe(5);
186186
expect(isDefaultQueryEnabled).toBe(true);
187187
} finally {
188-
rimraf.sync(tempProjectDir);
188+
rimrafSync(tempProjectDir);
189189
}
190190
});
191191

packages/amplify-cli-core/src/__tests__/jsonUtilities.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as fs from 'fs-extra';
22
import * as os from 'os';
33
import * as path from 'path';
4-
import * as rimraf from 'rimraf';
4+
import { rimrafSync } from 'rimraf';
55
import { v4 as uuid } from 'uuid';
66
import { JSONUtilities } from '../jsonUtilities';
77

@@ -79,7 +79,7 @@ describe('JSONUtilities tests', () => {
7979
bar: 1,
8080
});
8181
} finally {
82-
rimraf.sync(topTempDir);
82+
rimrafSync(topTempDir);
8383
}
8484
});
8585

packages/amplify-cli-npm/binary.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { createGunzip } from 'zlib';
77
import stream from 'stream';
88
import os from 'os';
99
import axios from 'axios';
10-
import rimraf from 'rimraf';
10+
import { rimrafSync } from 'rimraf';
1111
import { name, version } from './package.json';
1212

1313
const BINARY_LOCATION = 'https://package.cli.amplify.aws';
@@ -102,7 +102,7 @@ export class Binary {
102102
*/
103103
async install(): Promise<void> {
104104
if (fs.existsSync(this.installDirectory)) {
105-
rimraf.sync(this.installDirectory);
105+
rimrafSync(this.installDirectory);
106106
}
107107

108108
fs.mkdirSync(this.installDirectory, { recursive: true });

packages/amplify-cli-npm/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
},
3333
"dependencies": {
3434
"axios": "^1.6.7",
35-
"rimraf": "^3.0.2",
35+
"rimraf": "^6.0.1",
3636
"tar-stream": "^2.2.0"
3737
},
3838
"devDependencies": {
3939
"@aws-amplify/cli-internal": "13.0.1",
4040
"@types/tar": "^6.1.1",
41-
"rimraf": "^3.0.2"
41+
"rimraf": "^6.0.1"
4242
},
4343
"berry": {
4444
"plugins": [

packages/amplify-cli-shared-interfaces/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"homepage": "https://github.com/aws-amplify/amplify-cli#readme",
3131
"devDependencies": {
32-
"rimraf": "^3.0.2"
32+
"rimraf": "^6.0.1"
3333
},
3434
"berry": {
3535
"plugins": [

0 commit comments

Comments
 (0)