@monorepolint/rules 0.5.0-alpha.81 → 0.5.0-alpha.84
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.
|
@@ -13,6 +13,7 @@ declare const Options: r.Constraint<r.Part<{
|
|
|
13
13
|
template: r.Union2<r.Record<{}, false>, r.String>;
|
|
14
14
|
templateFile: r.String;
|
|
15
15
|
excludedReferences: r.Union2<r.Array<r.String, false>, r.Literal<undefined>>;
|
|
16
|
+
additionalReferences: r.Union2<r.Array<r.String, false>, r.Literal<undefined>>;
|
|
16
17
|
}>, {
|
|
17
18
|
file?: string | undefined;
|
|
18
19
|
generator?: ((...args: any[]) => any) | undefined;
|
|
@@ -20,6 +21,7 @@ declare const Options: r.Constraint<r.Part<{
|
|
|
20
21
|
template?: string | {} | undefined;
|
|
21
22
|
templateFile?: string | undefined;
|
|
22
23
|
excludedReferences?: string[] | undefined;
|
|
24
|
+
additionalReferences?: string[] | undefined;
|
|
23
25
|
}, unknown>;
|
|
24
26
|
export declare type Options = r.Static<typeof Options>;
|
|
25
27
|
export declare const standardTsconfig: RuleModule<r.Constraint<r.Part<{
|
|
@@ -29,6 +31,7 @@ export declare const standardTsconfig: RuleModule<r.Constraint<r.Part<{
|
|
|
29
31
|
template: r.Union2<r.Record<{}, false>, r.String>;
|
|
30
32
|
templateFile: r.String;
|
|
31
33
|
excludedReferences: r.Union2<r.Array<r.String, false>, r.Literal<undefined>>;
|
|
34
|
+
additionalReferences: r.Union2<r.Array<r.String, false>, r.Literal<undefined>>;
|
|
32
35
|
}>, {
|
|
33
36
|
file?: string | undefined;
|
|
34
37
|
generator?: ((...args: any[]) => any) | undefined;
|
|
@@ -36,6 +39,7 @@ export declare const standardTsconfig: RuleModule<r.Constraint<r.Part<{
|
|
|
36
39
|
template?: string | {} | undefined;
|
|
37
40
|
templateFile?: string | undefined;
|
|
38
41
|
excludedReferences?: string[] | undefined;
|
|
42
|
+
additionalReferences?: string[] | undefined;
|
|
39
43
|
}, unknown>>;
|
|
40
44
|
export {};
|
|
41
45
|
//# sourceMappingURL=standardTsconfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standardTsconfig.d.ts","sourceRoot":"","sources":["../src/standardTsconfig.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKzD,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAI9B,QAAA,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"standardTsconfig.d.ts","sourceRoot":"","sources":["../src/standardTsconfig.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKzD,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAI9B,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;WAuBT,CAAC;AAEL,oBAAY,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,OAAO,CAAC,CAAC;AAE/C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;YA6BE,CAAC"}
|
package/lib/standardTsconfig.js
CHANGED
|
@@ -22,6 +22,7 @@ const Options = r
|
|
|
22
22
|
template: r.Record({}).Or(r.String),
|
|
23
23
|
templateFile: r.String,
|
|
24
24
|
excludedReferences: r.Array(r.String).Or(r.Undefined),
|
|
25
|
+
additionalReferences: r.Array(r.String).Or(r.Undefined),
|
|
25
26
|
})
|
|
26
27
|
.withConstraint(({ generator, template, templateFile }) => {
|
|
27
28
|
let count = 0;
|
|
@@ -72,16 +73,16 @@ function getGenerator(context, opts) {
|
|
|
72
73
|
const { packageDir: workspacePackageDir } = context.getWorkspaceContext();
|
|
73
74
|
const fullPath = path.resolve(workspacePackageDir, opts.templateFile);
|
|
74
75
|
const template = JSON.parse(fs_1.readFileSync(fullPath, "utf-8"));
|
|
75
|
-
return makeGenerator(template, opts.excludedReferences, opts.tsconfigReferenceFile);
|
|
76
|
+
return makeGenerator(template, opts.excludedReferences, opts.additionalReferences, opts.tsconfigReferenceFile);
|
|
76
77
|
}
|
|
77
78
|
else if (opts.template) {
|
|
78
|
-
return makeGenerator(opts.template, opts.excludedReferences, opts.tsconfigReferenceFile);
|
|
79
|
+
return makeGenerator(opts.template, opts.excludedReferences, opts.additionalReferences, opts.tsconfigReferenceFile);
|
|
79
80
|
}
|
|
80
81
|
else {
|
|
81
82
|
throw new Error("Unable to make generator");
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
|
-
function makeGenerator(template, excludedReferences = [], tsconfigReferenceFile) {
|
|
85
|
+
function makeGenerator(template, excludedReferences = [], additionalReferences = [], tsconfigReferenceFile) {
|
|
85
86
|
return function generator(context) {
|
|
86
87
|
template = {
|
|
87
88
|
...template,
|
|
@@ -99,6 +100,11 @@ function makeGenerator(template, excludedReferences = [], tsconfigReferenceFile)
|
|
|
99
100
|
path: path.relative(context.packageDir, absoluteReferencePath),
|
|
100
101
|
});
|
|
101
102
|
});
|
|
103
|
+
additionalReferences.forEach((additionalReference) => {
|
|
104
|
+
template.references.push({
|
|
105
|
+
path: additionalReference,
|
|
106
|
+
});
|
|
107
|
+
});
|
|
102
108
|
return JSON.stringify(template, undefined, 2) + "\n";
|
|
103
109
|
};
|
|
104
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standardTsconfig.js","sourceRoot":"","sources":["../src/standardTsconfig.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAGH,2BAA6D;AAC7D,kEAA6B;AAC7B,kEAAkC;AAClC,mDAA6B;AAC7B,oDAA8B;AAE9B,MAAM,yBAAyB,GAAG,eAAe,CAAC;AAElD,MAAM,OAAO,GAAG,CAAC;KACd,OAAO,CAAC;IACP,IAAI,EAAE,CAAC,CAAC,MAAM;IACd,SAAS,EAAE,CAAC,CAAC,QAAQ;IACrB,qBAAqB,EAAE,CAAC,CAAC,MAAM;IAC/B,QAAQ,EAA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EjH,IAAI;aACD,MAAM,CACL,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,mBAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAC/G;aACA,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;YACvB,MAAM,UAAU,GAAG,eAAe,CAAC,GAAG,CAAC,WAAW,CAAE,CAAC;YACrD,MAAM,qBAAqB,GACzB,qBAAqB,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;YAClG,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC;gBACvB,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,qBAAqB,CAAC;aAC/D,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEL,oBAAoB,CAAC,OAAO,CAAC,CAAC,mBAAmB,EAAE,EAAE;YACnD,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC;gBACvB,IAAI,EAAE,mBAAmB;aAC1B,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;IACvD,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monorepolint/rules",
|
|
3
|
-
"version": "0.5.0-alpha.
|
|
3
|
+
"version": "0.5.0-alpha.84+c5119a9",
|
|
4
4
|
"author": "Eric L Anderson (https://github.com/ericanderson)",
|
|
5
5
|
"contributors": [
|
|
6
6
|
"Mac Lockard (https://github.com/maclockard)"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"test:watch": "../../node_modules/.bin/jest --colors --passWithNoTests --watch"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@monorepolint/core": "^0.5.0-alpha.
|
|
23
|
-
"@monorepolint/utils": "^0.5.0-alpha.
|
|
22
|
+
"@monorepolint/core": "^0.5.0-alpha.84+c5119a9",
|
|
23
|
+
"@monorepolint/utils": "^0.5.0-alpha.84+c5119a9",
|
|
24
24
|
"globby": "^11.0.1",
|
|
25
25
|
"jest-diff": "^26.0.1",
|
|
26
26
|
"minimatch": "^3.0.4",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "c5119a9ebab6fb8cbca725c71f6004ea684076f9"
|
|
42
42
|
}
|
package/src/standardTsconfig.ts
CHANGED
|
@@ -22,6 +22,7 @@ const Options = r
|
|
|
22
22
|
template: r.Record({}).Or(r.String),
|
|
23
23
|
templateFile: r.String,
|
|
24
24
|
excludedReferences: r.Array(r.String).Or(r.Undefined),
|
|
25
|
+
additionalReferences: r.Array(r.String).Or(r.Undefined),
|
|
25
26
|
})
|
|
26
27
|
.withConstraint(({ generator, template, templateFile }) => {
|
|
27
28
|
let count = 0;
|
|
@@ -79,15 +80,20 @@ function getGenerator(context: Context, opts: Options) {
|
|
|
79
80
|
const fullPath = path.resolve(workspacePackageDir, opts.templateFile);
|
|
80
81
|
const template = JSON.parse(readFileSync(fullPath, "utf-8"));
|
|
81
82
|
|
|
82
|
-
return makeGenerator(template, opts.excludedReferences, opts.tsconfigReferenceFile);
|
|
83
|
+
return makeGenerator(template, opts.excludedReferences, opts.additionalReferences, opts.tsconfigReferenceFile);
|
|
83
84
|
} else if (opts.template) {
|
|
84
|
-
return makeGenerator(opts.template, opts.excludedReferences, opts.tsconfigReferenceFile);
|
|
85
|
+
return makeGenerator(opts.template, opts.excludedReferences, opts.additionalReferences, opts.tsconfigReferenceFile);
|
|
85
86
|
} else {
|
|
86
87
|
throw new Error("Unable to make generator");
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
function makeGenerator(
|
|
91
|
+
function makeGenerator(
|
|
92
|
+
template: any,
|
|
93
|
+
excludedReferences: ReadonlyArray<string> = [],
|
|
94
|
+
additionalReferences: ReadonlyArray<string> = [],
|
|
95
|
+
tsconfigReferenceFile?: string
|
|
96
|
+
) {
|
|
91
97
|
return function generator(context: Context) {
|
|
92
98
|
template = {
|
|
93
99
|
...template,
|
|
@@ -112,6 +118,12 @@ function makeGenerator(template: any, excludedReferences: ReadonlyArray<string>
|
|
|
112
118
|
});
|
|
113
119
|
});
|
|
114
120
|
|
|
121
|
+
additionalReferences.forEach((additionalReference) => {
|
|
122
|
+
template.references.push({
|
|
123
|
+
path: additionalReference,
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
|
|
115
127
|
return JSON.stringify(template, undefined, 2) + "\n";
|
|
116
128
|
};
|
|
117
129
|
}
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -920,8 +920,8 @@
|
|
|
920
920
|
"affectsGlobalScope": false
|
|
921
921
|
},
|
|
922
922
|
"./src/standardTsconfig.ts": {
|
|
923
|
-
"version": "
|
|
924
|
-
"signature": "
|
|
923
|
+
"version": "91dce12a1b9e23e950f4462b145a7d4e38bbeabf80572d2b67d03d56b6ac94fb",
|
|
924
|
+
"signature": "f5067d4ff78ecd2b863a5cc422c0efdb93332b490ce025c6951f33bbc9b0119d",
|
|
925
925
|
"affectsGlobalScope": false
|
|
926
926
|
},
|
|
927
927
|
"../../node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts": {
|