Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions README copy.md

This file was deleted.

2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "nx/presets/core.json",
"npmScope": "brainly",
"npmScope": "brainly-gene",
"affected": {
"defaultBase": "master"
},
Expand Down
16 changes: 15 additions & 1 deletion packages/create/bin/create-gene-workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ async function runCommands() {
'install',
`@brainly-gene/core@${packageVersion}`,
`@brainly-gene/next@${packageVersion}`,
`@brainly-gene/apollo@${packageVersion}`,
`[email protected]`,
`[email protected]`,
`[email protected]`,
`[email protected]`,
'brainly-style-guide',
]);

Expand All @@ -98,6 +101,10 @@ async function runCommands() {
'install',
`@brainly-gene/tools@${packageVersion}`,
`@brainly-gene/eslint-plugin@${packageVersion}`,
`[email protected]`,
`@types/[email protected]`,
`@types/[email protected]`,
`@types/[email protected]`,
'-D',
]);

Expand All @@ -107,6 +114,13 @@ async function runCommands() {
'g',
'@brainly-gene/tools:gene-workspace',
]);

console.log('Generating e2e testing providers');
await execCommand('pnpm', [
'nx',
'g',
'@brainly-gene/tools:e2e-provider',
]);
} catch (error) {
console.error(error);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/create/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["packages/create/**/*.ts"]
"lintFilePatterns": ["packages/create/**/*.{ts,js}"]
}
}
},
Expand Down
10 changes: 7 additions & 3 deletions packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
"main": "src/index.js",
"generators": "./generators.json",
"executors": "./executors.json",
"peerDependencies": {
"eslint": "^8.44.0",
"dependencies": {
"@nrwl/linter": "^15.0.3",
"@nrwl/eslint-plugin-nx": "15.8.9",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^28.8.3"
"eslint-plugin-jest": "^28.8.3",
"@typescript-eslint/eslint-plugin": "5.62.0"
},
"peerDependencies": {
"eslint": ">=8.0.0"
}
}
9 changes: 8 additions & 1 deletion packages/gene-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
"version": "0.1.2",
"license": "Apache-2.0",
"dependencies": {
"@next/bundle-analyzer": "12.3.4"
"@next/bundle-analyzer": "12.3.4",
"tslib": "2.8.1"
},
"devDependencies": {
"eslint-config-next": "12.3.1"
},
"peerDependencies": {
"next": "12.3.4"
}
}
10 changes: 9 additions & 1 deletion packages/gene-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
},
"dependencies": {
"@angular-devkit/core": "11.2.0",
"@angular-devkit/schematics": "11.2.0"
"@angular-devkit/schematics": "11.2.0",
"@nrwl/jest": "15.8.6",
"@nrwl/js": "15.8.6",
"@nrwl/linter": "15.8.6",
"@nrwl/cli": "15.8.9",
"@nrwl/devkit": "15.8.9",
"jest": "28.1.3",
"ts-jest": "28.0.8",
"jest-environment-jsdom": "28.1.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ export default async function (tree: Tree) {
await generateFiles(tree, joinPathFragments(__dirname, './files'), './', {});

// Update .eslintrc.json
const eslintJson = tree.read('.eslintrc.json', 'utf-8');
const updatedEslintJson = eslintJson.replace(
'plugin:@nrwl/nx/typescript',
'plugin:@brainly-gene/gene/basic'
);
// TODO once eslint plugin will be stablized enable it again
// const eslintJson = tree.read('.eslintrc.json', 'utf-8');
// const updatedEslintJson = eslintJson.replace(
// 'plugin:@nrwl/nx/typescript',
// 'plugin:@brainly-gene/eslint-plugin/basic'
// );

tree.write('.eslintrc.json', updatedEslintJson);
// tree.write('.eslintrc.json', updatedEslintJson);

return () => {
installPackagesTask(tree);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Module generator', () => {
beforeEach(async () => {
projectName = 'my-lib';
expectedModuleFolder = 'libs/my-app/app-modules';
appTree = createTreeWithEmptyWorkspace({layout: 'apps-libs'});
appTree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
createdProjectName = 'my-app-app-modules';
domainTag = 'domain:test';

Expand Down
10 changes: 5 additions & 5 deletions packages/gene-tools/src/generators/module-generator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Learn more about modules naming on: https://brainly.github.io/gene/gene/modules/
dataTestId: stringUtils.underscore(`${nameWithSuffix}-id`),
tmpl: '',
errorBoundary,
npmScope
npmScope,
}
);

Expand Down Expand Up @@ -159,7 +159,7 @@ Learn more about modules naming on: https://brainly.github.io/gene/gene/modules/
.camelize(moduleDisplayName)
.toLocaleLowerCase(),
tmpl: '',
npmScope
npmScope,
}
);
}
Expand All @@ -186,7 +186,7 @@ Learn more about modules naming on: https://brainly.github.io/gene/gene/modules/
.camelize(moduleDisplayName)
.toLocaleLowerCase(),
tmpl: '',
npmScope
npmScope,
}
);

Expand Down Expand Up @@ -283,7 +283,7 @@ Learn more about modules naming on: https://brainly.github.io/gene/gene/modules/
dataTestId: stringUtils.underscore(`${nameWithSuffix}-id`),
tmpl: '',
errorBoundary,
npmScope
npmScope,
}
);

Expand Down Expand Up @@ -315,7 +315,7 @@ Learn more about modules naming on: https://brainly.github.io/gene/gene/modules/
.camelize(moduleDisplayName)
.toLocaleLowerCase(),
tmpl: '',
npmScope
npmScope,
}
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logger, readJson, Tree } from '@nrwl/devkit';
import { logger, Tree } from '@nrwl/devkit';
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
import serviceGenerator from './index';

Expand All @@ -8,7 +8,7 @@ describe('Service generator', () => {

beforeEach(async () => {
projectName = 'my-service';
appTree = createTreeWithEmptyWorkspace({layout: 'apps-libs'});
appTree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });

jest.spyOn(logger, 'warn').mockImplementation(() => 1);
jest.spyOn(logger, 'debug').mockImplementation(() => 1);
Expand Down
2 changes: 2 additions & 0 deletions packages/gene-tools/src/generators/service-generator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function createFiles(
options.targetLocation,
{
...schema,
npmScope: options.npmScope,
fileName: stringUtils.classify(schema.name),
lowerCaseFileName: stringUtils.camelize(schema.name),
tmpl: '',
Expand Down Expand Up @@ -95,6 +96,7 @@ export default async function (tree: Tree, schema: BrainlyServiceGenerator) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
/** @ts-ignore */
const npmScope = getNpmScope(tree);

/**
* @description
* Generating proper files based on the service type
Expand Down
9 changes: 8 additions & 1 deletion packages/gene/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,12 @@
"name": "@brainly-gene/core",
"version": "0.1.2",
"license": "Apache-2.0",
"main": "./src/index.js"
"main": "./src/index.js",
"dependencies": {
"@tanstack/react-query": "5.55.4",
"inversify": "5.1.1"
},
"peerDependencies": {
"react": ">=16.9.0 <=18.3.1"
}
}
Loading