diff --git a/libs/plugins/generators.json b/libs/plugins/generators.json index 38ad6e6b3..e565dba80 100644 --- a/libs/plugins/generators.json +++ b/libs/plugins/generators.json @@ -8,11 +8,6 @@ "schema": "./src/generators/fusion-app-generator/schema.json", "description": "fusion-app-generator generator" }, - "fusion-report-generator": { - "factory": "./src/generators/fusion-report-generator/generator", - "schema": "./src/generators/fusion-report-generator/schema.json", - "description": "fusion-report-generator generator" - }, "app-library": { "factory": "./src/generators/app-library/generator", "schema": "./src/generators/app-library/schema.json", diff --git a/libs/plugins/src/generators/fusion-report-generator/files/package.json__template__ b/libs/plugins/src/generators/fusion-report-generator/files/package.json__template__ deleted file mode 100644 index 554d2c7cf..000000000 --- a/libs/plugins/src/generators/fusion-report-generator/files/package.json__template__ +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "<%= projectName %>", - "displayName": "<%= displayName %>", - "version": "0.0.1", - "main": "/src/main.tsx", - "private": true, - "type": "module", - "scripts": { - "dev": "fusion-framework-cli app dev", - "build": "tsc -b -f", - "pr:deploy": "npx ts-node --esm ../../github-action/src/releasePr.ts release", - "fprd:deploy": "npx ts-node --esm ../../github-action/src/releaseMain.ts release" - }, - "dependencies": { - "@cc-components/powerbi": "workspace:^", - "@cc-components/shared": "workspace:^" - }, - "files": [ - "dist/app-bundle.js", - "app-manifest.json" - ] -} diff --git a/libs/plugins/src/generators/fusion-report-generator/files/src/main.tsx__template__ b/libs/plugins/src/generators/fusion-report-generator/files/src/main.tsx__template__ deleted file mode 100644 index 5c1f9801e..000000000 --- a/libs/plugins/src/generators/fusion-report-generator/files/src/main.tsx__template__ +++ /dev/null @@ -1,18 +0,0 @@ -import { RootAppWrapper, createRender } from '@cc-components/shared'; -import { Report, configure } from '@cc-components/powerbi'; - -const MyApp = () => { - return ( - - "} - column={'ProjectMaster GUID'} - reportId={"<%= reportId %>"} - table={'Dim_ProjectMaster'} - /> - - ); -}; - -export const render = createRender(MyApp, configure); -export default render; diff --git a/libs/plugins/src/generators/fusion-report-generator/files/tsconfig.app.json__template__ b/libs/plugins/src/generators/fusion-report-generator/files/tsconfig.app.json__template__ deleted file mode 100644 index b1207166e..000000000 --- a/libs/plugins/src/generators/fusion-report-generator/files/tsconfig.app.json__template__ +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "types": ["node"], - "rootDir": "." - }, - "exclude": [ - "jest.config.ts", - "**/*.spec.ts", - "**/*.test.ts", - "**/*.spec.tsx", - "**/*.test.tsx", - "**/*.spec.js", - "**/*.test.js", - "**/*.spec.jsx", - "**/*.test.jsx", - "dist", - "vite.config.ts" - ], - "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"] -} \ No newline at end of file diff --git a/libs/plugins/src/generators/fusion-report-generator/files/tsconfig.json__template__ b/libs/plugins/src/generators/fusion-report-generator/files/tsconfig.json__template__ deleted file mode 100644 index 0e337ec17..000000000 --- a/libs/plugins/src/generators/fusion-report-generator/files/tsconfig.json__template__ +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "jsx": "react-jsx", - "allowJs": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "forceConsistentCasingInFileNames": true, - "strict": true, - "noImplicitOverride": true, - "noPropertyAccessFromIndexSignature": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true - }, - "files": [], - "include": [], - "references": [ - { - "path": "./tsconfig.app.json" - } - ] -} \ No newline at end of file diff --git a/libs/plugins/src/generators/fusion-report-generator/files/vite.config.ts__template__ b/libs/plugins/src/generators/fusion-report-generator/files/vite.config.ts__template__ deleted file mode 100644 index 7aaf6c6bc..000000000 --- a/libs/plugins/src/generators/fusion-report-generator/files/vite.config.ts__template__ +++ /dev/null @@ -1,19 +0,0 @@ -import { defineConfig } from 'vite'; -import EnvironmentPlugin from 'vite-plugin-environment'; - -export default defineConfig({ - plugins: [ - EnvironmentPlugin({ - NODE_ENV: 'production', - }), - ], - appType: 'custom', - build: { - emptyOutDir: true, - lib: { - entry: './src/main.tsx', - fileName: 'app-bundle', - formats: ['es'], - }, - }, -}); diff --git a/libs/plugins/src/generators/fusion-report-generator/generator.ts b/libs/plugins/src/generators/fusion-report-generator/generator.ts deleted file mode 100644 index 96ef56c6f..000000000 --- a/libs/plugins/src/generators/fusion-report-generator/generator.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { - formatFiles, - generateFiles, - getWorkspaceLayout, - names, - offsetFromRoot, - Tree, - installPackagesTask, -} from '@nrwl/devkit'; -import * as path from 'path'; -import { FusionReportGeneratorGeneratorSchema } from './schema'; - -interface NormalizedSchema extends FusionReportGeneratorGeneratorSchema { - projectName: string; - projectRoot: string; - projectDirectory: string; - parsedTags: string[]; - displayName: string; - reportId: string; -} - -function normalizeOptions( - tree: Tree, - options: FusionReportGeneratorGeneratorSchema -): NormalizedSchema { - const name = names(options.appKey.trimEnd()).fileName; - const projectDirectory = options.directory - ? `${names(options.directory).fileName}/${name}` - : name; - const projectName = projectDirectory.replace(new RegExp('/', 'g'), '-'); - const projectRoot = `${getWorkspaceLayout(tree).appsDir.replace( - 'apps', - 'reports' - )}/${projectDirectory}`; - const parsedTags = ['powerbi']; - - return { - ...options, - projectName, - projectRoot, - projectDirectory, - parsedTags, - reportId: options.reportId.trimEnd(), - displayName: options.displayName.trimEnd(), - }; -} - -function addFiles(tree: Tree, options: NormalizedSchema) { - const templateOptions = { - ...options, - ...names(options.appKey), - - offsetFromRoot: offsetFromRoot(options.projectRoot), - template: '', - }; - generateFiles( - tree, - path.join(__dirname, 'files'), - options.projectRoot, - templateOptions - ); -} - -export default async function initGenerator( - tree: Tree, - options: FusionReportGeneratorGeneratorSchema -) { - const normalizedOptions = normalizeOptions(tree, options); - addFiles(tree, normalizedOptions); - await formatFiles(tree); - - return async () => { - installPackagesTask(tree, true, '.', 'pnpm'); - }; -} diff --git a/libs/plugins/src/generators/fusion-report-generator/schema.json b/libs/plugins/src/generators/fusion-report-generator/schema.json deleted file mode 100644 index 9bbd0df16..000000000 --- a/libs/plugins/src/generators/fusion-report-generator/schema.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$schema": "http://json-schema.org/schema", - "cli": "nx", - "$id": "FusionReportGenerator", - "title": "Create a Fusion Report", - "description": "Create a Fusion Report", - "type": "object", - "properties": { - "appKey": { - "type": "string", - "description": "", - "$default": { - "$source": "argv", - "index": 0 - }, - "x-prompt": "What appKey would you like to use?" - }, - "reportId": { - "type": "string", - "description": "", - "$default": { - "$source": "argv", - "index": 1 - }, - "x-prompt": "What is the global-identifier in Fusion Reports Admin?" - }, - "displayName": { - "type": "string", - "description": "", - "$default": { - "$source": "argv", - "index": 2 - }, - "x-prompt": "What is the display name in Fusion?" - }, - "directory": { - "type": "string", - "description": "A directory where the project is placed" - } - }, - "required": ["appKey", "reportId", "displayName"] -} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index c79cab7e8..480ce2b7a 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,6 +1,5 @@ packages: - 'libs/**' - 'apps/*' - - 'reports/**' - 'cli' - 'github-action'