Skip to content

Commit

Permalink
Merge branch 'main' of github.com:IPdotSetAF/CodeChef
Browse files Browse the repository at this point in the history
  • Loading branch information
IPdotSetAF committed Oct 27, 2024
2 parents 82765c0 + 5435564 commit d43ff87
Show file tree
Hide file tree
Showing 29 changed files with 495 additions and 49 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
on:
push:
branches:
- "main" # change to the branch you wish to deploy from
tags:
- "v*"

permissions:
contents: read
pages: write
id-token: write

jobs:
tests:
uses: ./.github/workflows/main.yml
deploy:
needs: [tests]
environment:
name: "github-pages"
url: ${{ steps.build-publish.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- id: build-publish
uses: bitovi/github-actions-angular-to-github-pages@v1.0.0
with:
path: dist/code-chef/browser
build_command: npm run build
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

name: Build and Test

on:
pull_request:
branches:
- main
workflow_call:

jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 20 ]

name: Node ${{ matrix.node }} sample
steps:
- uses: actions/checkout@v3
- name: Building rules and tests
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm run build
- run: npm run test-ci
4 changes: 2 additions & 2 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "code-chef",
"version": "0.0.0",
"version": "1.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"test-ci": "ng test --no-watch --no-progress --browsers=ChromeHeadless",
"serve:ssr:CodeChef": "node dist/code-chef/server/server.mjs"
},
"private": true,
Expand Down
34 changes: 34 additions & 0 deletions public/ipaf.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { HomeComponent } from './home/home.component';
export const routes: Routes = [
{ path: '', redirectTo: "home", pathMatch: "full" },

{ path: 'home', title: "CodeChef", component: HomeComponent },
{ path: 'home', title: "Home • CodeChef", component: HomeComponent },
{ path: 'cs2ts', title: "C# to TS • CodeChef", component: Cs2tsComponent },

{ path: '**', title: "Not Found • CodeChef", component: NotFoundComponent },
Expand Down
Empty file removed src/app/app/app.component.css
Empty file.
2 changes: 2 additions & 0 deletions src/app/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<app-header/>
<router-outlet />
<app-footer/>
15 changes: 15 additions & 0 deletions src/app/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { ActivatedRoute } from '@angular/router';

describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AppComponent],
providers: [
{
provide: ActivatedRoute,
useValue: {
snapshot: {
url: ["home"]
}
}
},
]
}).compileComponents();
});

Expand All @@ -13,4 +24,8 @@ describe('AppComponent', () => {
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});

it('should have application version', () =>{
expect(AppComponent.version).toBeTruthy();
});
});
14 changes: 11 additions & 3 deletions src/app/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { HeaderComponent } from "../header/header.component";
import { FooterComponent } from "../footer/footer.component";
import packageJson from '../../../package.json';
import { Meta } from '@angular/platform-browser';

@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet],
templateUrl: './app.component.html',
styleUrl: './app.component.css'
imports: [RouterOutlet, HeaderComponent, FooterComponent],
templateUrl: './app.component.html'
})
export class AppComponent {
public static version: string = packageJson.version;

constructor(meta: Meta) {
meta.addTag({ name: "author", content: "IPdotSetAF" });
}
}
Empty file removed src/app/cs2ts/cs2ts.component.css
Empty file.
67 changes: 66 additions & 1 deletion src/app/cs2ts/cs2ts.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="container-fluid p-4">
<div class="row">
<h1>C# to TS Converter</h1>
<h2>C# to TS Converter</h2>
<p>Convert C# class fields to TypeScript interface fields.</p>
</div>

Expand All @@ -27,4 +27,69 @@ <h1>C# to TS Converter</h1>
<button class="btn btn-success" (click)="convert()">Convert <i class="bi bi-caret-right"></i></button>
</div>
</div>

<br />

<div class="row">
<div class="col-12">
<h3 class="row">Supports:</h3>
<ul class="row">
<li>Primary data types:
<ul>
<li>boolean</li>
<li>number:
<ul>
<li>byte</li>
<li>sbyte</li>
<li>short</li>
<li>ushort</li>
<li>int</li>
<li>uint</li>
<li>float</li>
<li>double</li>
<li>decimal</li>
</ul>
</li>
<li>bigint:
<ul>
<li>long</li>
<li>ulong</li>
</ul>
</li>
<li>string:
<ul>
<li>string</li>
<li>char</li>
</ul>
</li>
<li>Date:
<ul>
<li>DateTime</li>
<li>DateOnly</li>
<li>TimeOnly</li>
</ul>
</li>
<li>any:
<ul>
<li>object</li>
<li>dynamic</li>
</ul>
</li>
<li>void</li>
</ul>
</li>
<li>Custom data types</li>
<li>Arrays
<ul>
<li>[]</li>
<li>List&lt;&gt;</li>
<li>IEnumerable&lt;&gt;</li>
<li>ICollection&lt;&gt;</li>
</ul>
</li>
<li>Generics</li>
<li>Nullables</li>
</ul>
</div>
</div>
</div>
6 changes: 5 additions & 1 deletion src/app/cs2ts/cs2ts.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { Cs2tsComponent } from './cs2ts.component';
import { provideAnimations } from '@angular/platform-browser/animations';

describe('Cs2tsComponent', () => {
let component: Cs2tsComponent;
let fixture: ComponentFixture<Cs2tsComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [Cs2tsComponent]
imports: [Cs2tsComponent],
providers:[
provideAnimations()
]
})
.compileComponents();

Expand Down
Loading

0 comments on commit d43ff87

Please sign in to comment.