@atlaspack/transformer-jsonld 2.14.5-canary.17 → 2.14.5-canary.171
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,179 @@
|
|
|
1
1
|
# @atlaspack/transformer-jsonld
|
|
2
2
|
|
|
3
|
+
## 2.14.27
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @atlaspack/plugin@2.14.27
|
|
9
|
+
- @atlaspack/types@2.15.17
|
|
10
|
+
|
|
11
|
+
## 2.14.26
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#742](https://github.com/atlassian-labs/atlaspack/pull/742) [`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd) Thanks [@yamadapc](https://github.com/yamadapc)! - Internal changes and bug fixes to environmentDeduplication flag
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd)]:
|
|
18
|
+
- @atlaspack/plugin@2.14.26
|
|
19
|
+
- @atlaspack/types@2.15.16
|
|
20
|
+
|
|
21
|
+
## 2.14.25
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies []:
|
|
26
|
+
- @atlaspack/plugin@2.14.25
|
|
27
|
+
- @atlaspack/types@2.15.15
|
|
28
|
+
|
|
29
|
+
## 2.14.24
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies []:
|
|
34
|
+
- @atlaspack/plugin@2.14.24
|
|
35
|
+
- @atlaspack/types@2.15.14
|
|
36
|
+
|
|
37
|
+
## 2.14.23
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies []:
|
|
42
|
+
- @atlaspack/types@2.15.13
|
|
43
|
+
- @atlaspack/plugin@2.14.23
|
|
44
|
+
|
|
45
|
+
## 2.14.22
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- [#720](https://github.com/atlassian-labs/atlaspack/pull/720) [`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94) Thanks [@alshdavid](https://github.com/alshdavid)! - Migrate to TypeScript
|
|
50
|
+
|
|
51
|
+
- Updated dependencies [[`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94)]:
|
|
52
|
+
- @atlaspack/plugin@2.14.22
|
|
53
|
+
- @atlaspack/types@2.15.12
|
|
54
|
+
|
|
55
|
+
## 2.14.21
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- Updated dependencies []:
|
|
60
|
+
- @atlaspack/types@2.15.11
|
|
61
|
+
- @atlaspack/plugin@2.14.21
|
|
62
|
+
|
|
63
|
+
## 2.14.20
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- [#702](https://github.com/atlassian-labs/atlaspack/pull/702) [`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa) Thanks [@alshdavid](https://github.com/alshdavid)! - Fixes to Flow types
|
|
68
|
+
|
|
69
|
+
- Updated dependencies [[`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa)]:
|
|
70
|
+
- @atlaspack/plugin@2.14.20
|
|
71
|
+
- @atlaspack/types@2.15.10
|
|
72
|
+
|
|
73
|
+
## 2.14.19
|
|
74
|
+
|
|
75
|
+
### Patch Changes
|
|
76
|
+
|
|
77
|
+
- Updated dependencies []:
|
|
78
|
+
- @atlaspack/types@2.15.9
|
|
79
|
+
- @atlaspack/plugin@2.14.19
|
|
80
|
+
|
|
81
|
+
## 2.14.18
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- Updated dependencies []:
|
|
86
|
+
- @atlaspack/types@2.15.8
|
|
87
|
+
- @atlaspack/plugin@2.14.18
|
|
88
|
+
|
|
89
|
+
## 2.14.17
|
|
90
|
+
|
|
91
|
+
### Patch Changes
|
|
92
|
+
|
|
93
|
+
- Updated dependencies []:
|
|
94
|
+
- @atlaspack/types@2.15.7
|
|
95
|
+
- @atlaspack/plugin@2.14.17
|
|
96
|
+
|
|
97
|
+
## 2.14.16
|
|
98
|
+
|
|
99
|
+
### Patch Changes
|
|
100
|
+
|
|
101
|
+
- Updated dependencies []:
|
|
102
|
+
- @atlaspack/types@2.15.6
|
|
103
|
+
- @atlaspack/plugin@2.14.16
|
|
104
|
+
|
|
105
|
+
## 2.14.15
|
|
106
|
+
|
|
107
|
+
### Patch Changes
|
|
108
|
+
|
|
109
|
+
- Updated dependencies []:
|
|
110
|
+
- @atlaspack/types@2.15.5
|
|
111
|
+
- @atlaspack/plugin@2.14.15
|
|
112
|
+
|
|
113
|
+
## 2.14.14
|
|
114
|
+
|
|
115
|
+
### Patch Changes
|
|
116
|
+
|
|
117
|
+
- Updated dependencies []:
|
|
118
|
+
- @atlaspack/types@2.15.4
|
|
119
|
+
- @atlaspack/plugin@2.14.14
|
|
120
|
+
|
|
121
|
+
## 2.14.13
|
|
122
|
+
|
|
123
|
+
### Patch Changes
|
|
124
|
+
|
|
125
|
+
- Updated dependencies []:
|
|
126
|
+
- @atlaspack/types@2.15.3
|
|
127
|
+
- @atlaspack/plugin@2.14.13
|
|
128
|
+
|
|
129
|
+
## 2.14.12
|
|
130
|
+
|
|
131
|
+
### Patch Changes
|
|
132
|
+
|
|
133
|
+
- Updated dependencies []:
|
|
134
|
+
- @atlaspack/types@2.15.2
|
|
135
|
+
- @atlaspack/plugin@2.14.12
|
|
136
|
+
|
|
137
|
+
## 2.14.11
|
|
138
|
+
|
|
139
|
+
### Patch Changes
|
|
140
|
+
|
|
141
|
+
- Updated dependencies []:
|
|
142
|
+
- @atlaspack/types@2.15.1
|
|
143
|
+
- @atlaspack/plugin@2.14.11
|
|
144
|
+
|
|
145
|
+
## 2.14.10
|
|
146
|
+
|
|
147
|
+
### Patch Changes
|
|
148
|
+
|
|
149
|
+
- Updated dependencies [[`51aba5f`](https://github.com/atlassian-labs/atlaspack/commit/51aba5fc0e49235ee06bbc3c376f48c3e7da5c4b), [`1e32d4e`](https://github.com/atlassian-labs/atlaspack/commit/1e32d4eae6b3af3968e8a0ef97d35b4347fd4196)]:
|
|
150
|
+
- @atlaspack/types@2.15.0
|
|
151
|
+
- @atlaspack/plugin@2.14.10
|
|
152
|
+
|
|
153
|
+
## 2.14.9
|
|
154
|
+
|
|
155
|
+
### Patch Changes
|
|
156
|
+
|
|
157
|
+
- Updated dependencies []:
|
|
158
|
+
- @atlaspack/types@2.14.9
|
|
159
|
+
- @atlaspack/plugin@2.14.9
|
|
160
|
+
|
|
161
|
+
## 2.14.8
|
|
162
|
+
|
|
163
|
+
### Patch Changes
|
|
164
|
+
|
|
165
|
+
- Updated dependencies []:
|
|
166
|
+
- @atlaspack/types@2.14.8
|
|
167
|
+
- @atlaspack/plugin@2.14.8
|
|
168
|
+
|
|
169
|
+
## 2.14.7
|
|
170
|
+
|
|
171
|
+
### Patch Changes
|
|
172
|
+
|
|
173
|
+
- Updated dependencies []:
|
|
174
|
+
- @atlaspack/types@2.14.7
|
|
175
|
+
- @atlaspack/plugin@2.14.7
|
|
176
|
+
|
|
3
177
|
## 2.14.6
|
|
4
178
|
|
|
5
179
|
### Patch Changes
|
package/lib/JSONLDTransformer.js
CHANGED
|
@@ -38,7 +38,7 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
38
38
|
asset.setCode(JSON.stringify(jsonCode));
|
|
39
39
|
return [asset];
|
|
40
40
|
}
|
|
41
|
-
});
|
|
41
|
+
}); // @ts-expect-error TS2304
|
|
42
42
|
function extractUrlsFrom(data, asset) {
|
|
43
43
|
if (!data) return null;
|
|
44
44
|
if (typeof data === 'string') {
|
|
@@ -48,6 +48,8 @@ function extractUrlsFrom(data, asset) {
|
|
|
48
48
|
if (Array.isArray(data)) return iterateThroughArray(data, asset);
|
|
49
49
|
return iterateThroughObject(data, asset);
|
|
50
50
|
}
|
|
51
|
+
|
|
52
|
+
// @ts-expect-error TS2304
|
|
51
53
|
function iterateThroughObject(jsonObject, asset) {
|
|
52
54
|
Object.keys(jsonObject).filter(k => SCHEMA_ATTRS.includes(k)).forEach(k => {
|
|
53
55
|
let value = jsonObject[k];
|
|
@@ -55,6 +57,8 @@ function iterateThroughObject(jsonObject, asset) {
|
|
|
55
57
|
});
|
|
56
58
|
return jsonObject;
|
|
57
59
|
}
|
|
60
|
+
|
|
61
|
+
// @ts-expect-error TS2304
|
|
58
62
|
function iterateThroughArray(jsonArray, asset) {
|
|
59
63
|
Object.keys(jsonArray).forEach(i => {
|
|
60
64
|
let value = jsonArray[i];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/transformer-jsonld",
|
|
3
|
-
"version": "2.14.5-canary.
|
|
3
|
+
"version": "2.14.5-canary.171+f0349a6b9",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -9,19 +9,22 @@
|
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/atlassian-labs/atlaspack.git"
|
|
11
11
|
},
|
|
12
|
-
"main": "lib/JSONLDTransformer.js",
|
|
13
|
-
"source": "src/JSONLDTransformer.
|
|
12
|
+
"main": "./lib/JSONLDTransformer.js",
|
|
13
|
+
"source": "./src/JSONLDTransformer.ts",
|
|
14
|
+
"types": "./lib/types/JSONLDTransformer.d.ts",
|
|
14
15
|
"engines": {
|
|
15
16
|
"node": ">= 16.0.0"
|
|
16
17
|
},
|
|
17
18
|
"scripts": {
|
|
18
|
-
"test": "yarn workspace @atlaspack/integration-tests test -g jsonld"
|
|
19
|
+
"test": "yarn workspace @atlaspack/integration-tests test -g jsonld",
|
|
20
|
+
"check-ts": "tsc --emitDeclarationOnly --rootDir src",
|
|
21
|
+
"build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
|
|
19
22
|
},
|
|
20
23
|
"dependencies": {
|
|
21
|
-
"@atlaspack/plugin": "2.14.5-canary.
|
|
22
|
-
"@atlaspack/types": "2.14.5-canary.
|
|
24
|
+
"@atlaspack/plugin": "2.14.5-canary.171+f0349a6b9",
|
|
25
|
+
"@atlaspack/types": "2.14.5-canary.171+f0349a6b9",
|
|
23
26
|
"json5": "^2.2.0"
|
|
24
27
|
},
|
|
25
28
|
"type": "commonjs",
|
|
26
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "f0349a6b9b04755088f121095ca6301a2ada3767"
|
|
27
30
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// @flow
|
|
2
|
-
|
|
3
1
|
import {Transformer} from '@atlaspack/plugin';
|
|
4
2
|
import json5 from 'json5';
|
|
5
3
|
|
|
@@ -20,7 +18,7 @@ const SCHEMA_ATTRS = [
|
|
|
20
18
|
'url',
|
|
21
19
|
];
|
|
22
20
|
|
|
23
|
-
export default
|
|
21
|
+
export default new Transformer({
|
|
24
22
|
async transform({asset}) {
|
|
25
23
|
let rawCode = await asset.getCode();
|
|
26
24
|
// allowing any recieved jsonld to be in json5 format
|
|
@@ -34,9 +32,10 @@ export default (new Transformer({
|
|
|
34
32
|
asset.setCode(JSON.stringify(jsonCode));
|
|
35
33
|
return [asset];
|
|
36
34
|
},
|
|
37
|
-
})
|
|
35
|
+
}) as Transformer<unknown>;
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
// @ts-expect-error TS2304
|
|
38
|
+
function extractUrlsFrom(data: any, asset: MutableAsset) {
|
|
40
39
|
if (!data) return null;
|
|
41
40
|
|
|
42
41
|
if (typeof data === 'string') {
|
|
@@ -49,7 +48,8 @@ function extractUrlsFrom(data, asset) {
|
|
|
49
48
|
return iterateThroughObject(data, asset);
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
// @ts-expect-error TS2304
|
|
52
|
+
function iterateThroughObject(jsonObject: any, asset: MutableAsset) {
|
|
53
53
|
Object.keys(jsonObject)
|
|
54
54
|
.filter((k) => SCHEMA_ATTRS.includes(k))
|
|
55
55
|
.forEach((k) => {
|
|
@@ -60,7 +60,8 @@ function iterateThroughObject(jsonObject, asset) {
|
|
|
60
60
|
return jsonObject;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
// @ts-expect-error TS2304
|
|
64
|
+
function iterateThroughArray(jsonArray: any, asset: MutableAsset) {
|
|
64
65
|
Object.keys(jsonArray).forEach((i) => {
|
|
65
66
|
let value = jsonArray[i];
|
|
66
67
|
jsonArray[i] = extractUrlsFrom(value, asset);
|
package/tsconfig.json
ADDED