Skip to content

Commit 039bae5

Browse files
committed
working locally
1 parent 385d8ee commit 039bae5

14 files changed

+17150
-91
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
on:
2+
pull_request:
3+
types: [ closed ]
4+
5+
name: Build Angular
6+
jobs:
7+
build:
8+
if: github.event.pull_request.merged == true
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node-version: [lts/*]
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
17+
- name: Node ${{ matrix.node-version }}
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
- name: npm install and npm run build
22+
run: |
23+
npm i --save-dev @angular/core
24+
npm i --save-dev @angular/cli
25+
npm i --save-dev ng-packagr
26+
npm i --save-dev @angular-devkit/build-angular
27+
npm i
28+
npm run build:prod
29+
cd dist
30+
mv ../.npmrc ngx-leaflet-loading
31+
tar -czf release.tgz ngx-leaflet-loading/
32+
cd ngx-leaflet-loading
33+
npm publish --access public
34+
env:
35+
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
36+
- name: Push Build to Releases
37+
uses: ncipollo/release-action@v1
38+
with:
39+
artifacts: "dist/release.tgz"
40+
token: ${{ secrets.GITHUB_TOKEN }}
41+
tag: "1.0.4"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ typings/
8080

8181
# Nuxt.js build / generate output
8282
.nuxt
83-
dist
83+
dist/
8484

8585
# Gatsby files
8686
.cache/
@@ -104,3 +104,4 @@ dist
104104
.tern-port
105105

106106
.DS_Store
107+
.angular

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//registry.npmjs.org/:_authToken=${NPM_TOKEN}

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Install using npm:
1818
npm install @runette/ngx-leaflet-loading
1919
```
2020

21+
Note that from version 1.0.4, this library is built using a partial Ivy compilation and should work with any version of Angular.io after version 12.0.0
2122
# Usage
2223

2324
This library needs to be imported into the application module:
@@ -64,7 +65,7 @@ import { Map } from 'leaflet';
6465
6566
6667
export class OsmMapComponent implements OnInit, OnDestroy {
67-
public map: Map;
68+
public map?: Map;
6869
public loadingOptions={
6970
position: 'topleft',
7071
}
@@ -105,3 +106,20 @@ Use `ViewChild` to access the component, for instance
105106
The actual instance of the control can then be accessed directly as `this.loadingComponent.loading`
106107

107108
For more details and worked examples, see : [Article](https://medium.com/runic-software/advanced-interactive-maps-in-angular-with-leaflet-68baafa03f72)
109+
110+
# Contributions
111+
112+
Contributions to this repository are very welcome.
113+
114+
Please fork the repository and create a new branch for your changes. The branch can be built locally using
115+
116+
```
117+
ng build ngx-leaflet-loading
118+
```
119+
120+
in the root folder of the repo. This creates an npm package in a folder called `dist`. This can loaded in a test app using `npm install` and the FQ path to the dist folder.
121+
122+
When your changes are complete create a Pull Requet against the master. It is IMPORTANT that you change the version number in `package.json` AND the tag number in `.github/workflowds/build.yaml` to the next version before the PR.
123+
124+
When I have accepted and merged the PR, Github actions will automatically build the new package release and loaded it both as a GH release using the version as the tag name and publish the new version on npm.
125+

angular.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"ngx-leaflet-loading": {
7+
"projectType": "library",
8+
"root": "",
9+
"sourceRoot": "/src",
10+
"prefix": "lib",
11+
"architect": {
12+
"build": {
13+
"builder": "@angular-devkit/build-angular:ng-packagr",
14+
"options": {
15+
"project": "ng-package.json"
16+
},
17+
"configurations": {
18+
"production": {
19+
"tsConfig": "tsconfig.lib.prod.json"
20+
},
21+
"development": {
22+
"tsConfig": "ptsconfig.lib.json"
23+
}
24+
},
25+
"defaultConfiguration": "production"
26+
},
27+
"test": {
28+
"builder": "@angular-devkit/build-angular:karma",
29+
"options": {
30+
"main": "src/test.ts",
31+
"tsConfig": "tsconfig.spec.json",
32+
"karmaConfig": "karma.conf.js"
33+
}
34+
}
35+
}
36+
}
37+
}
38+
}

ng-package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
2-
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3-
"dest": "../../dist/ngx-loading-control",
2+
"$schema": "node_modules/ng-packagr/ng-package.schema.json",
3+
"dest": "dist/ngx-leaflet-loading",
44
"lib": {
55
"entryFile": "src/public-api.ts"
66
},
7-
"whitelistedNonPeerDependencies": [
7+
"allowedNonPeerDependencies":[
8+
"@types/leaflet-loading",
89
"leaflet-loading"
910
]
1011
}

ngx-loading-control.component.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)