Skip to content

Commit

Permalink
update latest
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieGreenman committed Oct 19, 2024
1 parent 955f131 commit d2fd2e9
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 31 deletions.
28 changes: 23 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,21 @@
"command": "generate.angular.angularDirective",
"title": "Angular Directive"
},
{
"command": "generate.angular.angularNxLib",
"title": "Angular Nx Lib"
},
{
"command": "generate.javascript.javascriptComponent",
"title": "Javascript Component"
},
{
"command": "generate.nextjs.nextjsComponent",
"title": "Nextjs Component"
},
{
"command": "generate.ngrx.ngrxFeature",
"title": "Ngrx Feature"
"command": "generate.nextjs.nextjsNxLib",
"title": "Nextjs Nx Lib"
},
{
"command": "generate.react.reactComponent",
Expand Down Expand Up @@ -174,15 +182,25 @@
"group": "myextension.myGroup",
"when": "razroo-vscode-plugin:isAuthenticated && razroo-vscode-plugin-language:angular"
},
{
"command": "generate.angular.angularNxLib",
"group": "myextension.myGroup",
"when": "razroo-vscode-plugin:isAuthenticated && razroo-vscode-plugin-language:angular"
},
{
"command": "generate.javascript.javascriptComponent",
"group": "myextension.myGroup",
"when": "razroo-vscode-plugin:isAuthenticated && razroo-vscode-plugin-language:javascript"
},
{
"command": "generate.nextjs.nextjsComponent",
"group": "myextension.myGroup",
"when": "razroo-vscode-plugin:isAuthenticated && razroo-vscode-plugin-language:nextjs"
},
{
"command": "generate.ngrx.ngrxFeature",
"command": "generate.nextjs.nextjsNxLib",
"group": "myextension.myGroup",
"when": "razroo-vscode-plugin:isAuthenticated && razroo-vscode-plugin-language:ngrx"
"when": "razroo-vscode-plugin:isAuthenticated && razroo-vscode-plugin-language:nextjs"
},
{
"command": "generate.react.reactComponent",
Expand Down Expand Up @@ -383,4 +401,4 @@
"graphql": "15.3.0"
}
}
}
}
9 changes: 9 additions & 0 deletions scripts/build-scaffolds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import { camelCase } from 'lodash';
// Parsing the env file.
dotenv.config({ path: path.resolve(__dirname, "../.env") });

// comment out the followin


// 1. getPaths - TODO modify this so
// 2. loop through each path
// 3. get scaffolds of each path
Expand All @@ -30,6 +33,12 @@ getPaths(COMMUNITY, accessToken, production).then(async paths => {
const scaffoldCommands = [{
command: "extension.auth0Authentication",
title: "Razroo Auth0 Authentication"
}, {
command: "extension.showRazrooDocumentation",
title: "Razroo Documentation"
}, {
command: "razroo.generate",
title: "Razroo Generate"
}] as any;
const pushScaffoldCommandsEdits = [{
nodeType: 'import',
Expand Down
66 changes: 40 additions & 26 deletions src/utils/scaffold/push-scaffold-commands.ts
Original file line number Diff line number Diff line change
@@ -1,117 +1,131 @@
import { createScaffold } from "./scaffold";

function generateAngularComponent(vscode, context, isProduction) {
export function generateAngularComponent(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.angular.component',
async ({ path }) => createScaffold(vscode, 'angular-16.1.0', 'angular-core', path, context, isProduction, 'component')
async ({ path }) => createScaffold(vscode, 'angular-18.2.0', 'angular-core', path, context, isProduction, 'component')
);
}

function generateAngularAngularService(vscode, context, isProduction) {
export function generateAngularAngularService(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.angular.angularService',
async ({ path }) => createScaffold(vscode, 'angular-16.1.0', 'angular-core', path, context, isProduction, 'angular-service')
async ({ path }) => createScaffold(vscode, 'angular-18.2.0', 'angular-core', path, context, isProduction, 'angular-service')
);
}

function generateAngularAngularGuard(vscode, context, isProduction) {
export function generateAngularAngularGuard(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.angular.angularGuard',
async ({ path }) => createScaffold(vscode, 'angular-16.1.0', 'angular-core', path, context, isProduction, 'angular-guard')
async ({ path }) => createScaffold(vscode, 'angular-18.2.0', 'angular-core', path, context, isProduction, 'angular-guard')
);
}

function generateAngularTypescriptInterface(vscode, context, isProduction) {
export function generateAngularTypescriptInterface(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.angular.typescriptInterface',
async ({ path }) => createScaffold(vscode, 'angular-16.1.0', 'angular-core', path, context, isProduction, 'typescript-interface')
async ({ path }) => createScaffold(vscode, 'angular-18.2.0', 'angular-core', path, context, isProduction, 'typescript-interface')
);
}

function generateAngularAngularPipe(vscode, context, isProduction) {
export function generateAngularAngularPipe(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.angular.angularPipe',
async ({ path }) => createScaffold(vscode, 'angular-16.1.0', 'angular-core', path, context, isProduction, 'angular-pipe')
async ({ path }) => createScaffold(vscode, 'angular-18.2.0', 'angular-core', path, context, isProduction, 'angular-pipe')
);
}

function generateAngularAngularDirective(vscode, context, isProduction) {
export function generateAngularAngularDirective(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.angular.angularDirective',
async ({ path }) => createScaffold(vscode, 'angular-16.1.0', 'angular-core', path, context, isProduction, 'angular-directive')
async ({ path }) => createScaffold(vscode, 'angular-18.2.0', 'angular-core', path, context, isProduction, 'angular-directive')
);
}

function generateNextjsNextjsComponent(vscode, context, isProduction) {
export function generateAngularAngularNxLib(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.angular.angularNxLib',
async ({ path }) => createScaffold(vscode, 'angular-18.2.0', 'angular-core', path, context, isProduction, 'angular-nx-lib')
);
}

export function generateJavascriptJavascriptComponent(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.javascript.javascriptComponent',
async ({ path }) => createScaffold(vscode, 'javascript-12.0.0', 'javascript-scaffolds', path, context, isProduction, 'javascript-component')
);
}

export function generateNextjsNextjsComponent(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.nextjs.nextjsComponent',
async ({ path }) => createScaffold(vscode, 'nextjs-13.1.0', 'nextjs-core', path, context, isProduction, 'nextjs-component')
async ({ path }) => createScaffold(vscode, 'nextjs-14.1.0', 'nextjs-core', path, context, isProduction, 'nextjs-component')
);
}

function generateNgrxNgrxFeature(vscode, context, isProduction) {
export function generateNextjsNextjsNxLib(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.ngrx.ngrxFeature',
async ({ path }) => createScaffold(vscode, 'ngrx-15.0.0', 'ngrx-scaffolds', path, context, isProduction, 'ngrx-feature')
'generate.nextjs.nextjsNxLib',
async ({ path }) => createScaffold(vscode, 'nextjs-14.1.0', 'nextjs-core', path, context, isProduction, 'nextjs-nx-lib')
);
}

function generateReactReactComponent(vscode, context, isProduction) {
export function generateReactReactComponent(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.react.reactComponent',
async ({ path }) => createScaffold(vscode, 'react-18.2.0', 'react-scaffolds', path, context, isProduction, 'react-component')
);
}

function generateReactReactReduxSlice(vscode, context, isProduction) {
export function generateReactReactReduxSlice(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.react.reactReduxSlice',
async ({ path }) => createScaffold(vscode, 'react-18.2.0', 'react-scaffolds', path, context, isProduction, 'react-redux-slice')
);
}

function generateSvelteSvelteComponent(vscode, context, isProduction) {
export function generateSvelteSvelteComponent(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.svelte.svelteComponent',
async ({ path }) => createScaffold(vscode, 'svelte-3.5.0', 'svelte-scaffolds', path, context, isProduction, 'svelte-component')
);
}

function generateSvelteSvelteModuleComponent(vscode, context, isProduction) {
export function generateSvelteSvelteModuleComponent(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.svelte.svelteModuleComponent',
async ({ path }) => createScaffold(vscode, 'svelte-3.5.0', 'svelte-scaffolds', path, context, isProduction, 'svelte-module-component')
);
}

function generateSvelteSvelteEndpoint(vscode, context, isProduction) {
export function generateSvelteSvelteEndpoint(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.svelte.svelteEndpoint',
async ({ path }) => createScaffold(vscode, 'svelte-3.5.0', 'svelte-scaffolds', path, context, isProduction, 'svelte-endpoint')
);
}

function generateVueComponent(vscode, context, isProduction) {
export function generateVueComponent(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.vue.component',
async ({ path }) => createScaffold(vscode, 'vue-3.2.0', 'vue-scaffolds', path, context, isProduction, 'component')
);
}

function generateVueView(vscode, context, isProduction) {
export function generateVueView(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.vue.view',
async ({ path }) => createScaffold(vscode, 'vue-3.2.0', 'vue-scaffolds', path, context, isProduction, 'view')
);
}

function generateVuePiniaStore(vscode, context, isProduction) {
export function generateVuePiniaStore(vscode, context, isProduction) {
return vscode.commands.registerCommand(
'generate.vue.piniaStore',
async ({ path }) => createScaffold(vscode, 'vue-3.2.0', 'vue-scaffolds', path, context, isProduction, 'pinia-store')
);
}

export function pushScaffoldCommands(context, vscode, isProduction: boolean) {
context.subscriptions.push(generateAngularComponent(vscode, context, isProduction), generateAngularAngularService(vscode, context, isProduction), generateAngularAngularGuard(vscode, context, isProduction), generateAngularTypescriptInterface(vscode, context, isProduction), generateAngularAngularPipe(vscode, context, isProduction), generateAngularAngularDirective(vscode, context, isProduction), generateNextjsNextjsComponent(vscode, context, isProduction), generateNgrxNgrxFeature(vscode, context, isProduction), generateReactReactComponent(vscode, context, isProduction), generateReactReactReduxSlice(vscode, context, isProduction), generateSvelteSvelteComponent(vscode, context, isProduction), generateSvelteSvelteModuleComponent(vscode, context, isProduction), generateSvelteSvelteEndpoint(vscode, context, isProduction), generateVueComponent(vscode, context, isProduction), generateVueView(vscode, context, isProduction), generateVuePiniaStore(vscode, context, isProduction));
context.subscriptions.push(generateAngularComponent(vscode, context, isProduction), generateAngularAngularService(vscode, context, isProduction), generateAngularAngularGuard(vscode, context, isProduction), generateAngularTypescriptInterface(vscode, context, isProduction), generateAngularAngularPipe(vscode, context, isProduction), generateAngularAngularDirective(vscode, context, isProduction), generateAngularAngularNxLib(vscode, context, isProduction), generateJavascriptJavascriptComponent(vscode, context, isProduction), generateNextjsNextjsComponent(vscode, context, isProduction), generateNextjsNextjsNxLib(vscode, context, isProduction), generateReactReactComponent(vscode, context, isProduction), generateReactReactReduxSlice(vscode, context, isProduction), generateSvelteSvelteComponent(vscode, context, isProduction), generateSvelteSvelteModuleComponent(vscode, context, isProduction), generateSvelteSvelteEndpoint(vscode, context, isProduction), generateVueComponent(vscode, context, isProduction), generateVueView(vscode, context, isProduction), generateVuePiniaStore(vscode, context, isProduction))
}

0 comments on commit d2fd2e9

Please sign in to comment.