@sw-tsdk/common 0.1.1-next.23

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.
Files changed (98) hide show
  1. package/LICENSE +8 -0
  2. package/lib/index.d.ts +4 -0
  3. package/lib/index.js +8 -0
  4. package/lib/index.js.map +1 -0
  5. package/lib/schemas/asset.d.ts +13 -0
  6. package/lib/schemas/asset.js +3 -0
  7. package/lib/schemas/asset.js.map +1 -0
  8. package/lib/schemas/available-output-type.d.ts +7 -0
  9. package/lib/schemas/available-output-type.js +12 -0
  10. package/lib/schemas/available-output-type.js.map +1 -0
  11. package/lib/schemas/family.d.ts +14 -0
  12. package/lib/schemas/family.js +19 -0
  13. package/lib/schemas/family.js.map +1 -0
  14. package/lib/schemas/index.d.ts +7 -0
  15. package/lib/schemas/index.js +11 -0
  16. package/lib/schemas/index.js.map +1 -0
  17. package/lib/schemas/integration.d.ts +39 -0
  18. package/lib/schemas/integration.js +50 -0
  19. package/lib/schemas/integration.js.map +1 -0
  20. package/lib/schemas/os-support.d.ts +4 -0
  21. package/lib/schemas/os-support.js +3 -0
  22. package/lib/schemas/os-support.js.map +1 -0
  23. package/lib/schemas/package.d.ts +26 -0
  24. package/lib/schemas/package.js +3 -0
  25. package/lib/schemas/package.js.map +1 -0
  26. package/lib/schemas/python-version.d.ts +4 -0
  27. package/lib/schemas/python-version.js +9 -0
  28. package/lib/schemas/python-version.js.map +1 -0
  29. package/lib/templates/CHANGELOG.md.t +7 -0
  30. package/lib/templates/INTERNAL_CHANGELOG.md.t +7 -0
  31. package/lib/templates/README.md.t +40 -0
  32. package/lib/templates/asset.json.t +132 -0
  33. package/lib/templates/assetConfig.json.t +3 -0
  34. package/lib/templates/config.json.t +9 -0
  35. package/lib/templates/conftest.py.t +1 -0
  36. package/lib/templates/data_asset.json.t +4 -0
  37. package/lib/templates/dist_requirements.txt.t +3 -0
  38. package/lib/templates/example.py.t +13 -0
  39. package/lib/templates/import.json.t +23 -0
  40. package/lib/templates/init.py.t +17 -0
  41. package/lib/templates/package.json.t +22 -0
  42. package/lib/templates/pre-commit-config.yaml.t +41 -0
  43. package/lib/templates/rest_module_init.t +11 -0
  44. package/lib/templates/setup.py.t +17 -0
  45. package/lib/templates/test_connection.py.t +4 -0
  46. package/lib/templates/test_default.py.t +1 -0
  47. package/lib/templates/test_requirements.txt.t +1 -0
  48. package/lib/types/index.d.ts +1 -0
  49. package/lib/types/index.js +5 -0
  50. package/lib/types/index.js.map +1 -0
  51. package/lib/types/integration.interfaces.d.ts +43 -0
  52. package/lib/types/integration.interfaces.js +19 -0
  53. package/lib/types/integration.interfaces.js.map +1 -0
  54. package/lib/utils/image-processor.d.ts +13 -0
  55. package/lib/utils/image-processor.js +105 -0
  56. package/lib/utils/image-processor.js.map +1 -0
  57. package/lib/utils/index.d.ts +5 -0
  58. package/lib/utils/index.js +9 -0
  59. package/lib/utils/index.js.map +1 -0
  60. package/lib/utils/integration-generator.d.ts +20 -0
  61. package/lib/utils/integration-generator.js +257 -0
  62. package/lib/utils/integration-generator.js.map +1 -0
  63. package/lib/utils/loading-messages.d.ts +3 -0
  64. package/lib/utils/loading-messages.js +263 -0
  65. package/lib/utils/loading-messages.js.map +1 -0
  66. package/lib/utils/task-generator.d.ts +9 -0
  67. package/lib/utils/task-generator.js +113 -0
  68. package/lib/utils/task-generator.js.map +1 -0
  69. package/lib/utils/template-loader.d.ts +4 -0
  70. package/lib/utils/template-loader.js +16 -0
  71. package/lib/utils/template-loader.js.map +1 -0
  72. package/lib/versioning/constants.d.ts +6 -0
  73. package/lib/versioning/constants.js +15 -0
  74. package/lib/versioning/constants.js.map +1 -0
  75. package/lib/versioning/index.d.ts +3 -0
  76. package/lib/versioning/index.js +7 -0
  77. package/lib/versioning/index.js.map +1 -0
  78. package/lib/versioning/presets.d.ts +27 -0
  79. package/lib/versioning/presets.js +86 -0
  80. package/lib/versioning/presets.js.map +1 -0
  81. package/lib/versioning/read-changelog-diff.d.ts +1 -0
  82. package/lib/versioning/read-changelog-diff.js +31 -0
  83. package/lib/versioning/read-changelog-diff.js.map +1 -0
  84. package/lib/versioning/read-existing-changelog.d.ts +1 -0
  85. package/lib/versioning/read-existing-changelog.js +32 -0
  86. package/lib/versioning/read-existing-changelog.js.map +1 -0
  87. package/lib/versioning/recommend-version.d.ts +1 -0
  88. package/lib/versioning/recommend-version.js +76 -0
  89. package/lib/versioning/recommend-version.js.map +1 -0
  90. package/lib/versioning/templates/commit.hbs +9 -0
  91. package/lib/versioning/templates/footer.hbs +0 -0
  92. package/lib/versioning/templates/header.hbs +13 -0
  93. package/lib/versioning/templates/internal-commit.hbs +32 -0
  94. package/lib/versioning/templates/template.hbs +23 -0
  95. package/lib/versioning/update-changelog.d.ts +1 -0
  96. package/lib/versioning/update-changelog.js +85 -0
  97. package/lib/versioning/update-changelog.js.map +1 -0
  98. package/package.json +60 -0
@@ -0,0 +1 @@
1
+ export declare function readExistingChangelog(rootDirectory: string, filename?: string): Promise<string[]>;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.readExistingChangelog = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
6
+ const node_path_1 = require("node:path");
7
+ const constants_1 = require("./constants");
8
+ function readExistingChangelog(rootDirectory, filename = 'CHANGELOG.md') {
9
+ const changelogFileLoc = (0, node_path_1.join)(rootDirectory, filename);
10
+ let chain = Promise.resolve('');
11
+ // catch allows missing file to pass without breaking chain
12
+ chain = chain.then(() => fs_extra_1.default.readFile(changelogFileLoc, 'utf8').catch(() => ''));
13
+ chain = chain.then((changelogContents) => {
14
+ // Remove the header if it exists, thus starting at the first entry.
15
+ let headerIndex = changelogContents.indexOf(constants_1.COMMIT_GUIDELINE);
16
+ if (headerIndex !== -1) {
17
+ return changelogContents.slice(Math.max(0, headerIndex + constants_1.COMMIT_GUIDELINE.length + constants_1.BLANK_LINE.length));
18
+ }
19
+ // check for old style
20
+ if (headerIndex === -1) {
21
+ headerIndex = changelogContents.indexOf(constants_1.OLD_CHANGELOG_HEADER);
22
+ }
23
+ if (headerIndex !== -1) {
24
+ return changelogContents.slice(Math.max(0, headerIndex + constants_1.OLD_CHANGELOG_HEADER.length + constants_1.BLANK_LINE.length));
25
+ }
26
+ return changelogContents;
27
+ });
28
+ // consumer expects resolved tuple
29
+ return chain.then(changelogContents => [changelogFileLoc, changelogContents]);
30
+ }
31
+ exports.readExistingChangelog = readExistingChangelog;
32
+ //# sourceMappingURL=read-existing-changelog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-existing-changelog.js","sourceRoot":"","sources":["../../src/versioning/read-existing-changelog.ts"],"names":[],"mappings":";;;;AAAA,gEAAyB;AACzB,yCAA8B;AAC9B,2CAA8E;AAE9E,SAAgB,qBAAqB,CAAC,aAAqB,EAAE,QAAQ,GAAG,cAAc;IACpF,MAAM,gBAAgB,GAAG,IAAA,gBAAI,EAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;IAEtD,IAAI,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAE/B,2DAA2D;IAC3D,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,kBAAE,CAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAE/E,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,iBAAyB,EAAE,EAAE;QAC/C,oEAAoE;QACpE,IAAI,WAAW,GAAG,iBAAiB,CAAC,OAAO,CAAC,4BAAgB,CAAC,CAAA;QAE7D,IAAI,WAAW,KAAK,CAAC,CAAC,EAAE;YACtB,OAAO,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,4BAAgB,CAAC,MAAM,GAAG,sBAAU,CAAC,MAAM,CAAC,CAAC,CAAA;SACvG;QAED,sBAAsB;QACtB,IAAI,WAAW,KAAK,CAAC,CAAC,EAAE;YACtB,WAAW,GAAG,iBAAiB,CAAC,OAAO,CAAC,gCAAoB,CAAC,CAAA;SAC9D;QAED,IAAI,WAAW,KAAK,CAAC,CAAC,EAAE;YACtB,OAAO,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,gCAAoB,CAAC,MAAM,GAAG,sBAAU,CAAC,MAAM,CAAC,CAAC,CAAA;SAC3G;QAED,OAAO,iBAAiB,CAAA;IAC1B,CAAC,CAAC,CAAA;IAEF,kCAAkC;IAClC,OAAO,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC,CAAA;AAC/E,CAAC;AA9BD,sDA8BC"}
@@ -0,0 +1 @@
1
+ export declare function recommendVersion(location: string, version: string, type: string, preid: string | undefined): Promise<string | null>;
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.recommendVersion = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const semver_1 = require("semver");
6
+ // import {semver} from 'semver/preload'
7
+ const conventional_recommended_bump_1 = tslib_1.__importDefault(require("conventional-recommended-bump"));
8
+ const npmlog_1 = require("npmlog");
9
+ const shouldBumpPrerelease = (releaseType, version) => {
10
+ if (!(0, semver_1.prerelease)(version)) {
11
+ return true;
12
+ }
13
+ switch (releaseType) {
14
+ case 'major':
15
+ return (0, semver_1.minor)(version) !== 0 || (0, semver_1.patch)(version) !== 0;
16
+ case 'minor':
17
+ return (0, semver_1.patch)(version) !== 0;
18
+ default:
19
+ return false;
20
+ }
21
+ };
22
+ // noinspection JSUnusedGlobalSymbols
23
+ const prereleaseIdFromVersion = (version) => {
24
+ const prereleases = ((0, semver_1.prerelease)(version) || []);
25
+ return prereleases.shift();
26
+ };
27
+ // noinspection JSUnusedGlobalSymbols
28
+ function recommendVersion(location, version, type, preid) {
29
+ const options = {
30
+ path: location,
31
+ preset: 'conventional-changelog-conventionalcommits',
32
+ };
33
+ const prereleaseId = preid || prereleaseIdFromVersion(version);
34
+ return new Promise((resolve, reject) => {
35
+ (0, conventional_recommended_bump_1.default)(options, (err, data) => {
36
+ if (err) {
37
+ return reject(err);
38
+ }
39
+ // result might be undefined because some presets are not consistent with angular
40
+ // we still need to bump _something_ because lerna saw a change here
41
+ let releaseType = data.releaseType || 'patch';
42
+ if (prereleaseId) {
43
+ const shouldBump = shouldBumpPrerelease(releaseType, version);
44
+ (0, npmlog_1.info)(type, `${shouldBump}`);
45
+ const prereleaseType = shouldBump ? `pre${releaseType}` : 'prerelease';
46
+ (0, npmlog_1.info)(type, `${prereleaseType}`);
47
+ (0, npmlog_1.verbose)(type, 'increment %s by %s', version, prereleaseType);
48
+ resolve((0, semver_1.inc)(version, prereleaseType, prereleaseId));
49
+ }
50
+ else {
51
+ if ((0, semver_1.major)(version) === 0 && // According to semver, major version zero (0.y.z) is for initial
52
+ // development. Anything MAY change at any time. The public API
53
+ // SHOULD NOT be considered stable. The version 1.0.0 defines
54
+ // the (initial stable) public API.
55
+ //
56
+ // To allow monorepos to use major version zero meaningfully,
57
+ // the transition from 0.x to 1.x must be explicitly requested
58
+ // by the user. Breaking changes MUST NOT automatically bump
59
+ // the major version from 0.x to 1.x.
60
+ //
61
+ // The usual convention is to use semver-patch bumps for bugfix
62
+ // releases and semver-minor for everything else, including
63
+ // breaking changes. This matches the behavior of `^` operator
64
+ // as implemented by `npm`.
65
+ //
66
+ releaseType === 'major') {
67
+ releaseType = 'minor';
68
+ }
69
+ (0, npmlog_1.verbose)(type, 'increment %s by %s', version, releaseType);
70
+ resolve((0, semver_1.inc)(version, releaseType));
71
+ }
72
+ });
73
+ });
74
+ }
75
+ exports.recommendVersion = recommendVersion;
76
+ //# sourceMappingURL=recommend-version.js.map
@@ -0,0 +1 @@
1
+ {"version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{~subject}}
3
+ {{~else}}
4
+ {{~header}}
5
+ {{~/if}}
6
+ {{#if body}}
7
+
8
+ {{body}}
9
+ {{/if}}
File without changes
@@ -0,0 +1,13 @@
1
+ {{#if isPatch~}}
2
+ ###
3
+ {{~else~}}
4
+ ##
5
+ {{~/if}} {{#if @root.linkCompare~}}
6
+ [{{version}}]({{compareUrlFormat}})
7
+ {{~else}}
8
+ {{~version}}
9
+ {{~/if}}
10
+ {{~#if title}} "{{title}}"
11
+ {{~/if}}
12
+ {{~#if date}} ({{date}})
13
+ {{/if}}
@@ -0,0 +1,32 @@
1
+ *{{#if scope}} **{{scope}}:**
2
+ {{~/if}} {{#if subject}}
3
+ {{~subject}}
4
+ {{~else}}
5
+ {{~header}}
6
+ {{~/if}}
7
+ {{~!-- commit link --}}{{~#if hash}} {{#if @root.linkReferences~}}
8
+ ([{{shortHash}}]({{commitUrlFormat}}))
9
+ {{~else}}
10
+ {{~shortHash}}
11
+ {{~/if}}{{~/if}}
12
+
13
+ {{~!-- commit references --}}
14
+ {{~#if references~}}
15
+ , closes
16
+ {{~#each references}} {{#if @root.linkReferences~}}
17
+ [
18
+ {{~#if this.owner}}
19
+ {{~this.owner}}/
20
+ {{~/if}}
21
+ {{~this.repository}}{{this.prefix}}{{this.issue}}]({{issueUrlFormat}})
22
+ {{~else}}
23
+ {{~#if this.owner}}
24
+ {{~this.owner}}/
25
+ {{~/if}}
26
+ {{~this.repository}}{{this.prefix}}{{this.issue}}
27
+ {{~/if}}{{/each}}
28
+ {{~/if}}
29
+ {{#if body}}
30
+
31
+ {{body}}
32
+ {{/if}}
@@ -0,0 +1,23 @@
1
+ {{> header}}
2
+
3
+ {{#if noteGroups}}
4
+ {{#each noteGroups}}
5
+
6
+ ### {{title}}
7
+
8
+ {{#each notes}}
9
+ * {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}
10
+ {{/each}}
11
+ {{/each}}
12
+ {{/if}}
13
+ {{#each commitGroups}}
14
+
15
+ {{#if title}}
16
+ ### {{title}}
17
+
18
+ {{/if}}
19
+ {{#each commits}}
20
+ {{> commit root=@root}}
21
+
22
+ {{/each}}
23
+ {{/each}}
@@ -0,0 +1 @@
1
+ export declare function updateChangelog(location: string, version: string, tagPrefix?: string): Promise<void>;
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateChangelog = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const npmlog_1 = require("npmlog");
6
+ const conventional_changelog_core_1 = tslib_1.__importDefault(require("conventional-changelog-core"));
7
+ const get_stream_1 = tslib_1.__importDefault(require("get-stream"));
8
+ const read_existing_changelog_1 = require("./read-existing-changelog");
9
+ const constants_1 = require("./constants");
10
+ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
11
+ const node_path_1 = require("node:path");
12
+ const presets_1 = tslib_1.__importDefault(require("./presets"));
13
+ function makeBumpOnlyFilter(name) {
14
+ return (newEntry) => {
15
+ // When force publishing, it is possible that there will be no actual changes, only a version bump.
16
+ if (!newEntry.split('\n').some(line => line.startsWith('*'))) {
17
+ // Add a note to indicate that only a version bump has occurred.
18
+ const message = `**Note:** Version bump only for package ${name}`;
19
+ // the extra blank lines preserve the whitespace delimiting releases
20
+ return [newEntry.trim(), message, constants_1.BLANK_LINE].join(constants_1.BLANK_LINE);
21
+ }
22
+ return newEntry;
23
+ };
24
+ }
25
+ // noinspection JSUnusedGlobalSymbols
26
+ async function updateChangelog(location, version, tagPrefix = 'v') {
27
+ const name = (0, node_path_1.basename)(location);
28
+ (0, npmlog_1.silly)(name, 'for %s at %s', name, location);
29
+ const presetConfig = await (0, presets_1.default)({
30
+ writerOpts: {
31
+ includeDetails: false,
32
+ },
33
+ });
34
+ const options = {};
35
+ // root changelogs are only enabled in fixed mode, and need the proper tag prefix
36
+ options.tagPrefix = tagPrefix;
37
+ const context = Object.assign({}, {
38
+ version,
39
+ tagPrefix,
40
+ currentTag: `${tagPrefix}${version}`, // preserve tagPrefix because cc-core can't find the currentTag otherwise
41
+ });
42
+ // generate the markdown for the upcoming release.
43
+ const changelogStream = (0, conventional_changelog_core_1.default)(options, context, presetConfig.gitRawCommitsOpts, presetConfig.parserOpts, presetConfig.writerOpts);
44
+ const internalPresetConfig = await (0, presets_1.default)({
45
+ commitTemplateName: 'internal-commit.hbs',
46
+ writerOpts: {
47
+ includeDetails: false,
48
+ },
49
+ });
50
+ const internalChangelogStream = (0, conventional_changelog_core_1.default)(options, context, internalPresetConfig.gitRawCommitsOpts, internalPresetConfig.parserOpts, internalPresetConfig.writerOpts);
51
+ await Promise.all([
52
+ // INTERNAL_CHANGELOG.md
53
+ Promise.all([
54
+ (0, get_stream_1.default)(internalChangelogStream).then(makeBumpOnlyFilter(name)),
55
+ (0, read_existing_changelog_1.readExistingChangelog)(location, 'INTERNAL_CHANGELOG.md'),
56
+ ]).then(([newEntry, [changelogFileLoc, changelogContents]]) => {
57
+ (0, npmlog_1.silly)(name, 'writing new entry: %j', newEntry);
58
+ const content = [constants_1.CHANGELOG_HEADER, newEntry, changelogContents].join(constants_1.BLANK_LINE);
59
+ return fs_extra_1.default.writeFile(changelogFileLoc, content.trim() + constants_1.EOL).then(() => {
60
+ (0, npmlog_1.verbose)(name, 'wrote', changelogFileLoc);
61
+ return {
62
+ logPath: changelogFileLoc,
63
+ newEntry,
64
+ };
65
+ });
66
+ }),
67
+ // CHANGELOG.md
68
+ Promise.all([
69
+ (0, get_stream_1.default)(changelogStream).then(makeBumpOnlyFilter(name)),
70
+ (0, read_existing_changelog_1.readExistingChangelog)(location),
71
+ ]).then(([newEntry, [changelogFileLoc, changelogContents]]) => {
72
+ (0, npmlog_1.silly)(name, 'writing new entry: %j', newEntry);
73
+ const content = [constants_1.CHANGELOG_HEADER, newEntry, changelogContents].join(constants_1.BLANK_LINE);
74
+ return fs_extra_1.default.writeFile(changelogFileLoc, content.trim() + constants_1.EOL).then(() => {
75
+ (0, npmlog_1.verbose)(name, 'wrote', changelogFileLoc);
76
+ return {
77
+ logPath: changelogFileLoc,
78
+ newEntry,
79
+ };
80
+ });
81
+ }),
82
+ ]);
83
+ }
84
+ exports.updateChangelog = updateChangelog;
85
+ //# sourceMappingURL=update-changelog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-changelog.js","sourceRoot":"","sources":["../../src/versioning/update-changelog.ts"],"names":[],"mappings":";;;;AAAA,mCAAqC;AACrC,sGAAmE;AACnE,oEAAkC;AAClC,uEAA+D;AAC/D,2CAA6D;AAC7D,gEAAyB;AACzB,yCAAkC;AAClC,gEAA8B;AAE9B,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAO,CAAC,QAAgB,EAAE,EAAE;QAC1B,mGAAmG;QACnG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE;YAC5D,gEAAgE;YAEhE,MAAM,OAAO,GAAG,2CAA2C,IAAI,EAAE,CAAA;YAEjE,oEAAoE;YACpE,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,sBAAU,CAAC,CAAC,IAAI,CAAC,sBAAU,CAAC,CAAA;SAC/D;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC,CAAA;AACH,CAAC;AAED,qCAAqC;AAC9B,KAAK,UAAU,eAAe,CAAC,QAAgB,EAAE,OAAe,EAAE,SAAS,GAAG,GAAG;IACtF,MAAM,IAAI,GAAG,IAAA,oBAAQ,EAAC,QAAQ,CAAC,CAAA;IAC/B,IAAA,cAAK,EAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAA;IAE3C,MAAM,YAAY,GAAG,MAAM,IAAA,iBAAM,EAAC;QAChC,UAAU,EAAE;YACV,cAAc,EAAE,KAAK;SACtB;KACF,CAAC,CAAA;IAEF,MAAM,OAAO,GAAQ,EAAE,CAAA;IAEvB,iFAA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,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,eAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;gBACpE,IAAA,gBAAO,EAAC,IAAI,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAA;gBAExC,OAAO;oBACL,OAAO,EAAE,gBAAgB;oBACzB,QAAQ;iBACT,CAAA;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC;QACF,eAAe;QACf,OAAO,CAAC,GAAG,CAAC;YACV,IAAA,oBAAS,EAAC,eAAe,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACzD,IAAA,+CAAqB,EAAC,QAAQ,CAAC;SAChC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC,EAAE,EAAE;YAC5D,IAAA,cAAK,EAAC,IAAI,EAAE,uBAAuB,EAAE,QAAQ,CAAC,CAAA;YAE9C,MAAM,OAAO,GAAG,CAAC,4BAAgB,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC,IAAI,CAAC,sBAAU,CAAC,CAAA;YAEhF,OAAO,kBAAE,CAAC,SAAS,CAAC,gBAAgB,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,eAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;gBACpE,IAAA,gBAAO,EAAC,IAAI,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAA;gBAExC,OAAO;oBACL,OAAO,EAAE,gBAAgB;oBACzB,QAAQ;iBACT,CAAA;YACH,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC;KACH,CAAC,CAAA;AACJ,CAAC;AApFD,0CAoFC"}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "author": "Chris Young <youngcm2@gmail.com>",
3
+ "bugs": {
4
+ "url": "https://github.com/swimlane/turbine-sdk/issues"
5
+ },
6
+ "dependencies": {
7
+ "@oclif/core": "1.16.4",
8
+ "@sw-tsdk/core": "^0.1.1-next.23+038e7a6",
9
+ "@sw-tsdk/docker": "^0.1.1-next.23+038e7a6",
10
+ "axios": "0.26.1",
11
+ "change-case": "4.1.2",
12
+ "conventional-changelog-conventionalcommits": "4.6.3",
13
+ "conventional-changelog-core": "4.2.4",
14
+ "conventional-recommended-bump": "6.1.0",
15
+ "file-type": "16.5.3",
16
+ "format-message": "6.2.4",
17
+ "fs-extra": "10.0.1",
18
+ "get-stream": "6.0.1",
19
+ "handlebars": "4.7.7",
20
+ "inquirer": "8.2.2",
21
+ "listr2": "4.0.5",
22
+ "noop-stream": "1.0.0",
23
+ "npmlog": "6.0.1",
24
+ "semver": "7.3.6",
25
+ "simple-git": "3.5.0",
26
+ "slug": "5.3.0",
27
+ "temp": "0.9.4"
28
+ },
29
+ "description": "Common package for sw-tsdk",
30
+ "directories": {
31
+ "templates": "./lib/templates",
32
+ "lib": "lib"
33
+ },
34
+ "engines": {
35
+ "node": ">=16.0.0"
36
+ },
37
+ "files": [
38
+ "lib"
39
+ ],
40
+ "homepage": "https://github.com/swimlane/turbine-sdk#readme",
41
+ "license": "ISC",
42
+ "main": "lib/index.js",
43
+ "name": "@sw-tsdk/common",
44
+ "publishConfig": {
45
+ "access": "public"
46
+ },
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/swimlane/turbine-sdk.git"
50
+ },
51
+ "scripts": {
52
+ "build": "rm -rf lib && tsc && yarn copy-files",
53
+ "lint": "eslint . --ext .ts --config .eslintrc",
54
+ "copy-files": "copyfiles -u 1 **/templates/**/*.* lib/",
55
+ "test": "echo \"Error: run tests from root\" && exit 1"
56
+ },
57
+ "types": "lib/index.d.ts",
58
+ "version": "0.1.1-next.23+038e7a6",
59
+ "gitHead": "038e7a68d45b2d93f39c7f7b2edce9798019007e"
60
+ }