diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml new file mode 100644 index 0000000..2322e2a --- /dev/null +++ b/.github/workflows/release-package.yml @@ -0,0 +1,31 @@ +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: npm ci + - run: npm test + + # Important note: + # This only works in github actions when you've added an "automation token" by the name of "NPM_TOKEN" to "repository secrets" + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://registry.npmjs.org + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/README.md b/README.md index 08adf22..9dd9ee6 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ You can use these as building blocks for your own web application that wants to ## Installation -1. Install from [Github](https://github.com/SDFIdk/saul) (latest): +1. Install iva NPM: ``` -npm install --save git@github.com:SDFIdk/saul.git +npm i --save @dataforsyningen/saul ``` 2. Create a configuration file or Javascript object with proper values and make sure to load it into your application before using any of the SAUL utilities. This package ships with an example configuration file at `/example/config.js.example` @@ -18,7 +18,7 @@ npm install --save git@github.com:SDFIdk/saul.git This is an example of how to import and use those utilities in Javascript: ``` import auth from './config.js' // This is the path to your configuration file -import {getSTAC} from 'skraafoto-saul' +import {getSTAC} from '@dataforsyningen/saul' let response = await getSTAC('/some-stac-endpoint', auth) console.log(response) @@ -34,7 +34,7 @@ A `docs` directory will be created with a bunch of HTML files containing the doc ## How to test -From within `node_modules/saul` you can run the `test` command to check that saul core features are still working. +From within `node_modules/@dataforsyningen/saul` you can run the `test` command to check that saul core features are still working. ``` npm run test ``` diff --git a/package-lock.json b/package-lock.json index b290f93..28cd40c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "skraafoto-saul", - "version": "2.1.0", + "name": "@dataforsyningen/saul", + "version": "3.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "skraafoto-saul", - "version": "2.1.0", + "name": "@dataforsyningen/saul", + "version": "3.0.0", "license": "MIT", "dependencies": { "proj4": "^2.8.0" @@ -16,9 +16,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.0.tgz", - "integrity": "sha512-74bEXKX2h+8rrfQUfsBfuZZHzsEs6Eql4pqy/T4Nn6Y9wNPggQOqD6z6pn5Bl8ZfysKouFZT/UXEH94ummEeQw==", + "version": "7.19.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.4.tgz", + "integrity": "sha512-qpVT7gtuOLjWeDTKLkJ6sryqLliBaFpAtGeqw5cs5giLldvh+Ch0plqnUMKoVAUS6ZEueQQiZV+p5pxtPitEsA==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -186,9 +186,9 @@ } }, "node_modules/marked": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.1.0.tgz", - "integrity": "sha512-+Z6KDjSPa6/723PQYyc1axYZpYYpDnECDaU6hkaf5gqBieBkMKYReL5hteF2QizhlMbgbo8umXl/clZ67+GlsA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.1.1.tgz", + "integrity": "sha512-0cNMnTcUJPxbA6uWmCmjWz4NJRe/0Xfk2NhXCUHjew9qJzFN20krFnsUe7QynwqOwa5m1fZ4UDg0ycKFVC0ccw==", "dev": true, "bin": { "marked": "bin/marked.js" @@ -263,9 +263,9 @@ "dev": true }, "node_modules/underscore": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.4.tgz", - "integrity": "sha512-BQFnUDuAQ4Yf/cYY5LNrK9NCJFKriaRbD9uR1fTeXnBeoa97W0i41qkZfGO9pSo8I5KzjAcSY2XYtdf0oKd7KQ==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", + "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==", "dev": true }, "node_modules/wkt-parser": { @@ -282,9 +282,9 @@ }, "dependencies": { "@babel/parser": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.0.tgz", - "integrity": "sha512-74bEXKX2h+8rrfQUfsBfuZZHzsEs6Eql4pqy/T4Nn6Y9wNPggQOqD6z6pn5Bl8ZfysKouFZT/UXEH94ummEeQw==", + "version": "7.19.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.19.4.tgz", + "integrity": "sha512-qpVT7gtuOLjWeDTKLkJ6sryqLliBaFpAtGeqw5cs5giLldvh+Ch0plqnUMKoVAUS6ZEueQQiZV+p5pxtPitEsA==", "dev": true }, "@types/linkify-it": { @@ -425,9 +425,9 @@ "requires": {} }, "marked": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.1.0.tgz", - "integrity": "sha512-+Z6KDjSPa6/723PQYyc1axYZpYYpDnECDaU6hkaf5gqBieBkMKYReL5hteF2QizhlMbgbo8umXl/clZ67+GlsA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.1.1.tgz", + "integrity": "sha512-0cNMnTcUJPxbA6uWmCmjWz4NJRe/0Xfk2NhXCUHjew9qJzFN20krFnsUe7QynwqOwa5m1fZ4UDg0ycKFVC0ccw==", "dev": true }, "mdurl": { @@ -484,9 +484,9 @@ "dev": true }, "underscore": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.4.tgz", - "integrity": "sha512-BQFnUDuAQ4Yf/cYY5LNrK9NCJFKriaRbD9uR1fTeXnBeoa97W0i41qkZfGO9pSo8I5KzjAcSY2XYtdf0oKd7KQ==", + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", + "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==", "dev": true }, "wkt-parser": { diff --git a/package.json b/package.json index ed2fd18..7037108 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "skraafoto-saul", - "version": "2.1.0", + "name": "@dataforsyningen/saul", + "version": "3.0.0", "description": "This is a collection of stand-alone methods for photogrammetry calculations and API interactions for 'Danske SkrÄfotos'.", "main": "index.js", "type": "module",