Skip to content

Commit

Permalink
chore: Moves the generator inside converter package
Browse files Browse the repository at this point in the history
  • Loading branch information
orangevolon committed Dec 2, 2024
1 parent aa28fdd commit 6a5440a
Show file tree
Hide file tree
Showing 21 changed files with 7,724 additions and 271 deletions.
202 changes: 4 additions & 198 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"scripts": {
"lint": "eslint --ignore-path .gitignore --ext js,ts .",
"build": "tsc -b && node scripts/generate-package.js && node scripts/generate-doc.js && node scripts/generate-exports.js",
"postbuild": "cp NOTICE README.md LICENSE lib/core && cp NOTICE README.md LICENSE lib/converter && cp NOTICE README.md LICENSE lib/generator",
"postbuild": "cp NOTICE README.md LICENSE lib/core && cp NOTICE README.md LICENSE lib/converter",
"test": "vitest run",
"posttest": "node ./scripts/verify-typescript.js",
"prepare": "husky install"
Expand All @@ -22,12 +22,10 @@
"@babel/plugin-syntax-typescript": "^7.16.0",
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
"@cloudscape-design/documenter": "^1.0.0",
"@types/lodash": "^4.17.13",
"@typescript-eslint/eslint-plugin": "^5.30.6",
"@typescript-eslint/parser": "^5.30.6",
"css-selector-tokenizer": "^0.8.0",
"css.escape": "^1.5.1",
"execa": "^9.5.1",
"glob": "^7.2.0",
"lodash": "^4.17.21",
"react-dom": "^18.2.0"
Expand All @@ -37,6 +35,7 @@
"@types/babel__core": "^7.1.16",
"@types/glob": "^8.1.0",
"@types/jest": "^28.1.3",
"@types/lodash": "^4.17.13",
"@types/node": "^18.0.0",
"@types/react-dom": "^18.0.10",
"@vitest/coverage-istanbul": "^1.2.2",
Expand Down
9 changes: 0 additions & 9 deletions scripts/generate-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ const packages = [
packageRoot: path.join(root, './lib/converter'),
dependencies: ['@babel/core', '@babel/plugin-syntax-decorators', '@babel/plugin-syntax-typescript', 'glob'],
},
{
manifest: {
name: '@cloudscape-design/test-utils-generator',
main: './dist/index.js',
files: ['dist', '*.js', '*.d.ts', 'NOTICE', 'LICENSE', 'README.md'],
},
packageRoot: path.join(root, './lib/generator'),
dependencies: [],
},
{
manifest: {
name: '@cloudscape-design/test-utils-core',
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import fs from 'fs';
import { generateComponentFinders } from './generate-component-finders';
import { ComponentWrapperMetadata, GenerateTestUtilsParams, TestUtilType } from './interfaces';
import { writeSourceFile } from './utils';
import convertToSelectorUtil from '../../lib/converter';
import lodash from 'lodash';
import { convertToSelectorUtil } from './convert-to-selectors';

interface GenerateIndexFilesParams extends GenerateTestUtilsParams {
testUtilType: TestUtilType;
Expand All @@ -17,7 +17,7 @@ function generateIndexFile({ testUtilsPath, components, testUtilType }: Generate
name,
pluralName,
wrapperName: `${name}Wrapper`,
wrapperImportPath: `./${lodash.kebabCase(name)}/index.ts`,
wrapperImportPath: `./${lodash.kebabCase(name)}/index`,
}));

const content = generateComponentFinders({ testUtilType, components: componenWrappersMetadata });
Expand Down
Loading

0 comments on commit 6a5440a

Please sign in to comment.