Skip to content

Commit

Permalink
Merge pull request #2 from Talentia-Software-OSS/3.0.x
Browse files Browse the repository at this point in the history
3.0.x
  • Loading branch information
cavone-leonardo authored Nov 17, 2023
2 parents 192451a + cb781af commit 092e68c
Show file tree
Hide file tree
Showing 37 changed files with 20,764 additions and 7,150 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js Build

on:
workflow_call:
workflow_dispatch:
pull_request:
push:
branches: [ "master" ]

permissions:
contents: read
# Needed for the 'trilom/file-changes-action' action
pull-requests: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.11.0]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- name: Check out repo
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: Install dependencies
run: npm ci

- name: Run build
run: npm run build --if-present


48 changes: 48 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This workflow will run tests using node and then publish a package to npm when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Publish

on:
workflow_dispatch:
# release:
# types: [created]

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:
# build:
# uses: ./.github/workflows/build.yml

publish-npm:
# needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.11.0]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Check out repo
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: npm

- name: Install dependencies
run: npm ci

- name: Run build only library
run: npm run build --if-present

- name: Publish package
run: npm publish ./dist/angular2-prettyjson
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

46 changes: 40 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,43 @@
/node_modules
# See http://help.github.com/ignore-files/ for more about ignoring files.

# Compiled output
/dist
/documentation
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log
.npmrc

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

*.log
*.tgz
.vscode
.idea
# System files
.DS_Store
Thumbs.db
15 changes: 0 additions & 15 deletions .npmignore

This file was deleted.

24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

7 changes: 0 additions & 7 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
34 changes: 6 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,21 @@
# Angular 2 Pretty Json v3.0.0
# Angular 2 Pretty Json

A module for Angular 2 debug output of objects. Contains a pipe similar to [JsonPipe](https://angular.io/docs/ts/latest/api/common/index/JsonPipe-class.html) but adds support for spacing and handling of circular structures.
Also contains a component that outputs any object with syntax highlight.
**Warning**: just as the `JsonPipe`, this is an impure pipe and should be used only for debugging purposes.

**Breaking change in 3.0.0** The UMD bundle has moved to a "bundle" subdirectory. SymstemJS users should update their system.config. Should not affect AngularCLI and other webpack projects.

## Install

```
npm install angular2-prettyjson
```

## ES2015 / UMD

Two versions are available: ES2015 modules and UMD. If you are using a project based on the AngularCLI, everything should work from a simple npm install.
If you are using the Angular Quickstart template (or other SystemJS based compilation), please point to the bundle `angular2-prettyjson.umd.min.js` file
e.g. `systemjs.config.js`:

```
map: {
...
// other libraries
'rxjs': 'npm:rxjs',
'angular2-prettyjson': 'npm:angular2-prettyjson'
},
packages: {
...,
'angular2-prettyjson': {
defaultExtension: 'js',
main: './bundles/angular2-prettyjson.umd.min.js'
}
npm install @talentia/angular2-prettyjson
```

## Usage

Import PrettyJsonModule to have access to the component and pipes

```js
import {PrettyJsonModule} from 'angular2-prettyjson';
import {PrettyJsonModule} from '@talentia/angular2-prettyjson';

@NgModule({
declarations: [
Expand Down Expand Up @@ -146,6 +124,6 @@ The `PrettyJsonPipe` stringifies the object and then adds spans around propertie
...
```
outputs
## Thanks
![Pretty json with syntax highlight](https://cloud.githubusercontent.com/assets/487758/15599410/a68103f4-2415-11e6-8c5e-d86c22abd72b.png)
This project is forked from [matiboy/angular2-prettyjson](https://github.com/matiboy/angular2-prettyjson).
1 change: 0 additions & 1 deletion angular-library-starter.ts

This file was deleted.

40 changes: 40 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"@talentia/angular2-prettyjson": {
"projectType": "library",
"root": "projects/angular2-prettyjson",
"sourceRoot": "projects/angular2-prettyjson/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "projects/angular2-prettyjson/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/angular2-prettyjson/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/angular2-prettyjson/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"tsConfig": "projects/angular2-prettyjson/tsconfig.spec.json",
"polyfills": [
"zone.js",
"zone.js/testing"
]
}
}
}
}
}
}
73 changes: 0 additions & 73 deletions build.js

This file was deleted.

Loading

0 comments on commit 092e68c

Please sign in to comment.