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
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"conventionalCommits.scopes": ["dev-deps", "deps"]
"conventionalCommits.scopes": [
"dev-deps",
"deps",
"playground"
]
}
99 changes: 99 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,104 @@
}
}
},
"ngx-gist-playground": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "projects/ngx-gist-playground",
"sourceRoot": "projects/ngx-gist-playground/src",
"prefix": "ngx",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/ngx-gist-playground",
"index": "projects/ngx-gist-playground/src/index.html",
"main": "projects/ngx-gist-playground/src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "projects/ngx-gist-playground/tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"projects/ngx-gist-playground/src/favicon.ico",
"projects/ngx-gist-playground/src/assets"
],
"styles": [
"@angular/material/prebuilt-themes/pink-bluegrey.css",
"projects/ngx-gist-playground/src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "ngx-gist-playground:build:production"
},
"development": {
"browserTarget": "ngx-gist-playground:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ngx-gist-playground:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "projects/ngx-gist-playground/tsconfig.spec.json",
"inlineStyleLanguage": "scss",
"assets": [
"projects/ngx-gist-playground/src/favicon.ico",
"projects/ngx-gist-playground/src/assets"
],
"styles": [
"@angular/material/prebuilt-themes/pink-bluegrey.css",
"projects/ngx-gist-playground/src/styles.scss"
],
"scripts": []
}
}
}
}
}
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
"private": true,
"dependencies": {
"@angular/animations": "^15.1.0",
"@angular/cdk": "15.1.2",
"@angular/common": "^15.1.0",
"@angular/compiler": "^15.1.0",
"@angular/core": "^15.1.0",
"@angular/forms": "^15.1.0",
"@angular/material": "15.1.2",
"@angular/platform-browser": "^15.1.0",
"@angular/platform-browser-dynamic": "^15.1.0",
"@angular/router": "^15.1.0",
Expand All @@ -38,4 +40,4 @@
"ng-packagr": "^15.1.0",
"typescript": "~4.9.4"
}
}
}
10 changes: 10 additions & 0 deletions projects/ngx-gist-playground/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

const routes: Routes = [];

@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
Empty file.
Empty file.
35 changes: 35 additions & 0 deletions projects/ngx-gist-playground/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';

describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
});

it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});

it(`should have as title 'ngx-gist-playground'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('ngx-gist-playground');
});

it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.content span')?.textContent).toContain('ngx-gist-playground app is running!');
});
});
18 changes: 18 additions & 0 deletions projects/ngx-gist-playground/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* @license
* Copyright Nelson Dominguez All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at the root of this project.
*/

import {Component} from '@angular/core';

@Component({
selector: 'ngx-gist-playground-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent {
title = 'ngx-gist-playground';
}
24 changes: 24 additions & 0 deletions projects/ngx-gist-playground/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @license
* Copyright Nelson Dominguez All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at the root of this project.
*/

import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';

import {NgxGistModule} from '@ekkolon/ngx-gist';

import {AppRoutingModule} from './app-routing.module';
import {AppComponent} from './app.component';

@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, BrowserAnimationsModule, NgxGistModule, AppRoutingModule],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
Empty file.
Binary file added projects/ngx-gist-playground/src/favicon.ico
Binary file not shown.
19 changes: 19 additions & 0 deletions projects/ngx-gist-playground/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>NgxGistPlayground</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>

<body>
<ngx-gist-playground-root></ngx-gist-playground-root>
</body>

</html>
7 changes: 7 additions & 0 deletions projects/ngx-gist-playground/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';


platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
4 changes: 4 additions & 0 deletions projects/ngx-gist-playground/src/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* You can add global styles to this file, and also import other style files */

html, body { height: 100%; }
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
14 changes: 14 additions & 0 deletions projects/ngx-gist-playground/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/app",
"types": []
},
"files": [
"src/main.ts"
],
"include": [
"src/**/*.d.ts"
]
}
14 changes: 14 additions & 0 deletions projects/ngx-gist-playground/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": [
"jasmine"
]
},
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}
3 changes: 2 additions & 1 deletion projects/ngx-gist/src/lib/ngx-gist.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export class NgxGistComponent {
*/
@Input() set gistId(id: string) {
this._gistId = id;
this._iframeId = `gist-${id}`;
const fileId = this.file ? `-file=${this.file}` : '';
this._iframeId = `gist-${id}${fileId}`;
}

/**
Expand Down
Loading