@langri-sha/projen-lint-synthesized 0.2.5 → 0.4.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.json CHANGED
@@ -2,7 +2,127 @@
2
2
  "name": "@langri-sha/projen-lint-synthesized",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 21 May 2024 05:21:31 GMT",
5
+ "date": "Mon, 08 Jul 2024 21:40:45 GMT",
6
+ "version": "0.4.0",
7
+ "tag": "@langri-sha/projen-lint-synthesized_v0.4.0",
8
+ "comments": {
9
+ "none": [
10
+ {
11
+ "author": "filip.dupanovic@gmail.com",
12
+ "package": "@langri-sha/projen-lint-synthesized",
13
+ "commit": "94472e1a79e065f4ef9c4e668453e9266b428281",
14
+ "comment": "feat(tsconfig): Use `${configDir}`"
15
+ },
16
+ {
17
+ "author": "filip.dupanovic@gmail.com",
18
+ "package": "@langri-sha/projen-lint-synthesized",
19
+ "commit": "94472e1a79e065f4ef9c4e668453e9266b428281",
20
+ "comment": "feat(workspace): Add repository path"
21
+ }
22
+ ],
23
+ "minor": [
24
+ {
25
+ "author": "filip.dupanovic@gmail.com",
26
+ "package": "@langri-sha/projen-lint-synthesized",
27
+ "commit": "94472e1a79e065f4ef9c4e668453e9266b428281",
28
+ "comment": "feat(workspace): Use `vitest`"
29
+ }
30
+ ],
31
+ "patch": [
32
+ {
33
+ "author": "filip.dupanovic@gmail.com",
34
+ "package": "@langri-sha/projen-lint-synthesized",
35
+ "commit": "94472e1a79e065f4ef9c4e668453e9266b428281",
36
+ "comment": "fix(projen): Use correct output directory"
37
+ },
38
+ {
39
+ "author": "email not defined",
40
+ "package": "@langri-sha/projen-lint-synthesized",
41
+ "commit": "94472e1a79e065f4ef9c4e668453e9266b428281",
42
+ "comment": "chore(deps): fix(deps): update dependency minimatch to v9.0.5"
43
+ }
44
+ ]
45
+ }
46
+ },
47
+ {
48
+ "date": "Sat, 15 Jun 2024 09:09:05 GMT",
49
+ "version": "0.3.0",
50
+ "tag": "@langri-sha/projen-lint-synthesized_v0.3.0",
51
+ "comments": {
52
+ "minor": [
53
+ {
54
+ "author": "filip.dupanovic@gmail.com",
55
+ "package": "@langri-sha/projen-lint-synthesized",
56
+ "commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
57
+ "comment": "feat(projen): Reconfigure project expressions"
58
+ },
59
+ {
60
+ "author": "filip.dupanovic@gmail.com",
61
+ "package": "@langri-sha/projen-lint-synthesized",
62
+ "commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
63
+ "comment": "feat(lint-synthesized): Manage package with projen"
64
+ },
65
+ {
66
+ "author": "filip.dupanovic@gmail.com",
67
+ "package": "@langri-sha/projen-lint-synthesized",
68
+ "commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
69
+ "comment": "feat(project): Omit Node.js engine package defaults"
70
+ },
71
+ {
72
+ "author": "filip.dupanovic@gmail.com",
73
+ "package": "@langri-sha/projen-lint-synthesized",
74
+ "commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
75
+ "comment": "feat(lint-synthesized): Simplify finding projects"
76
+ },
77
+ {
78
+ "author": "filip.dupanovic@gmail.com",
79
+ "package": "@langri-sha/projen-lint-synthesized",
80
+ "commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
81
+ "comment": "feat(lint-synthesized): Run on all projects"
82
+ }
83
+ ],
84
+ "patch": [
85
+ {
86
+ "author": "email not defined",
87
+ "package": "@langri-sha/projen-lint-synthesized",
88
+ "commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
89
+ "comment": "chore(deps): chore(deps): update dependency projen to v0.82.4"
90
+ },
91
+ {
92
+ "author": "email not defined",
93
+ "package": "@langri-sha/projen-lint-synthesized",
94
+ "commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
95
+ "comment": "chore(deps): fix(deps): update dependency debug to v4.3.5"
96
+ },
97
+ {
98
+ "author": "email not defined",
99
+ "package": "@langri-sha/projen-lint-synthesized",
100
+ "commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
101
+ "comment": "chore(deps): chore(deps): update dependency prettier to v3.3.2"
102
+ },
103
+ {
104
+ "author": "email not defined",
105
+ "package": "@langri-sha/projen-lint-synthesized",
106
+ "commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
107
+ "comment": "chore(deps): chore(deps): update dependency projen to v0.82.3"
108
+ },
109
+ {
110
+ "author": "email not defined",
111
+ "package": "@langri-sha/projen-lint-synthesized",
112
+ "commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
113
+ "comment": "chore(deps): chore(deps): update dependency prettier to v3.3.0"
114
+ },
115
+ {
116
+ "author": "email not defined",
117
+ "package": "@langri-sha/projen-lint-synthesized",
118
+ "commit": "7ac78ea2d172ae9e30f23d213752297fb8436a88",
119
+ "comment": "chore(deps): chore(deps): update dependency prettier to v3.3.1"
120
+ }
121
+ ]
122
+ }
123
+ },
124
+ {
125
+ "date": "Tue, 21 May 2024 05:22:50 GMT",
6
126
  "version": "0.2.5",
7
127
  "tag": "@langri-sha/projen-lint-synthesized_v0.2.5",
8
128
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,46 @@
1
1
  # Change Log - @langri-sha/projen-lint-synthesized
2
2
 
3
- This log was last generated on Tue, 21 May 2024 05:21:31 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 08 Jul 2024 21:40:45 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.4.0
8
+
9
+ Mon, 08 Jul 2024 21:40:45 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - feat(workspace): Use `vitest` (filip.dupanovic@gmail.com)
14
+
15
+ ### Patches
16
+
17
+ - fix(projen): Use correct output directory (filip.dupanovic@gmail.com)
18
+ - chore(deps): fix(deps): update dependency minimatch to v9.0.5 (email not defined)
19
+
20
+ ## 0.3.0
21
+
22
+ Sat, 15 Jun 2024 09:09:05 GMT
23
+
24
+ ### Minor changes
25
+
26
+ - feat(projen): Reconfigure project expressions (filip.dupanovic@gmail.com)
27
+ - feat(lint-synthesized): Manage package with projen (filip.dupanovic@gmail.com)
28
+ - feat(project): Omit Node.js engine package defaults (filip.dupanovic@gmail.com)
29
+ - feat(lint-synthesized): Simplify finding projects (filip.dupanovic@gmail.com)
30
+ - feat(lint-synthesized): Run on all projects (filip.dupanovic@gmail.com)
31
+
32
+ ### Patches
33
+
34
+ - chore(deps): chore(deps): update dependency projen to v0.82.4 (email not defined)
35
+ - chore(deps): fix(deps): update dependency debug to v4.3.5 (email not defined)
36
+ - chore(deps): chore(deps): update dependency prettier to v3.3.2 (email not defined)
37
+ - chore(deps): chore(deps): update dependency projen to v0.82.3 (email not defined)
38
+ - chore(deps): chore(deps): update dependency prettier to v3.3.0 (email not defined)
39
+ - chore(deps): chore(deps): update dependency prettier to v3.3.1 (email not defined)
40
+
7
41
  ## 0.2.5
8
42
 
9
- Tue, 21 May 2024 05:21:31 GMT
43
+ Tue, 21 May 2024 05:22:50 GMT
10
44
 
11
45
  ### Patches
12
46
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAUlC,MAAM,WAAW,sBAAsB;IACrC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,CAAA;CAC1D;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,SAAS;;gBAI1C,KAAK,EAAE,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,EACjD,OAAO,CAAC,EAAE,sBAAsB;IASzB,cAAc,IAAI,IAAI;CAsEhC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAW,MAAM,QAAQ,CAAA;AAW3C,MAAM,WAAW,sBAAsB;IACrC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,CAAA;CAC1D;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,SAAS;;gBAI1C,KAAK,EAAE,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,EACjD,OAAO,CAAC,EAAE,sBAAsB;IASzB,cAAc,IAAI,IAAI;CA4DhC"}
@@ -10,7 +10,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
12
  var _LintSynthesized_instances, _LintSynthesized_options, _LintSynthesized_run;
13
- import { Component } from 'projen';
13
+ import { Component, Project } from 'projen';
14
+ import * as path from 'node:path';
14
15
  import createDebug from 'debug';
15
16
  import * as fs from 'node:fs';
16
17
  import { execaSync } from 'execa';
@@ -30,29 +31,22 @@ export class LintSynthesized extends Component {
30
31
  postSynthesize() {
31
32
  super.postSynthesize();
32
33
  debug('Commencing lints on synthesized files');
33
- const fileInfo = Object.fromEntries(this.project.files
34
- .filter((file) => fs.existsSync(file.absolutePath))
35
- .map((file) => [
36
- file.path,
37
- {
38
- file,
39
- absolutePath: file.absolutePath,
40
- mode: fs.statSync(file.absolutePath).mode,
41
- },
42
- ]));
34
+ const fileInfo = getAllFiles(this.project);
43
35
  const paths = Object.keys(fileInfo);
44
36
  debug(`Found ${paths.length} synthesized files`);
45
37
  const tasks = Object.entries(__classPrivateFieldGet(this, _LintSynthesized_options, "f") || {})
46
38
  .map(([pattern, command]) => ({
47
39
  pattern,
48
40
  command,
49
- files: minimatch.match(paths, pattern, { dot: true }),
41
+ files: minimatch.match(paths, pattern, {
42
+ dot: true,
43
+ matchBase: !pattern.includes('/'),
44
+ }),
50
45
  }))
51
46
  .filter(({ files }) => files.length);
52
47
  for (const { files } of tasks) {
53
48
  for (const file of files) {
54
- const { absolutePath } = fileInfo[file];
55
- fs.chmodSync(absolutePath, 0o755);
49
+ fs.chmodSync(fileInfo[file].absolutePath, 0o755);
56
50
  }
57
51
  }
58
52
  for (const { pattern, command, files } of tasks) {
@@ -83,4 +77,27 @@ _LintSynthesized_options = new WeakMap(), _LintSynthesized_instances = new WeakS
83
77
  cwd: this.project.outdir,
84
78
  });
85
79
  };
80
+ const getAllFiles = (root) => {
81
+ const projects = getProjects(root);
82
+ const files = [];
83
+ for (const project of projects) {
84
+ const current = project.files
85
+ .filter((file) => fs.existsSync(file.absolutePath))
86
+ .map((file) => [
87
+ path.relative(root.outdir, file.absolutePath),
88
+ {
89
+ file,
90
+ absolutePath: file.absolutePath,
91
+ mode: fs.statSync(file.absolutePath).mode,
92
+ },
93
+ ]);
94
+ files.push(...current);
95
+ }
96
+ return Object.fromEntries(files);
97
+ };
98
+ const getProjects = (root) => {
99
+ return root.node
100
+ .findAll(0)
101
+ .filter((node) => node instanceof Project);
102
+ };
86
103
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAC3C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,WAAW,MAAM,OAAO,CAAA;AAE/B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,MAAM,KAAK,GAAG,WAAW,CAAC,yBAAyB,CAAC,CAAA;AAMpD;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAG5C,YACE,KAAiD,EACjD,OAAgC;QAEhC,KAAK,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAA;;QAN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AAC,IAAI,EAAE,EAAE,CACP;YACE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC;YAC7C;gBACE,IAAI;gBACJ,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI;aAC1C;SACO,CACb,CAAA;QAEH,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAA;IACxB,CAAC;IAED,OAAO,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;AAClC,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,CAAC,IAAa,EAAa,EAAE;IAC/C,OAAO,IAAI,CAAC,IAAI;SACb,OAAO,CAAC,CAAC,CAAC;SACV,MAAM,CAAC,CAAC,IAAI,EAAmB,EAAE,CAAC,IAAI,YAAY,OAAO,CAAC,CAAA;AAC/D,CAAC,CAAA"}
package/license CHANGED
@@ -1,20 +1,10 @@
1
+
1
2
  MIT License
2
3
 
3
4
  Copyright (c) 2024 Filip Dupanović <filip.dupanovic@gmail.com> (https://langri-sha.com)
4
5
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of
6
- this software and associated documentation files (the "Software"), to deal in
7
- the Software without restriction, including without limitation the rights to
8
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
- the Software, and to permit persons to whom the Software is furnished to do so,
10
- subject to the following conditions:
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
11
7
 
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
8
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14
9
 
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/package.json CHANGED
@@ -1,30 +1,43 @@
1
1
  {
2
2
  "name": "@langri-sha/projen-lint-synthesized",
3
- "version": "0.2.5",
3
+ "version": "0.4.0",
4
+ "bugs": {
5
+ "url": "https://github.com/langri-sha/langri-sha.com/issues"
6
+ },
7
+ "repository": {
8
+ "url": "git+https://github.com/langri-sha/langri-sha.com.git",
9
+ "path": "/packages/projen-lint-synthesized"
10
+ },
4
11
  "license": "MIT",
12
+ "author": {
13
+ "name": "Filip Dupanović",
14
+ "email": "filip.dupanovic@gmail.com",
15
+ "url": "https://langri-sha.com",
16
+ "organization": false
17
+ },
5
18
  "type": "module",
6
- "main": "lib/index.js",
19
+ "main": "dist/index.js",
7
20
  "scripts": {
8
- "prepublishOnly": "rm -rf lib; tsc --project tsconfig.build.json"
21
+ "prepublishOnly": "rm -rf dist; tsc --project tsconfig.build.json"
9
22
  },
10
23
  "dependencies": {
11
- "debug": "4.3.4",
24
+ "debug": "4.3.5",
12
25
  "execa": "8.0.1",
13
- "minimatch": "9.0.4"
26
+ "minimatch": "9.0.5"
14
27
  },
15
28
  "devDependencies": {
16
- "@langri-sha/jest-test": "0.7.1",
17
- "@langri-sha/tsconfig": "0.9.0",
29
+ "@langri-sha/tsconfig": "0.10.0",
30
+ "@langri-sha/vitest": "0.1.0",
18
31
  "@types/debug": "4.1.12",
19
- "prettier": "3.2.5",
20
- "projen": "0.81.15"
32
+ "prettier": "3.3.2",
33
+ "projen": "0.82.4"
21
34
  },
22
35
  "peerDependencies": {
23
- "projen": "^0.81.1",
24
- "typescript": "^5.0.0"
36
+ "projen": "^0.82.0"
25
37
  },
26
38
  "publishConfig": {
27
39
  "access": "public"
28
40
  },
29
- "types": "lib/index.d.ts"
41
+ "//": "~~ Generated by projen. To modify, edit .projenrc.mts and run \"npx projen\".",
42
+ "types": "dist/index.d.ts"
30
43
  }
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { Component } from 'projen'
1
+ import { Component, Project } from 'projen'
2
+ import * as path from 'node:path'
2
3
  import createDebug from 'debug'
3
4
 
4
5
  import * as fs from 'node:fs'
@@ -34,18 +35,7 @@ export class LintSynthesized extends Component {
34
35
 
35
36
  debug('Commencing lints on synthesized files')
36
37
 
37
- const fileInfo = Object.fromEntries(
38
- this.project.files
39
- .filter((file) => fs.existsSync(file.absolutePath))
40
- .map((file) => [
41
- file.path,
42
- {
43
- file,
44
- absolutePath: file.absolutePath,
45
- mode: fs.statSync(file.absolutePath).mode,
46
- },
47
- ]),
48
- )
38
+ const fileInfo = getAllFiles(this.project)
49
39
  const paths = Object.keys(fileInfo)
50
40
 
51
41
  debug(`Found ${paths.length} synthesized files`)
@@ -54,15 +44,16 @@ export class LintSynthesized extends Component {
54
44
  .map(([pattern, command]) => ({
55
45
  pattern,
56
46
  command,
57
- files: minimatch.match(paths, pattern, { dot: true }),
47
+ files: minimatch.match(paths, pattern, {
48
+ dot: true,
49
+ matchBase: !pattern.includes('/'),
50
+ }),
58
51
  }))
59
52
  .filter(({ files }) => files.length)
60
53
 
61
54
  for (const { files } of tasks) {
62
55
  for (const file of files) {
63
- const { absolutePath } = fileInfo[file]
64
-
65
- fs.chmodSync(absolutePath, 0o755)
56
+ fs.chmodSync(fileInfo[file].absolutePath, 0o755)
66
57
  }
67
58
  }
68
59
 
@@ -100,3 +91,34 @@ export class LintSynthesized extends Component {
100
91
  })
101
92
  }
102
93
  }
94
+
95
+ const getAllFiles = (root: Project) => {
96
+ const projects = getProjects(root)
97
+ const files = []
98
+
99
+ for (const project of projects) {
100
+ const current = project.files
101
+ .filter((file) => fs.existsSync(file.absolutePath))
102
+ .map(
103
+ (file) =>
104
+ [
105
+ path.relative(root.outdir, file.absolutePath),
106
+ {
107
+ file,
108
+ absolutePath: file.absolutePath,
109
+ mode: fs.statSync(file.absolutePath).mode,
110
+ },
111
+ ] as const,
112
+ )
113
+
114
+ files.push(...current)
115
+ }
116
+
117
+ return Object.fromEntries(files)
118
+ }
119
+
120
+ const getProjects = (root: Project): Project[] => {
121
+ return root.node
122
+ .findAll(0)
123
+ .filter((node): node is Project => node instanceof Project)
124
+ }
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAClC,OAAO,WAAW,MAAM,OAAO,CAAA;AAE/B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,MAAM,KAAK,GAAG,WAAW,CAAC,yBAAyB,CAAC,CAAA;AAMpD;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,SAA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