@basemaps/shared 6.11.0 → 6.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,41 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [6.18.0](https://github.com/linz/basemaps/compare/v6.17.0...v6.18.0) (2021-12-14)
7
+
8
+ **Note:** Version bump only for package @basemaps/shared
9
+
10
+
11
+
12
+
13
+
14
+ # [6.17.0](https://github.com/linz/basemaps/compare/v6.16.1...v6.17.0) (2021-12-05)
15
+
16
+ **Note:** Version bump only for package @basemaps/shared
17
+
18
+
19
+
20
+
21
+
22
+ ## [6.16.1](https://github.com/linz/basemaps/compare/v6.16.0...v6.16.1) (2021-11-30)
23
+
24
+ **Note:** Version bump only for package @basemaps/shared
25
+
26
+
27
+
28
+
29
+
30
+ # [6.12.0](https://github.com/linz/basemaps/compare/v6.11.0...v6.12.0) (2021-10-05)
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * **server:** use default of local file system for unknown paths ([#1895](https://github.com/linz/basemaps/issues/1895)) ([1d89456](https://github.com/linz/basemaps/commit/1d894561965a6afd1144dd4580e9ec4cf914ce2c))
36
+
37
+
38
+
39
+
40
+
6
41
  # [6.11.0](https://github.com/linz/basemaps/compare/v6.10.1...v6.11.0) (2021-10-03)
7
42
 
8
43
 
@@ -1,27 +1,27 @@
1
- import { statSync, unlinkSync } from 'fs';
1
+ import { promises as fs } from 'fs';
2
2
  import o from 'ospec';
3
3
  import path from 'path';
4
4
  import url from 'url';
5
5
  import { fsa } from '../index.js';
6
6
  const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
7
- function rmF(path) {
7
+ async function rmF(path) {
8
8
  try {
9
- unlinkSync(path);
9
+ await fs.unlink(path);
10
10
  }
11
11
  catch (_err) { }
12
12
  }
13
13
  o.spec('file.local', () => {
14
14
  const jsonFilePath = __dirname + '/testing.json';
15
15
  const jsonFilePathGz = jsonFilePath + '.gz';
16
- o.afterEach(() => {
17
- rmF(jsonFilePathGz);
18
- rmF(jsonFilePath);
16
+ o.afterEach(async () => {
17
+ await Promise.all([rmF(jsonFilePathGz), rmF(jsonFilePath)]);
19
18
  });
20
19
  o('readJson writeJson gzip', async () => {
21
20
  try {
22
21
  await fsa.writeJson(jsonFilePathGz, { json: '1'.repeat(1000) });
23
22
  const ans = await fsa.readJson(jsonFilePathGz);
24
- o(statSync(jsonFilePathGz).size).equals(44);
23
+ const stat = await fs.stat(jsonFilePathGz);
24
+ o(stat.size).equals(44);
25
25
  o(ans).deepEquals({ json: '1'.repeat(1000) });
26
26
  }
27
27
  catch (e) {
@@ -31,7 +31,18 @@ o.spec('file.local', () => {
31
31
  o('readJson writeJson', async () => {
32
32
  await fsa.writeJson(jsonFilePath, { json: '1'.repeat(1000) });
33
33
  const ans = await fsa.readJson(jsonFilePath);
34
- o(statSync(jsonFilePath).size).equals(1016);
34
+ const stat = await fs.stat(jsonFilePath);
35
+ o(stat.size).equals(1016);
35
36
  o(ans).deepEquals({ json: '1'.repeat(1000) });
36
37
  });
38
+ o('should support reading relative paths', async () => {
39
+ try {
40
+ await fs.writeFile('foo.tmp', Buffer.from('hello world'));
41
+ const res = await fsa.read('foo.tmp');
42
+ o(res.toString()).equals('hello world');
43
+ }
44
+ finally {
45
+ await fs.unlink('foo.tmp');
46
+ }
47
+ });
37
48
  });
@@ -34,3 +34,8 @@ fsa.configure = function configure(cfg) {
34
34
  const bucketUri = `s3://${bucket}/`;
35
35
  this.register(bucketUri, FsAwsS3.fromRoleArn(cfg.roleArn, cfg.externalId));
36
36
  };
37
+ /**
38
+ * Default to using the file handler useful for folders like
39
+ * "C:\" or "directory_name/sub_directory"
40
+ */
41
+ fsa.register('', fsa.get('file://'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basemaps/shared",
3
- "version": "6.11.0",
3
+ "version": "6.18.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,7 +23,7 @@
23
23
  "test": "ospec --globs 'build/**/*.test.js'"
24
24
  },
25
25
  "dependencies": {
26
- "@basemaps/config": "^6.10.0",
26
+ "@basemaps/config": "^6.18.0",
27
27
  "@basemaps/geo": "^6.10.0",
28
28
  "@basemaps/tiler": "^6.11.0",
29
29
  "@linzjs/geojson": "^6.10.0",
@@ -31,7 +31,7 @@
31
31
  "@linzjs/s3fs": "^6.9.1",
32
32
  "aws-sdk": "^2.890.0",
33
33
  "base-x": "^3.0.7",
34
- "pino": "^6.2.1",
34
+ "pino": "^7.5.0",
35
35
  "proj4": "^2.6.2",
36
36
  "sax": "^1.2.4",
37
37
  "source-map-support": "^0.5.19",
@@ -40,7 +40,6 @@
40
40
  "devDependencies": {
41
41
  "@types/aws-lambda": "^8.10.75",
42
42
  "@types/geojson": "^7946.0.7",
43
- "@types/pino": "^6.0.0",
44
43
  "@types/proj4": "^2.5.0",
45
44
  "@types/sax": "^1.2.1"
46
45
  },
@@ -50,5 +49,5 @@
50
49
  "files": [
51
50
  "build/"
52
51
  ],
53
- "gitHead": "e15ab34277b74a70a2b37ecf950e58ca6ba8a843"
52
+ "gitHead": "e87458ee8d0572780b9df074b718af0ecd72acc3"
54
53
  }