Skip to content

Commit

Permalink
Fix package critical vulnerabilities (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrambeau authored May 22, 2023
1 parent 9d3a955 commit 0a2f983
Show file tree
Hide file tree
Showing 7 changed files with 1,157 additions and 4,029 deletions.
5 changes: 5 additions & 0 deletions packages/uxpin-merge-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Changelog
## [3.0.3] - 2023-05-22

### Changed

- Upgrade dependencies to fix "critical" vulnerabilities ([#376](https://github.com/UXPin/uxpin-merge-tools/pull/376))

## [3.0.2] - 2023-05-15

Expand Down
23 changes: 12 additions & 11 deletions packages/uxpin-merge-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uxpin/merge-cli",
"version": "3.0.2",
"version": "3.0.3",
"description": "The Command-line tool integrates the Design System repository with: https://www.uxpin.com/merge",
"repository": {
"type": "git",
Expand Down Expand Up @@ -51,7 +51,6 @@
"@types/commander": "^2.12.2",
"@types/formidable": "^1.0.31",
"@types/fs-extra": "^5.0.4",
"@types/globby": "^6.1.0",
"@types/jest": "29.5.1",
"@types/locate-path": "^2.0.0",
"@types/lodash": "^4.14.74",
Expand All @@ -74,17 +73,15 @@
"dts-bundle-generator": "^8.0.1",
"eslint": "^8.23.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-prettier": "^4.2.1",
"jest": "29.5.0",
"jest-junit": "^10.0.0",
"nyc": "^11.2.1",
"nyc": "^15.1.0",
"prettier": "^2.7.1",
"react": "^17.0.1",
"react-docgen-typescript": "^1.0.2",
"react-dom": "^17.0.1",
"remap-istanbul": "^0.9.5",
"stubby": "^4.0.0",
"stubby": "^5.1.0",
"terminate": "^2.1.2",
"tmp-promise": "^1.0.5",
"ts-jest": "29.1.0",
Expand All @@ -93,15 +90,18 @@
"webpack-cli": "^5.0.1"
},
"dependencies": {
"@babel/core": "^7.2.2",
"@babel/core": "^7.21.8",
"@babel/plugin-proposal-class-properties": "^7.2.3",
"@babel/preset-env": "^7.13.5",
"@babel/preset-env": "^7.21.5",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@colors/colors": "^1.5.0",
"@textlint/ast-node-types": "^13.3.2",
"@textlint/markdown-to-ast": "^13.3.2",
"@types/yargs": "^16.0.0",
"@uxpin/react-docgen-better-proptypes": "^0.1.1",
"acorn-loose": "^8.0.2",
"ast-types": "^0.12.4",
"axios": "^1.4.0",
"babel-loader": "^8.0.5",
"babel-standalone": "^6.26.0",
Expand All @@ -112,12 +112,11 @@
"form-data": "^4.0.0",
"formidable": "^1.2.1",
"fs-extra": "^7.0.0",
"globby": "^8.0.1",
"globby": "^11.1.0",
"http-status-codes": "^1.3.0",
"ignore-loader": "^0.1.2",
"locate-path": "^2.0.0",
"lodash": "^4.17.4",
"markdown-to-ast": "^4.0.0",
"ngrok": "4.3.3",
"open": "^7.3.0",
"p-any": "^1.1.0",
Expand All @@ -140,6 +139,8 @@
"webpack-cli": "^4.0.0 || ^5.0.0"
},
"resolutions": {
"@types/tapable": "1.0.0"
"@types/tapable": "1.0.0",
"minimist": "1.2.8",
"chrome-launcher": "0.13.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,17 @@ describe('getExamples', () => {
<Line />
<Line />
<Line />
</DocumentationWithMultilineExamples>`,
</DocumentationWithMultilineExamples>
`,
},
{
code: `// See first example
<DocumentationWithMultilineExamples>
<Line />
<Line />
<Line />
</DocumentationWithMultilineExamples>`,
</DocumentationWithMultilineExamples>
`,
},
];
const expectedResult: ExamplesSerializationResult = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { readFile } from 'fs-extra';
import { parse, Syntax, Token } from 'markdown-to-ast';
import { parse, Syntax } from '@textlint/markdown-to-ast';
import { WarningDetails } from '../../../../common/warning/WarningDetails';
import { ExamplesSerializationResult } from './ExamplesSerializationResult';
import { TxtNode } from '@textlint/ast-node-types';

interface TokenWithValue extends Token {
interface TokenWithValue extends TxtNode {
value: string;
}

Expand All @@ -12,13 +13,13 @@ export function serializeExamples(filePath: string): Promise<ExamplesSerializati
.then((content) =>
parse(content)
.children.filter(isSupportedLangTokenWithValue)
.map((codeBlock: TokenWithValue) => ({ code: codeBlock.value }))
.map((codeBlock: TxtNode) => ({ code: codeBlock.value }))
)
.then((examples) => ({ result: examples, warnings: [] }))
.catch(thunkGetResultForInvalidExamples(filePath));
}

function isSupportedLangTokenWithValue(node: Token): node is TokenWithValue {
function isSupportedLangTokenWithValue(node: TxtNode): node is TokenWithValue {
return node.type === Syntax.CodeBlock && isSupportedLang(node.lang) && !!node.value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ describe('createEPID', () => {

describe('when epid file exists', () => {
const projectPath: string = resolve(__dirname, '../../../resources/designSystems/withEpidFile');
const { getWorkingDir } = setupExperimentationServerTest({ port: getRandomPortNumber(), projectPath });
const { getWorkingDir } = setupExperimentationServerTest({
port: getRandomPortNumber(),
projectPath,
timeout: CURRENT_TIMEOUT,
});

it('should not override already existed epid file', () => {
expect(getEpidContent(getWorkingDir())).toEqual(getEpidContent(projectPath));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@ describe('The generate presets command', () => {
rmdirSync(`${DS_DIR}/${COMPONENT_DIR}/presets`);
});

it('create 0-default.jsx', () => {
// when
return runUXPinMergeCommand({
cwd: 'resources/designSystems/withoutPresets',
params: [Command.GENERATE_PRESETS, `--component-path "${COMPONENT_DIR}/Avatar.tsx"`],
}).then(async () => {
// then
const content: string = await readFile(`${DS_DIR}/${COMPONENT_DIR}/presets/0-default.jsx`, 'utf-8');
expect(content).toMatchSnapshot();
});
});
it(
'create 0-default.jsx',
() => {
// when
return runUXPinMergeCommand({
cwd: 'resources/designSystems/withoutPresets',
params: [Command.GENERATE_PRESETS, `--component-path "${COMPONENT_DIR}/Avatar.tsx"`],
}).then(async () => {
// then
const content: string = await readFile(`${DS_DIR}/${COMPONENT_DIR}/presets/0-default.jsx`, 'utf-8');
expect(content).toMatchSnapshot();
});
},
CURRENT_TIMEOUT
);
});

describe('run for MenuWithData component', () => {
Expand All @@ -35,17 +39,21 @@ describe('The generate presets command', () => {
rmdirSync(`${DS_DIR}/${COMPONENT_DIR}/presets`);
});

it('create 0-default.jsx', () => {
// when
return runUXPinMergeCommand({
cwd: 'resources/designSystems/withoutPresets',
params: [Command.GENERATE_PRESETS, `--component-path "${COMPONENT_DIR}/MenuWithData.tsx"`],
}).then(async () => {
// then
const content: string = await readFile(`${DS_DIR}/${COMPONENT_DIR}/presets/0-default.jsx`, 'utf-8');
expect(content).toMatchSnapshot();
});
});
it(
'create 0-default.jsx',
() => {
// when
return runUXPinMergeCommand({
cwd: 'resources/designSystems/withoutPresets',
params: [Command.GENERATE_PRESETS, `--component-path "${COMPONENT_DIR}/MenuWithData.tsx"`],
}).then(async () => {
// then
const content: string = await readFile(`${DS_DIR}/${COMPONENT_DIR}/presets/0-default.jsx`, 'utf-8');
expect(content).toMatchSnapshot();
});
},
CURRENT_TIMEOUT
);
});

describe('run for ButtonWithIconAsProp component', () => {
Expand All @@ -56,17 +64,21 @@ describe('The generate presets command', () => {
rmdirSync(`${DS_DIR}/${COMPONENT_DIR}/presets`);
});

it('create 0-default.jsx', () => {
// when
return runUXPinMergeCommand({
cwd: 'resources/designSystems/withoutPresets',
params: [Command.GENERATE_PRESETS, `--component-path "${COMPONENT_DIR}/ButtonWithIconAsProp.tsx"`],
}).then(async () => {
// then
const content: string = await readFile(`${DS_DIR}/${COMPONENT_DIR}/presets/0-default.jsx`, 'utf-8');
expect(content).toMatchSnapshot();
});
});
it(
'create 0-default.jsx',
() => {
// when
return runUXPinMergeCommand({
cwd: 'resources/designSystems/withoutPresets',
params: [Command.GENERATE_PRESETS, `--component-path "${COMPONENT_DIR}/ButtonWithIconAsProp.tsx"`],
}).then(async () => {
// then
const content: string = await readFile(`${DS_DIR}/${COMPONENT_DIR}/presets/0-default.jsx`, 'utf-8');
expect(content).toMatchSnapshot();
});
},
CURRENT_TIMEOUT
);
});

describe('run for whole ds based on uxpin.config.js', () => {
Expand Down
Loading

0 comments on commit 0a2f983

Please sign in to comment.