@atlaspack/fs 2.15.18 → 2.15.20

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
@@ -1,5 +1,28 @@
1
1
  # @atlaspack/fs
2
2
 
3
+ ## 2.15.20
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`f6b3f22`](https://github.com/atlassian-labs/atlaspack/commit/f6b3f2276c7e417580b49c4879563aab51f156b1)]:
8
+ - @atlaspack/feature-flags@2.23.0
9
+ - @atlaspack/types-internal@2.19.1
10
+ - @atlaspack/logger@2.14.17
11
+ - @atlaspack/workers@2.14.25
12
+ - @atlaspack/watcher-watchman-js@2.14.25
13
+
14
+ ## 2.15.19
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [[`ad26146`](https://github.com/atlassian-labs/atlaspack/commit/ad26146f13b4c1cc65d4a0f9c67060b90ef14ff3), [`f1b48e7`](https://github.com/atlassian-labs/atlaspack/commit/f1b48e7a04e005cef0f36a3e692087a9ecdb6f7a), [`7f5841c`](https://github.com/atlassian-labs/atlaspack/commit/7f5841c39df049f9546cccbeea2a7337e0337b45), [`73dd7ba`](https://github.com/atlassian-labs/atlaspack/commit/73dd7baab69456ef2f6e4a0cc7dbb04f407eb148)]:
19
+ - @atlaspack/rust@3.6.0
20
+ - @atlaspack/types-internal@2.19.0
21
+ - @atlaspack/feature-flags@2.22.0
22
+ - @atlaspack/logger@2.14.16
23
+ - @atlaspack/workers@2.14.24
24
+ - @atlaspack/watcher-watchman-js@2.14.24
25
+
3
26
  ## 2.15.18
4
27
 
5
28
  ### Patch Changes
package/lib/MemoryFS.js CHANGED
@@ -26,13 +26,6 @@ function _buildCache() {
26
26
  };
27
27
  return data;
28
28
  }
29
- function _utils() {
30
- const data = require("@atlaspack/utils");
31
- _utils = function () {
32
- return data;
33
- };
34
- return data;
35
- }
36
29
  var _package = _interopRequireDefault(require("../package.json"));
37
30
  function _workers() {
38
31
  const data = _interopRequireDefault(require("@atlaspack/workers"));
@@ -748,7 +741,7 @@ class Directory extends Entry {
748
741
  }
749
742
  }
750
743
  function makeShared(contents) {
751
- if (typeof contents !== 'string' && contents.buffer instanceof _utils().SharedBuffer) {
744
+ if (typeof contents !== 'string' && contents.buffer instanceof SharedArrayBuffer) {
752
745
  return contents;
753
746
  }
754
747
  let contentsBuffer = contents;
@@ -759,7 +752,7 @@ function makeShared(contents) {
759
752
  contentsBuffer = contentsBuffer instanceof Buffer ? contentsBuffer : Buffer.from(contentsBuffer);
760
753
  }
761
754
  let length = Buffer.byteLength(contentsBuffer);
762
- let shared = new (_utils().SharedBuffer)(length);
755
+ let shared = new SharedArrayBuffer(length);
763
756
  let buffer = Buffer.from(shared);
764
757
  if (length > 0) {
765
758
  if (typeof contentsBuffer === 'string') {
package/lib/NodeFS.js CHANGED
@@ -53,13 +53,6 @@ function _buildCache() {
53
53
  };
54
54
  return data;
55
55
  }
56
- function _utils() {
57
- const data = require("@atlaspack/utils");
58
- _utils = function () {
59
- return data;
60
- };
61
- return data;
62
- }
63
56
  function _featureFlags() {
64
57
  const data = require("@atlaspack/feature-flags");
65
58
  _featureFlags = function () {
@@ -133,19 +126,7 @@ class NodeFS {
133
126
  let failed = false;
134
127
  const move = async () => {
135
128
  if (!failed) {
136
- try {
137
- await _gracefulFs().default.promises.rename(tmpFilePath, filePath);
138
- } catch (e) {
139
- // This is adapted from fs-write-stream-atomic. Apparently
140
- // Windows doesn't like renaming when the target already exists.
141
- if (process.platform === 'win32' && e.syscall && e.syscall === 'rename' && e.code && e.code === 'EPERM') {
142
- let [hashTmp, hashTarget] = await Promise.all([(0, _utils().hashFile)(this, tmpFilePath), (0, _utils().hashFile)(this, filePath)]);
143
- await this.unlink(tmpFilePath);
144
- if (hashTmp != hashTarget) {
145
- throw e;
146
- }
147
- }
148
- }
129
+ await _gracefulFs().default.promises.rename(tmpFilePath, filePath);
149
130
  }
150
131
  };
151
132
  let writeStream = _gracefulFs().default.createWriteStream(tmpFilePath, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/fs",
3
- "version": "2.15.18",
3
+ "version": "2.15.20",
4
4
  "description": "Blazing fast, zero configuration web application bundler",
5
5
  "license": "(MIT OR Apache-2.0)",
6
6
  "publishConfig": {
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "main": "./lib/index.js",
14
14
  "source": "./src/index.ts",
15
- "types": "./lib/index.d.ts",
15
+ "types": "./lib/types/index.d.ts",
16
16
  "engines": {
17
17
  "node": ">= 16.0.0"
18
18
  },
@@ -26,7 +26,6 @@
26
26
  "@atlaspack/logger": false,
27
27
  "@atlaspack/rust": false,
28
28
  "@atlaspack/types-internal": false,
29
- "@atlaspack/utils": false,
30
29
  "@atlaspack/watcher-watchman-js": false,
31
30
  "@parcel/watcher": false,
32
31
  "@atlaspack/workers": false
@@ -40,7 +39,6 @@
40
39
  "@atlaspack/logger": false,
41
40
  "@atlaspack/rust": false,
42
41
  "@atlaspack/types-internal": false,
43
- "@atlaspack/utils": false,
44
42
  "@atlaspack/watcher-watchman-js": false,
45
43
  "@parcel/watcher": false,
46
44
  "@atlaspack/workers": false
@@ -48,18 +46,18 @@
48
46
  }
49
47
  },
50
48
  "scripts": {
51
- "check-ts": "tsc --emitDeclarationOnly --rootDir src"
49
+ "check-ts": "tsc --emitDeclarationOnly --rootDir src",
50
+ "build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
52
51
  },
53
52
  "dependencies": {
54
53
  "@atlaspack/build-cache": "2.13.4",
55
- "@atlaspack/feature-flags": "2.21.0",
56
- "@atlaspack/logger": "2.14.15",
57
- "@atlaspack/rust": "3.5.0",
58
- "@atlaspack/types-internal": "2.18.0",
59
- "@atlaspack/utils": "2.18.0",
54
+ "@atlaspack/feature-flags": "2.23.0",
55
+ "@atlaspack/logger": "2.14.17",
56
+ "@atlaspack/rust": "3.6.0",
57
+ "@atlaspack/types-internal": "2.19.1",
60
58
  "@parcel/watcher": "^2.0.7",
61
- "@atlaspack/workers": "2.14.23",
62
- "@atlaspack/watcher-watchman-js": "2.14.23",
59
+ "@atlaspack/workers": "2.14.25",
60
+ "@atlaspack/watcher-watchman-js": "2.14.25",
63
61
  "graceful-fs": "^4.2.4",
64
62
  "ncp": "^2.0.0",
65
63
  "nullthrows": "^1.1.1",
@@ -70,4 +68,4 @@
70
68
  "./src/NodeFS.js": "./src/NodeFS.browser.js"
71
69
  },
72
70
  "type": "commonjs"
73
- }
71
+ }
package/src/MemoryFS.ts CHANGED
@@ -14,7 +14,6 @@ import type {
14
14
  import path from 'path';
15
15
  import {Readable, Writable} from 'stream';
16
16
  import {registerSerializableClass} from '@atlaspack/build-cache';
17
- import {SharedBuffer} from '@atlaspack/utils';
18
17
  import packageJSON from '../package.json';
19
18
  import WorkerFarm, {Handle} from '@atlaspack/workers';
20
19
  import nullthrows from 'nullthrows';
@@ -944,7 +943,10 @@ class Directory extends Entry {
944
943
  }
945
944
 
946
945
  export function makeShared(contents: Buffer | string): Buffer {
947
- if (typeof contents !== 'string' && contents.buffer instanceof SharedBuffer) {
946
+ if (
947
+ typeof contents !== 'string' &&
948
+ contents.buffer instanceof SharedArrayBuffer
949
+ ) {
948
950
  return contents;
949
951
  }
950
952
 
@@ -960,7 +962,7 @@ export function makeShared(contents: Buffer | string): Buffer {
960
962
  }
961
963
 
962
964
  let length = Buffer.byteLength(contentsBuffer);
963
- let shared = new SharedBuffer(length);
965
+ let shared = new SharedArrayBuffer(length);
964
966
  let buffer = Buffer.from(shared);
965
967
  if (length > 0) {
966
968
  if (typeof contentsBuffer === 'string') {
package/src/NodeFS.ts CHANGED
@@ -21,7 +21,6 @@ import path from 'path';
21
21
  import {tmpdir} from 'os';
22
22
  import {promisify} from 'util';
23
23
  import {registerSerializableClass} from '@atlaspack/build-cache';
24
- import {hashFile} from '@atlaspack/utils';
25
24
  import {getFeatureFlag} from '@atlaspack/feature-flags';
26
25
  import watcher from '@parcel/watcher';
27
26
  import packageJSON from '../package.json';
@@ -89,30 +88,7 @@ export class NodeFS implements FileSystem {
89
88
 
90
89
  const move = async () => {
91
90
  if (!failed) {
92
- try {
93
- await fs.promises.rename(tmpFilePath, filePath);
94
- } catch (e: any) {
95
- // This is adapted from fs-write-stream-atomic. Apparently
96
- // Windows doesn't like renaming when the target already exists.
97
- if (
98
- process.platform === 'win32' &&
99
- e.syscall &&
100
- e.syscall === 'rename' &&
101
- e.code &&
102
- e.code === 'EPERM'
103
- ) {
104
- let [hashTmp, hashTarget] = await Promise.all([
105
- hashFile(this, tmpFilePath),
106
- hashFile(this, filePath),
107
- ]);
108
-
109
- await this.unlink(tmpFilePath);
110
-
111
- if (hashTmp != hashTarget) {
112
- throw e;
113
- }
114
- }
115
- }
91
+ await fs.promises.rename(tmpFilePath, filePath);
116
92
  }
117
93
  };
118
94
 
File without changes
File without changes
File without changes
File without changes
File without changes