Repository: NetanelBasal/ngx-content-loader
Branch: master
Commit: de69f1b4c2c4
Files: 53
Total size: 57.0 KB
Directory structure:
gitextract_04497wqc/
├── .all-contributorsrc
├── .github/
│ └── workflows/
│ └── content-loader.yml
├── .gitignore
├── .husky/
│ └── .gitignore
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE.md
├── LICENSE
├── PULL_REQUEST_TEMPLATE.md
├── README.md
├── angular.json
├── commitlint.config.js
├── package.json
├── prettier.config.js
├── projects/
│ └── ngneat/
│ └── content-loader/
│ ├── CHANGELOG.md
│ ├── karma.conf.js
│ ├── ng-package.json
│ ├── ng-package.prod.json
│ ├── package.json
│ ├── src/
│ │ ├── lib/
│ │ │ ├── bullet-list-loader.component.ts
│ │ │ ├── content-loader.component.html
│ │ │ ├── content-loader.component.ts
│ │ │ ├── content-loader.module.ts
│ │ │ ├── facebook-loader.component.ts
│ │ │ └── list-loader.component.ts
│ │ ├── public_api.ts
│ │ └── test.ts
│ ├── tsconfig.lib.json
│ ├── tsconfig.spec.json
│ └── tslint.json
├── src/
│ ├── app/
│ │ ├── app.component.css
│ │ ├── app.component.html
│ │ ├── app.component.ts
│ │ ├── app.module.ts
│ │ └── app.server.module.ts
│ ├── assets/
│ │ └── .gitkeep
│ ├── environments/
│ │ ├── environment.prod.ts
│ │ └── environment.ts
│ ├── index.html
│ ├── karma.conf.js
│ ├── main.server.ts
│ ├── main.ts
│ ├── polyfills.ts
│ ├── server.ts
│ ├── styles.css
│ ├── test.ts
│ ├── tsconfig.app.json
│ ├── tsconfig.server.json
│ ├── tsconfig.spec.json
│ └── tslint.json
├── tsconfig.json
└── tslint.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .all-contributorsrc
================================================
{
"projectName": "content-loader",
"projectOwner": "NetanelBasal",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": true,
"commitConvention": "angular",
"contributors": [
{
"login": "NetanelBasal",
"name": "Netanel Basal",
"avatar_url": "https://avatars1.githubusercontent.com/u/6745730?v=4",
"profile": "https://www.netbasal.com",
"contributions": [
"code",
"content",
"doc"
]
},
{
"login": "leo6104",
"name": "Heo",
"avatar_url": "https://avatars0.githubusercontent.com/u/7777929?v=4",
"profile": "https://www.mapianist.com",
"contributions": [
"code"
]
},
{
"login": "andreas-aeschlimann",
"name": "Andreas Aeschlimann",
"avatar_url": "https://avatars3.githubusercontent.com/u/2174826?v=4",
"profile": "http://www.andreas.ae",
"contributions": [
"doc"
]
},
{
"login": "alexw10",
"name": "alexw10",
"avatar_url": "https://avatars0.githubusercontent.com/u/9453636?v=4",
"profile": "https://github.com/alexw10",
"contributions": [
"code",
"doc"
]
},
{
"login": "nonsocode",
"name": "Chinonso Chukwuogor",
"avatar_url": "https://avatars3.githubusercontent.com/u/12021370?v=4",
"profile": "https://github.com/nonsocode",
"contributions": [
"code"
]
},
{
"login": "wynfred",
"name": "wynfred",
"avatar_url": "https://avatars2.githubusercontent.com/u/9249564?v=4",
"profile": "https://github.com/wynfred",
"contributions": [
"code"
]
},
{
"login": "irustm",
"name": "Rustam",
"avatar_url": "https://avatars1.githubusercontent.com/u/16316579?v=4",
"profile": "https://twitter.com/irustm",
"contributions": [
"code"
]
},
{
"login": "gund",
"name": "Alex Malkevich",
"avatar_url": "https://avatars0.githubusercontent.com/u/3644678?v=4",
"profile": "https://github.com/gund",
"contributions": [
"doc"
]
},
{
"login": "danielsogl",
"name": "Daniel Sogl",
"avatar_url": "https://avatars2.githubusercontent.com/u/15234844?v=4",
"profile": "https://github.com/danielsogl",
"contributions": [
"code",
"maintenance",
"platform"
]
},
{
"login": "kreatemore",
"name": "Alex Szabó",
"avatar_url": "https://avatars1.githubusercontent.com/u/9606801?v=4",
"profile": "http://www.tailored.hu/",
"contributions": [
"code"
]
},
{
"login": "donroyco",
"name": "Roy",
"avatar_url": "https://avatars2.githubusercontent.com/u/1763537?v=4",
"profile": "http://codepen.io/donroyco/",
"contributions": [
"doc"
]
},
{
"login": "RobinVdBroeck",
"name": "Robin Van den Broeck",
"avatar_url": "https://avatars2.githubusercontent.com/u/3083785?v=4",
"profile": "https://robinvdb.me/",
"contributions": [
"code",
"maintenance",
"platform"
]
}
],
"contributorsPerLine": 7
}
================================================
FILE: .github/workflows/content-loader.yml
================================================
name: '@ngneat/content-loader'
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ubuntu-18.04
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
id: npm-cache
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-npm
- uses: actions/setup-node@v1
with:
node-version: 14.15
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
env:
HUSKY_SKIP_INSTALL: 'true'
run: npm ci
- name: Build library
run: npm run build:lib
- name: Build integration app
run: npm run build:integration
================================================
FILE: .gitignore
================================================
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# dependencies
/node_modules
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db
.angulardoc.json
================================================
FILE: .husky/.gitignore
================================================
_
================================================
FILE: CHANGELOG.md
================================================
# Changelog
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [6.2.0](https://github.com/ngneat/content-loader/compare/v6.1.0...v6.2.0) (2021-11-17)
### Features
* upgrade to Angular 13 and switch to modern APF ([#99](https://github.com/ngneat/content-loader/issues/99)) ([3cafc3b](https://github.com/ngneat/content-loader/commit/3cafc3bb3d6583bdc9e42a77aac20dbdd1996c12))
## [6.1.0](https://github.com/ngneat/content-loader/compare/v6.0.0...v6.1.0) (2021-06-30)
### Features
* enable `OnPush` for all components and setup server-side rendering ([#90](https://github.com/ngneat/content-loader/issues/90)) ([c2fea90](https://github.com/ngneat/content-loader/commit/c2fea90913fc415eb6e7d26a419e4235aad435e2))
### Bug Fixes
* **lib:** default size for content loader viewbox ([#76](https://github.com/ngneat/content-loader/issues/76)) ([a749240](https://github.com/ngneat/content-loader/commit/a7492409eb47655ede8b38ad07b13084a68ecc5e))
## [6.0.0](https://github.com/ngneat/content-loader/compare/v5.0.0...v6.0.0) (2020-10-31)
### ⚠ BREAKING CHANGES
- 🧨 align the library with react and remove base url functionality
### Features
- 🎸 lib ([fb57f9a](https://github.com/ngneat/content-loader/commit/fb57f9a75aec60d4dae7f2ef1b229650949b1305))
## [5.0.0](https://github.com/ngneat/content-loader/compare/v4.1.0...v5.0.0) (2020-07-23)
### ⚠ BREAKING CHANGES
- 🧨 support ng10
### Features
- 🎸 support ng 10 ([a26012e](https://github.com/ngneat/content-loader/commit/a26012ec00922048ebb6a7ce06495582c3ef291c))
- **lib:** migrate to ng 10 ([#62](https://github.com/ngneat/content-loader/issues/62)) ([6efec6e](https://github.com/ngneat/content-loader/commit/6efec6e036aa08b4a504e55d8e2115fcdd5f6f38))
## [4.0.0](https://github.com/ngneat/content-loader/compare/v3.0.0...v4.0.0) (2019-08-19)
### Bug Fixes
- **content-loader:** set baseUrl before setFillStyle, setClipStyle ([285c2b4](https://github.com/ngneat/content-loader/commit/285c2b4))
### Features
- 🎸 lib ([91ff5bb](https://github.com/ngneat/content-loader/commit/91ff5bb))
- **content-loader:** set baseUrl to window.location.pathname in ngOnInit ([f88fde5](https://github.com/ngneat/content-loader/commit/f88fde5))
### BREAKING CHANGES
- move to ngneat
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at netanel7799@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to Content Loader
🙏 We would ❤️ for you to contribute to Content Loader and help make it even better than it is today!
# Developing
Start by installing all dependencies:
```bash
npm i
```
## Building
```bash
npm run build:lib
```
## Coding Rules
To ensure consistency throughout the source code, keep these rules in mind as you are working:
- All features or bug fixes **must be tested** by one or more specs (unit-tests).
- All public API methods **must be documented**.
## Commit Message Guidelines
We have very precise rules over how our git commit messages can be formatted. This leads to **more
readable messages** that are easy to follow when looking through the **project history**. But also,
we use the git commit messages to **generate the Akita changelog**.
### Commit Message Format
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
format that includes a **type**, a **scope** and a **subject**:
```
():
` of your `index.html`.
> Refer to the input property `baseUrl` below to fix this issue.
### Examples
#### Facebook Style
```html
```

#### List Style
```html
```

#### Bullet list Style
```html
```

## API
### @Inputs
|
================================================
FILE: src/app/app.component.ts
================================================
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {}
================================================
FILE: src/app/app.module.ts
================================================
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { ContentLoaderModule } from '@ngneat/content-loader';
import { AppComponent } from './app.component';
@NgModule({
imports: [BrowserModule.withServerTransition({ appId: 'content-loader' }), ContentLoaderModule],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule {}
================================================
FILE: src/app/app.server.module.ts
================================================
import { NgModule } from '@angular/core';
import { ServerModule } from '@angular/platform-server';
import { AppModule } from './app.module';
import { AppComponent } from './app.component';
@NgModule({
imports: [AppModule, ServerModule],
bootstrap: [AppComponent]
})
export class AppServerModule {}
================================================
FILE: src/assets/.gitkeep
================================================
================================================
FILE: src/environments/environment.prod.ts
================================================
export const environment = {
production: true
};
================================================
FILE: src/environments/environment.ts
================================================
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
export const environment = {
production: false
};
/*
* In development mode, to ignore zone related error stack frames such as
* `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can
* import the following file, but please comment it out in production mode
* because it will have performance impact when throw error
*/
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
================================================
FILE: src/index.html
================================================
Content Loader
================================================
FILE: src/karma.conf.js
================================================
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
});
};
================================================
FILE: src/main.server.ts
================================================
import '@angular/platform-server/init';
import { enableProdMode } from '@angular/core';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
export { AppServerModule } from './app/app.server.module';
export { renderModule } from '@angular/platform-server';
================================================
FILE: src/main.ts
================================================
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch(err => console.error(err));
================================================
FILE: src/polyfills.ts
================================================
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
*
* Learn more in https://angular.io/guide/browser-support
*/
/***************************************************************************************************
* BROWSER POLYFILLS
*/
/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
* because those flags need to be set before `zone.js` being loaded, and webpack
* will put import in the top of bundle, so user need to create a separate file
* in this directory (for example: zone-flags.ts), and put the following flags
* into that file, and then add the following code before importing zone.js.
* import './zone-flags.ts';
*
* The flags allowed in zone-flags.ts are listed here.
*
* The following flags will work for all browsers.
*
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*
* (window as any).__Zone_enable_cross_context_check = true;
*
*/
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js'; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/
================================================
FILE: src/server.ts
================================================
import 'zone.js/dist/zone-node';
import * as express from 'express';
import { join } from 'path';
import { APP_BASE_HREF } from '@angular/common';
import { ngExpressEngine } from '@nguniversal/express-engine';
import { AppServerModule } from './main.server';
export function app(): express.Express {
const server = express();
const distFolder = join(process.cwd(), 'dist/integration/browser');
server.engine(
'html',
ngExpressEngine({
bootstrap: AppServerModule
})
);
server.set('view engine', 'html');
server.set('views', distFolder);
server.get(
'*.*',
express.static(distFolder, {
maxAge: '1y'
})
);
server.get('*', (req, res) => {
res.render('index', { req, providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }] });
});
return server;
}
function run(): void {
const port = process.env.PORT || 4200;
const server = app();
server.listen(port, () => {
console.log(`Node Express server listening on http://localhost:${port}`);
});
}
// Webpack will replace 'require' with '__webpack_require__'
// '__non_webpack_require__' is a proxy to Node 'require'
// The below code is to ensure that the server is run only when not requiring the bundle.
declare const __non_webpack_require__: NodeRequire;
const mainModule = __non_webpack_require__.main;
const moduleFilename = (mainModule && mainModule.filename) || '';
if (moduleFilename === __filename || moduleFilename.includes('iisnode')) {
run();
}
export * from './main.server';
================================================
FILE: src/styles.css
================================================
/* You can add global styles to this file, and also import other style files */
================================================
FILE: src/test.ts
================================================
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'projects/ngneat/content-loader/src/node_modules/zone.js/dist/zone-testing';
import { getTestBed } from 'projects/ngneat/content-loader/src/node_modules/@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from 'projects/ngneat/content-loader/src/node_modules/@angular/platform-browser-dynamic/testing';
declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
================================================
FILE: src/tsconfig.app.json
================================================
{
"extends": "../tsconfig.json",
"compilerOptions": {
"types": []
},
"files": ["main.ts", "polyfills.ts"],
"include": ["**/*.d.ts"]
}
================================================
FILE: src/tsconfig.server.json
================================================
{
"extends": "./tsconfig.app.json",
"compilerOptions": {
"target": "es2019",
"types": ["node"]
},
"files": ["main.server.ts", "server.ts"],
"angularCompilerOptions": {
"entryModule": "./app/app.server.module#AppServerModule"
}
}
================================================
FILE: src/tsconfig.spec.json
================================================
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/spec",
"types": ["jasmine", "node"]
},
"files": ["test.ts", "polyfills.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
}
================================================
FILE: src/tslint.json
================================================
{
"extends": "../tslint.json",
"rules": {
"directive-selector": [true, "attribute", "app", "camelCase"],
"component-selector": [true, "element", "app", "kebab-case"]
}
}
================================================
FILE: tsconfig.json
================================================
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@ngneat/content-loader": ["projects/ngneat/content-loader/src/public_api.ts"]
},
"sourceMap": true,
"declaration": false,
"module": "esnext",
"moduleResolution": "node",
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2015",
"typeRoots": ["node_modules/@types"],
"lib": ["es2018", "dom"]
}
}
================================================
FILE: tslint.json
================================================
{
"rules": {
"ban": [
true,
{ "name": "fit", "message": "The fit is forbidden" },
{ "name": "debugger", "message": "The debugger is forbidden" },
{ "name": "fdescribe", "message": "The fdescribe is forbidden" }
]
}
}