@openzeppelin/wizard-stellar 0.6.1 → 0.6.2
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/dist/set-info.d.ts.map +1 -1
- package/dist/set-info.js +17 -2
- package/dist/set-info.js.map +1 -1
- package/package.json +1 -1
- package/src/set-info.ts +21 -2
package/dist/set-info.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-info.d.ts","sourceRoot":"","sources":["../src/set-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"set-info.d.ts","sourceRoot":"","sources":["../src/set-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAelD,eAAO,MAAM,WAAW;;EAAsC,CAAC;AAE/D,eAAO,MAAM,QAAQ,EAAE,IAAyB,CAAC;AAEjD,MAAM,MAAM,IAAI,GAAG;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,wBAAgB,OAAO,CAAC,CAAC,EAAE,eAAe,EAAE,EAAE,eAAe,EAAE,OAAO,EAAE,EAAE,IAAI,GAAG,IAAI,CAUpF"}
|
package/dist/set-info.js
CHANGED
|
@@ -2,12 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defaults = exports.infoOptions = void 0;
|
|
4
4
|
exports.setInfo = setInfo;
|
|
5
|
+
const error_1 = require("./error");
|
|
6
|
+
// These values are printed into a // comment line in the generated Rust. LF
|
|
7
|
+
// ends that comment, letting following text become source. CR and U+2028/U+2029
|
|
8
|
+
// cannot break out in Rust, but are rejected as defense in depth (review tools
|
|
9
|
+
// render U+2028/U+2029 as line breaks).
|
|
10
|
+
const LINE_TERMINATOR = /[\n\r\u2028\u2029]/u;
|
|
11
|
+
function checkSingleLine(value, field) {
|
|
12
|
+
if (LINE_TERMINATOR.test(value)) {
|
|
13
|
+
throw new error_1.OptionsError({ [field]: 'Must not contain line breaks' });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
5
16
|
exports.infoOptions = [{}, { license: 'WTFPL' }];
|
|
6
17
|
exports.defaults = { license: 'MIT' };
|
|
7
18
|
function setInfo(c, { securityContact, license }) {
|
|
8
|
-
if (securityContact)
|
|
19
|
+
if (securityContact) {
|
|
20
|
+
checkSingleLine(securityContact, 'securityContact');
|
|
9
21
|
c.addContractMetadata({ key: 'security_contact', value: securityContact });
|
|
10
|
-
|
|
22
|
+
}
|
|
23
|
+
if (license) {
|
|
24
|
+
checkSingleLine(license, 'license');
|
|
11
25
|
c.license = license;
|
|
26
|
+
}
|
|
12
27
|
}
|
|
13
28
|
//# sourceMappingURL=set-info.js.map
|
package/dist/set-info.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-info.js","sourceRoot":"","sources":["../src/set-info.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"set-info.js","sourceRoot":"","sources":["../src/set-info.ts"],"names":[],"mappings":";;;AAwBA,0BAUC;AAjCD,mCAAuC;AAEvC,4EAA4E;AAC5E,gFAAgF;AAChF,+EAA+E;AAC/E,wCAAwC;AACxC,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAE9C,SAAS,eAAe,CAAC,KAAa,EAAE,KAAa;IACnD,IAAI,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,oBAAY,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,8BAA8B,EAAE,CAAC,CAAC;IACtE,CAAC;AACH,CAAC;AAEY,QAAA,WAAW,GAAG,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAU,CAAC;AAElD,QAAA,QAAQ,GAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAOjD,SAAgB,OAAO,CAAC,CAAkB,EAAE,EAAE,eAAe,EAAE,OAAO,EAAQ;IAC5E,IAAI,eAAe,EAAE,CAAC;QACpB,eAAe,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;QACpD,CAAC,CAAC,mBAAmB,CAAC,EAAE,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACpC,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC;IACtB,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openzeppelin/wizard-stellar",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "A boilerplate generator to get started with OpenZeppelin Stellar Soroban Contracts",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": "https://github.com/OpenZeppelin/contracts-wizard",
|
package/src/set-info.ts
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import type { ContractBuilder } from './contract';
|
|
2
|
+
import { OptionsError } from './error';
|
|
3
|
+
|
|
4
|
+
// These values are printed into a // comment line in the generated Rust. LF
|
|
5
|
+
// ends that comment, letting following text become source. CR and U+2028/U+2029
|
|
6
|
+
// cannot break out in Rust, but are rejected as defense in depth (review tools
|
|
7
|
+
// render U+2028/U+2029 as line breaks).
|
|
8
|
+
const LINE_TERMINATOR = /[\n\r\u2028\u2029]/u;
|
|
9
|
+
|
|
10
|
+
function checkSingleLine(value: string, field: string): void {
|
|
11
|
+
if (LINE_TERMINATOR.test(value)) {
|
|
12
|
+
throw new OptionsError({ [field]: 'Must not contain line breaks' });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
2
15
|
|
|
3
16
|
export const infoOptions = [{}, { license: 'WTFPL' }] as const;
|
|
4
17
|
|
|
@@ -10,7 +23,13 @@ export type Info = {
|
|
|
10
23
|
};
|
|
11
24
|
|
|
12
25
|
export function setInfo(c: ContractBuilder, { securityContact, license }: Info): void {
|
|
13
|
-
if (securityContact)
|
|
26
|
+
if (securityContact) {
|
|
27
|
+
checkSingleLine(securityContact, 'securityContact');
|
|
28
|
+
c.addContractMetadata({ key: 'security_contact', value: securityContact });
|
|
29
|
+
}
|
|
14
30
|
|
|
15
|
-
if (license)
|
|
31
|
+
if (license) {
|
|
32
|
+
checkSingleLine(license, 'license');
|
|
33
|
+
c.license = license;
|
|
34
|
+
}
|
|
16
35
|
}
|