@cdktn/provider-project 0.7.24
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/.jsii +419 -0
- package/API.md +4154 -0
- package/CLAUDE.md +172 -0
- package/LICENSE +355 -0
- package/README.md +82 -0
- package/lib/alert-open-prs.d.ts +14 -0
- package/lib/alert-open-prs.js +67 -0
- package/lib/auto-approve.d.ts +11 -0
- package/lib/auto-approve.js +70 -0
- package/lib/auto-close-community-issues.d.ts +15 -0
- package/lib/auto-close-community-issues.js +104 -0
- package/lib/automerge.d.ts +11 -0
- package/lib/automerge.js +67 -0
- package/lib/cdktf-config.d.ts +33 -0
- package/lib/cdktf-config.js +134 -0
- package/lib/copyright-headers.d.ts +4 -0
- package/lib/copyright-headers.js +44 -0
- package/lib/customized-license.d.ts +8 -0
- package/lib/customized-license.js +19 -0
- package/lib/dependabot.d.ts +8 -0
- package/lib/dependabot.js +40 -0
- package/lib/deprecate-packages.d.ts +14 -0
- package/lib/deprecate-packages.js +91 -0
- package/lib/force-release.d.ts +12 -0
- package/lib/force-release.js +112 -0
- package/lib/github-issues.d.ts +15 -0
- package/lib/github-issues.js +33 -0
- package/lib/index.d.ts +53 -0
- package/lib/index.js +447 -0
- package/lib/lock-issues.d.ts +13 -0
- package/lib/lock-issues.js +54 -0
- package/lib/package-info.d.ts +14 -0
- package/lib/package-info.js +7 -0
- package/lib/provider-upgrade.d.ts +17 -0
- package/lib/provider-upgrade.js +145 -0
- package/lib/readme.d.ts +21 -0
- package/lib/readme.js +147 -0
- package/lib/scripts/check-for-upgrades.d.ts +15 -0
- package/lib/scripts/check-for-upgrades.js +186 -0
- package/lib/scripts/should-release.d.ts +13 -0
- package/lib/scripts/should-release.js +96 -0
- package/lib/util/random-cron.d.ts +18 -0
- package/lib/util/random-cron.js +33 -0
- package/mise.toml +2 -0
- package/node_modules/camel-case/LICENSE +21 -0
- package/node_modules/camel-case/README.md +47 -0
- package/node_modules/camel-case/dist/index.d.ts +5 -0
- package/node_modules/camel-case/dist/index.js +23 -0
- package/node_modules/camel-case/dist/index.js.map +1 -0
- package/node_modules/camel-case/dist/index.spec.d.ts +1 -0
- package/node_modules/camel-case/dist/index.spec.js +26 -0
- package/node_modules/camel-case/dist/index.spec.js.map +1 -0
- package/node_modules/camel-case/dist.es2015/index.d.ts +5 -0
- package/node_modules/camel-case/dist.es2015/index.js +17 -0
- package/node_modules/camel-case/dist.es2015/index.js.map +1 -0
- package/node_modules/camel-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/camel-case/dist.es2015/index.spec.js +24 -0
- package/node_modules/camel-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/camel-case/package.json +89 -0
- package/node_modules/capital-case/LICENSE +21 -0
- package/node_modules/capital-case/README.md +37 -0
- package/node_modules/capital-case/dist/index.d.ts +4 -0
- package/node_modules/capital-case/dist/index.js +16 -0
- package/node_modules/capital-case/dist/index.js.map +1 -0
- package/node_modules/capital-case/dist/index.spec.d.ts +1 -0
- package/node_modules/capital-case/dist/index.spec.js +24 -0
- package/node_modules/capital-case/dist/index.spec.js.map +1 -0
- package/node_modules/capital-case/dist.es2015/index.d.ts +4 -0
- package/node_modules/capital-case/dist.es2015/index.js +11 -0
- package/node_modules/capital-case/dist.es2015/index.js.map +1 -0
- package/node_modules/capital-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/capital-case/dist.es2015/index.spec.js +22 -0
- package/node_modules/capital-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/capital-case/package.json +90 -0
- package/node_modules/change-case/LICENSE +21 -0
- package/node_modules/change-case/README.md +44 -0
- package/node_modules/change-case/dist/index.d.ts +11 -0
- package/node_modules/change-case/dist/index.js +15 -0
- package/node_modules/change-case/dist/index.js.map +1 -0
- package/node_modules/change-case/dist/index.spec.d.ts +1 -0
- package/node_modules/change-case/dist/index.spec.js +9 -0
- package/node_modules/change-case/dist/index.spec.js.map +1 -0
- package/node_modules/change-case/dist.es2015/index.d.ts +11 -0
- package/node_modules/change-case/dist.es2015/index.js +12 -0
- package/node_modules/change-case/dist.es2015/index.js.map +1 -0
- package/node_modules/change-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/change-case/dist.es2015/index.spec.js +7 -0
- package/node_modules/change-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/change-case/package.json +101 -0
- package/node_modules/constant-case/LICENSE +21 -0
- package/node_modules/constant-case/README.md +37 -0
- package/node_modules/constant-case/dist/index.d.ts +3 -0
- package/node_modules/constant-case/dist/index.js +12 -0
- package/node_modules/constant-case/dist/index.js.map +1 -0
- package/node_modules/constant-case/dist/index.spec.d.ts +1 -0
- package/node_modules/constant-case/dist/index.spec.js +26 -0
- package/node_modules/constant-case/dist/index.spec.js.map +1 -0
- package/node_modules/constant-case/dist.es2015/index.d.ts +3 -0
- package/node_modules/constant-case/dist.es2015/index.js +8 -0
- package/node_modules/constant-case/dist.es2015/index.js.map +1 -0
- package/node_modules/constant-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/constant-case/dist.es2015/index.spec.js +24 -0
- package/node_modules/constant-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/constant-case/package.json +90 -0
- package/node_modules/dot-case/LICENSE +21 -0
- package/node_modules/dot-case/README.md +37 -0
- package/node_modules/dot-case/dist/index.d.ts +3 -0
- package/node_modules/dot-case/dist/index.js +11 -0
- package/node_modules/dot-case/dist/index.js.map +1 -0
- package/node_modules/dot-case/dist/index.spec.d.ts +1 -0
- package/node_modules/dot-case/dist/index.spec.js +26 -0
- package/node_modules/dot-case/dist/index.spec.js.map +1 -0
- package/node_modules/dot-case/dist.es2015/index.d.ts +3 -0
- package/node_modules/dot-case/dist.es2015/index.js +7 -0
- package/node_modules/dot-case/dist.es2015/index.js.map +1 -0
- package/node_modules/dot-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/dot-case/dist.es2015/index.spec.js +24 -0
- package/node_modules/dot-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/dot-case/package.json +89 -0
- package/node_modules/fs-extra/LICENSE +15 -0
- package/node_modules/fs-extra/README.md +262 -0
- package/node_modules/fs-extra/lib/copy/copy-sync.js +169 -0
- package/node_modules/fs-extra/lib/copy/copy.js +235 -0
- package/node_modules/fs-extra/lib/copy/index.js +7 -0
- package/node_modules/fs-extra/lib/empty/index.js +39 -0
- package/node_modules/fs-extra/lib/ensure/file.js +69 -0
- package/node_modules/fs-extra/lib/ensure/index.js +23 -0
- package/node_modules/fs-extra/lib/ensure/link.js +64 -0
- package/node_modules/fs-extra/lib/ensure/symlink-paths.js +99 -0
- package/node_modules/fs-extra/lib/ensure/symlink-type.js +31 -0
- package/node_modules/fs-extra/lib/ensure/symlink.js +82 -0
- package/node_modules/fs-extra/lib/fs/index.js +128 -0
- package/node_modules/fs-extra/lib/index.js +16 -0
- package/node_modules/fs-extra/lib/json/index.js +16 -0
- package/node_modules/fs-extra/lib/json/jsonfile.js +11 -0
- package/node_modules/fs-extra/lib/json/output-json-sync.js +12 -0
- package/node_modules/fs-extra/lib/json/output-json.js +12 -0
- package/node_modules/fs-extra/lib/mkdirs/index.js +14 -0
- package/node_modules/fs-extra/lib/mkdirs/make-dir.js +27 -0
- package/node_modules/fs-extra/lib/mkdirs/utils.js +21 -0
- package/node_modules/fs-extra/lib/move/index.js +7 -0
- package/node_modules/fs-extra/lib/move/move-sync.js +54 -0
- package/node_modules/fs-extra/lib/move/move.js +75 -0
- package/node_modules/fs-extra/lib/output-file/index.js +40 -0
- package/node_modules/fs-extra/lib/path-exists/index.js +12 -0
- package/node_modules/fs-extra/lib/remove/index.js +22 -0
- package/node_modules/fs-extra/lib/remove/rimraf.js +302 -0
- package/node_modules/fs-extra/lib/util/stat.js +154 -0
- package/node_modules/fs-extra/lib/util/utimes.js +26 -0
- package/node_modules/fs-extra/package.json +67 -0
- package/node_modules/graceful-fs/LICENSE +15 -0
- package/node_modules/graceful-fs/README.md +143 -0
- package/node_modules/graceful-fs/clone.js +23 -0
- package/node_modules/graceful-fs/graceful-fs.js +448 -0
- package/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/node_modules/graceful-fs/package.json +53 -0
- package/node_modules/graceful-fs/polyfills.js +355 -0
- package/node_modules/header-case/LICENSE +21 -0
- package/node_modules/header-case/README.md +37 -0
- package/node_modules/header-case/dist/index.d.ts +3 -0
- package/node_modules/header-case/dist/index.js +11 -0
- package/node_modules/header-case/dist/index.js.map +1 -0
- package/node_modules/header-case/dist/index.spec.d.ts +1 -0
- package/node_modules/header-case/dist/index.spec.js +24 -0
- package/node_modules/header-case/dist/index.spec.js.map +1 -0
- package/node_modules/header-case/dist.es2015/index.d.ts +3 -0
- package/node_modules/header-case/dist.es2015/index.js +7 -0
- package/node_modules/header-case/dist.es2015/index.js.map +1 -0
- package/node_modules/header-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/header-case/dist.es2015/index.spec.js +22 -0
- package/node_modules/header-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/header-case/package.json +89 -0
- package/node_modules/jsonfile/LICENSE +15 -0
- package/node_modules/jsonfile/README.md +230 -0
- package/node_modules/jsonfile/index.js +88 -0
- package/node_modules/jsonfile/package.json +40 -0
- package/node_modules/jsonfile/utils.js +14 -0
- package/node_modules/lower-case/LICENSE +21 -0
- package/node_modules/lower-case/README.md +35 -0
- package/node_modules/lower-case/dist/index.d.ts +8 -0
- package/node_modules/lower-case/dist/index.js +53 -0
- package/node_modules/lower-case/dist/index.js.map +1 -0
- package/node_modules/lower-case/dist/index.spec.d.ts +1 -0
- package/node_modules/lower-case/dist/index.spec.js +36 -0
- package/node_modules/lower-case/dist/index.spec.js.map +1 -0
- package/node_modules/lower-case/dist.es2015/index.d.ts +8 -0
- package/node_modules/lower-case/dist.es2015/index.js +48 -0
- package/node_modules/lower-case/dist.es2015/index.js.map +1 -0
- package/node_modules/lower-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/lower-case/dist.es2015/index.spec.js +34 -0
- package/node_modules/lower-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/lower-case/package.json +87 -0
- package/node_modules/no-case/LICENSE +21 -0
- package/node_modules/no-case/README.md +37 -0
- package/node_modules/no-case/dist/index.d.ts +10 -0
- package/node_modules/no-case/dist/index.js +35 -0
- package/node_modules/no-case/dist/index.js.map +1 -0
- package/node_modules/no-case/dist/index.spec.d.ts +1 -0
- package/node_modules/no-case/dist/index.spec.js +59 -0
- package/node_modules/no-case/dist/index.spec.js.map +1 -0
- package/node_modules/no-case/dist.es2015/index.d.ts +10 -0
- package/node_modules/no-case/dist.es2015/index.js +31 -0
- package/node_modules/no-case/dist.es2015/index.js.map +1 -0
- package/node_modules/no-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/no-case/dist.es2015/index.spec.js +57 -0
- package/node_modules/no-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/no-case/package.json +85 -0
- package/node_modules/param-case/LICENSE +21 -0
- package/node_modules/param-case/README.md +37 -0
- package/node_modules/param-case/dist/index.d.ts +3 -0
- package/node_modules/param-case/dist/index.js +11 -0
- package/node_modules/param-case/dist/index.js.map +1 -0
- package/node_modules/param-case/dist/index.spec.d.ts +1 -0
- package/node_modules/param-case/dist/index.spec.js +24 -0
- package/node_modules/param-case/dist/index.spec.js.map +1 -0
- package/node_modules/param-case/dist.es2015/index.d.ts +3 -0
- package/node_modules/param-case/dist.es2015/index.js +7 -0
- package/node_modules/param-case/dist.es2015/index.js.map +1 -0
- package/node_modules/param-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/param-case/dist.es2015/index.spec.js +22 -0
- package/node_modules/param-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/param-case/package.json +91 -0
- package/node_modules/pascal-case/LICENSE +21 -0
- package/node_modules/pascal-case/README.md +47 -0
- package/node_modules/pascal-case/dist/index.d.ts +5 -0
- package/node_modules/pascal-case/dist/index.js +24 -0
- package/node_modules/pascal-case/dist/index.js.map +1 -0
- package/node_modules/pascal-case/dist/index.spec.d.ts +1 -0
- package/node_modules/pascal-case/dist/index.spec.js +25 -0
- package/node_modules/pascal-case/dist/index.spec.js.map +1 -0
- package/node_modules/pascal-case/dist.es2015/index.d.ts +5 -0
- package/node_modules/pascal-case/dist.es2015/index.js +18 -0
- package/node_modules/pascal-case/dist.es2015/index.js.map +1 -0
- package/node_modules/pascal-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/pascal-case/dist.es2015/index.spec.js +23 -0
- package/node_modules/pascal-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/pascal-case/package.json +90 -0
- package/node_modules/path-case/LICENSE +21 -0
- package/node_modules/path-case/README.md +37 -0
- package/node_modules/path-case/dist/index.d.ts +3 -0
- package/node_modules/path-case/dist/index.js +11 -0
- package/node_modules/path-case/dist/index.js.map +1 -0
- package/node_modules/path-case/dist/index.spec.d.ts +1 -0
- package/node_modules/path-case/dist/index.spec.js +24 -0
- package/node_modules/path-case/dist/index.spec.js.map +1 -0
- package/node_modules/path-case/dist.es2015/index.d.ts +3 -0
- package/node_modules/path-case/dist.es2015/index.js +7 -0
- package/node_modules/path-case/dist.es2015/index.js.map +1 -0
- package/node_modules/path-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/path-case/dist.es2015/index.spec.js +22 -0
- package/node_modules/path-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/path-case/package.json +88 -0
- package/node_modules/sentence-case/LICENSE +21 -0
- package/node_modules/sentence-case/README.md +37 -0
- package/node_modules/sentence-case/dist/index.d.ts +4 -0
- package/node_modules/sentence-case/dist/index.js +19 -0
- package/node_modules/sentence-case/dist/index.js.map +1 -0
- package/node_modules/sentence-case/dist/index.spec.d.ts +1 -0
- package/node_modules/sentence-case/dist/index.spec.js +24 -0
- package/node_modules/sentence-case/dist/index.spec.js.map +1 -0
- package/node_modules/sentence-case/dist.es2015/index.d.ts +4 -0
- package/node_modules/sentence-case/dist.es2015/index.js +14 -0
- package/node_modules/sentence-case/dist.es2015/index.js.map +1 -0
- package/node_modules/sentence-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/sentence-case/dist.es2015/index.spec.js +22 -0
- package/node_modules/sentence-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/sentence-case/package.json +89 -0
- package/node_modules/snake-case/LICENSE +21 -0
- package/node_modules/snake-case/README.md +37 -0
- package/node_modules/snake-case/dist/index.d.ts +3 -0
- package/node_modules/snake-case/dist/index.js +11 -0
- package/node_modules/snake-case/dist/index.js.map +1 -0
- package/node_modules/snake-case/dist/index.spec.d.ts +1 -0
- package/node_modules/snake-case/dist/index.spec.js +25 -0
- package/node_modules/snake-case/dist/index.spec.js.map +1 -0
- package/node_modules/snake-case/dist.es2015/index.d.ts +3 -0
- package/node_modules/snake-case/dist.es2015/index.js +7 -0
- package/node_modules/snake-case/dist.es2015/index.js.map +1 -0
- package/node_modules/snake-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/snake-case/dist.es2015/index.spec.js +23 -0
- package/node_modules/snake-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/snake-case/package.json +90 -0
- package/node_modules/tslib/CopyrightNotice.txt +15 -0
- package/node_modules/tslib/LICENSE.txt +12 -0
- package/node_modules/tslib/README.md +164 -0
- package/node_modules/tslib/SECURITY.md +41 -0
- package/node_modules/tslib/modules/index.d.ts +38 -0
- package/node_modules/tslib/modules/index.js +70 -0
- package/node_modules/tslib/modules/package.json +3 -0
- package/node_modules/tslib/package.json +47 -0
- package/node_modules/tslib/tslib.d.ts +460 -0
- package/node_modules/tslib/tslib.es6.html +1 -0
- package/node_modules/tslib/tslib.es6.js +402 -0
- package/node_modules/tslib/tslib.es6.mjs +401 -0
- package/node_modules/tslib/tslib.html +1 -0
- package/node_modules/tslib/tslib.js +484 -0
- package/node_modules/universalify/LICENSE +20 -0
- package/node_modules/universalify/README.md +76 -0
- package/node_modules/universalify/index.js +24 -0
- package/node_modules/universalify/package.json +34 -0
- package/node_modules/upper-case/README.md +34 -0
- package/node_modules/upper-case/dist/index.d.ts +8 -0
- package/node_modules/upper-case/dist/index.js +49 -0
- package/node_modules/upper-case/dist/index.js.map +1 -0
- package/node_modules/upper-case/dist/index.spec.d.ts +1 -0
- package/node_modules/upper-case/dist/index.spec.js +34 -0
- package/node_modules/upper-case/dist/index.spec.js.map +1 -0
- package/node_modules/upper-case/dist.es2015/index.d.ts +8 -0
- package/node_modules/upper-case/dist.es2015/index.js +44 -0
- package/node_modules/upper-case/dist.es2015/index.js.map +1 -0
- package/node_modules/upper-case/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/upper-case/dist.es2015/index.spec.js +32 -0
- package/node_modules/upper-case/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/upper-case/package.json +86 -0
- package/node_modules/upper-case-first/LICENSE +21 -0
- package/node_modules/upper-case-first/README.md +32 -0
- package/node_modules/upper-case-first/dist/index.d.ts +4 -0
- package/node_modules/upper-case-first/dist/index.js +11 -0
- package/node_modules/upper-case-first/dist/index.js.map +1 -0
- package/node_modules/upper-case-first/dist/index.spec.d.ts +1 -0
- package/node_modules/upper-case-first/dist/index.spec.js +20 -0
- package/node_modules/upper-case-first/dist/index.spec.js.map +1 -0
- package/node_modules/upper-case-first/dist.es2015/index.d.ts +4 -0
- package/node_modules/upper-case-first/dist.es2015/index.js +7 -0
- package/node_modules/upper-case-first/dist.es2015/index.js.map +1 -0
- package/node_modules/upper-case-first/dist.es2015/index.spec.d.ts +1 -0
- package/node_modules/upper-case-first/dist.es2015/index.spec.js +18 -0
- package/node_modules/upper-case-first/dist.es2015/index.spec.js.map +1 -0
- package/node_modules/upper-case-first/package.json +87 -0
- package/package.json +181 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) HashiCorp, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ShouldReleaseScriptFile = void 0;
|
|
8
|
+
const projen_1 = require("projen");
|
|
9
|
+
class ShouldReleaseScriptFile extends projen_1.FileBase {
|
|
10
|
+
constructor(project, options) {
|
|
11
|
+
super(project, "scripts/should-release.js", options);
|
|
12
|
+
this.options = options;
|
|
13
|
+
}
|
|
14
|
+
synthesizeContent() {
|
|
15
|
+
return `
|
|
16
|
+
/**
|
|
17
|
+
* Copyright (c) HashiCorp, Inc.
|
|
18
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
19
|
+
*/
|
|
20
|
+
// Note: This script is currently not handling pre-releases
|
|
21
|
+
const execSync = require("child_process").execSync;
|
|
22
|
+
|
|
23
|
+
(async function main() {
|
|
24
|
+
console.log(
|
|
25
|
+
"Determining whether changes warrant a new release. Non-zero exit code indicates that a release should be skipped"
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
// inspired by https://github.com/projen/projen/blob/08378c40d1453288053abcddce82475329b4506e/src/release/bump-version.ts#L281
|
|
29
|
+
const prefixFilter = \`v*\`;
|
|
30
|
+
const listGitTags = [
|
|
31
|
+
"git",
|
|
32
|
+
'-c "versionsort.suffix=-"', // makes sure pre-release versions are listed after the primary version
|
|
33
|
+
"tag",
|
|
34
|
+
'--sort="-version:refname"', // sort as versions and not lexicographically
|
|
35
|
+
"--list",
|
|
36
|
+
\`"\${prefixFilter}"\`,
|
|
37
|
+
].join(" ");
|
|
38
|
+
|
|
39
|
+
const stdout = execSync(listGitTags).toString();
|
|
40
|
+
const tags = stdout.split("\\n");
|
|
41
|
+
|
|
42
|
+
if (tags.length > 0 && tags[0].trim() !== "") {
|
|
43
|
+
const latestTag = tags[0];
|
|
44
|
+
console.log(\`Found latest tag \${latestTag}\`);
|
|
45
|
+
|
|
46
|
+
const previousPackageJsonGit = [
|
|
47
|
+
"git",
|
|
48
|
+
"show",
|
|
49
|
+
\`\${latestTag}:package.json\`,
|
|
50
|
+
].join(" ");
|
|
51
|
+
const prevPackageJson = JSON.parse(
|
|
52
|
+
execSync(previousPackageJsonGit).toString()
|
|
53
|
+
);
|
|
54
|
+
const currPackageJson = require("../package.json");
|
|
55
|
+
|
|
56
|
+
const thingsToDiff = [
|
|
57
|
+
{
|
|
58
|
+
name: "Terraform provider version",
|
|
59
|
+
previous: prevPackageJson.cdktf.provider.version,
|
|
60
|
+
current: currPackageJson.cdktf.provider.version,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "cdktf peer dependency",
|
|
64
|
+
previous: prevPackageJson.peerDependencies.cdktf,
|
|
65
|
+
current: currPackageJson.peerDependencies.cdktf,
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
thingsToDiff.forEach((x) =>
|
|
70
|
+
console.log(
|
|
71
|
+
\`\${x.name}: \${x.previous} => \${x.current} \${
|
|
72
|
+
x.current !== x.previous ? "<<CHANGED" : ""
|
|
73
|
+
}\`
|
|
74
|
+
)
|
|
75
|
+
);
|
|
76
|
+
const changes = thingsToDiff.some((x) => x.previous !== x.current);
|
|
77
|
+
if (changes) {
|
|
78
|
+
console.log(
|
|
79
|
+
"Found one or more relevant changes, not skipping the release."
|
|
80
|
+
);
|
|
81
|
+
} else {
|
|
82
|
+
console.log(
|
|
83
|
+
"No changes in versions detected, skipping the release via exit code 1"
|
|
84
|
+
);
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
console.log(
|
|
89
|
+
"No git tags found, this seems to be the first release, hence not skipping it."
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
})();`;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.ShouldReleaseScriptFile = ShouldReleaseScriptFile;
|
|
96
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hvdWxkLXJlbGVhc2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2NyaXB0cy9zaG91bGQtcmV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gIGNvbnNvbGUubG9nKFxuICAgICAgICBcIk5vIGNoYW5nZXMgaW4gdmVyc2lvbnMgZGV0ZWN0ZWQsIHNraXBwaW5nIHRoZSByZWxlYXNlIHZpYSBleGl0IGNvZGUgMVwiXG4gICAgICApO1xuICAgICAgcHJvY2Vzcy5leGl0KDEpO1xuICAgIH1cbiAgfSBlbHNlIHtcbiAgICBjb25zb2xlLmxvZyhcbiAgICAgIFwiTm8gZ2l0IHRhZ3MgZm91bmQsIHRoaXMgc2VlbXMgdG8gYmUgdGhlIGZpcnN0IHJlbGVhc2UsIGhlbmNlIG5vdCBza2lwcGluZyBpdC5cIlxuICAgICk7XG4gIH1cbn0pKCk7YDtcbiAgfVxufVxuIl19
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { javascript } from "projen";
|
|
6
|
+
export declare enum Schedule {
|
|
7
|
+
Daily = "DAILY",
|
|
8
|
+
Weekly = "WEEKLY",
|
|
9
|
+
Monthly = "MONTHLY",
|
|
10
|
+
Weekdays = "WEEKDAYS"
|
|
11
|
+
}
|
|
12
|
+
export interface RandomCronOptions {
|
|
13
|
+
project: javascript.NodeProject;
|
|
14
|
+
maxHour?: number;
|
|
15
|
+
hourOffset?: number;
|
|
16
|
+
schedule?: Schedule;
|
|
17
|
+
}
|
|
18
|
+
export declare function generateRandomCron(options: RandomCronOptions): string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) HashiCorp, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.Schedule = void 0;
|
|
8
|
+
exports.generateRandomCron = generateRandomCron;
|
|
9
|
+
const crypto_1 = require("crypto");
|
|
10
|
+
var Schedule;
|
|
11
|
+
(function (Schedule) {
|
|
12
|
+
Schedule["Daily"] = "DAILY";
|
|
13
|
+
Schedule["Weekly"] = "WEEKLY";
|
|
14
|
+
Schedule["Monthly"] = "MONTHLY";
|
|
15
|
+
Schedule["Weekdays"] = "WEEKDAYS";
|
|
16
|
+
})(Schedule || (exports.Schedule = Schedule = {}));
|
|
17
|
+
function generateRandomCron(options) {
|
|
18
|
+
const maxHour = typeof options.maxHour !== "undefined" ? Math.round(options.maxHour) : 24;
|
|
19
|
+
const hourOffset = options.hourOffset ? Math.round(options.hourOffset) : 0;
|
|
20
|
+
const schedule = options.schedule || Schedule.Daily; // default to daily
|
|
21
|
+
const project = options.project;
|
|
22
|
+
const hash = (0, crypto_1.createHash)("md5").update(project.name).digest("hex");
|
|
23
|
+
const hour = maxHour === 0 ? 0 : parseInt(hash.slice(0, 2), 16) % maxHour;
|
|
24
|
+
const minute = parseInt(hash.slice(2, 4), 16) % 60;
|
|
25
|
+
const dayOfMonth = schedule === Schedule.Monthly ? "1" : "*";
|
|
26
|
+
const dayOfWeek = schedule === Schedule.Weekly
|
|
27
|
+
? "1"
|
|
28
|
+
: schedule === Schedule.Weekdays
|
|
29
|
+
? "1-5"
|
|
30
|
+
: "*";
|
|
31
|
+
return `${minute} ${(hour + hourOffset) % 24} ${dayOfMonth} * ${dayOfWeek}`;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFuZG9tLWNyb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbC9yYW5kb20tY3Jvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7OztHQUdHOzs7QUFtQkgsZ0RBb0JDO0FBckNELG1DQUFvQztBQUdwQyxJQUFZLFFBS1g7QUFMRCxXQUFZLFFBQVE7SUFDbEIsMkJBQWUsQ0FBQTtJQUNmLDZ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FNjaGVkdWxlLldlZWtkYXlzXG4gICAgICA/IFwiMS01XCJcbiAgICAgIDogXCIqXCI7XG5cbiAgcmV0dXJuIGAke21pbnV0ZX0gJHsoaG91ciArIGhvdXJPZmZzZXQpICUgMjR9ICR7ZGF5T2ZNb250aH0gKiAke2RheU9mV2Vla31gO1xufVxuIl19
|
package/mise.toml
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
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,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Camel Case
|
|
2
|
+
|
|
3
|
+
[![NPM version][npm-image]][npm-url]
|
|
4
|
+
[![NPM downloads][downloads-image]][downloads-url]
|
|
5
|
+
[![Bundle size][bundlephobia-image]][bundlephobia-url]
|
|
6
|
+
|
|
7
|
+
> Transform into a string with the separator denoted by the next word capitalized.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
npm install camel-case --save
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import { camelCase } from "camel-case";
|
|
19
|
+
|
|
20
|
+
camelCase("string"); //=> "string"
|
|
21
|
+
camelCase("dot.case"); //=> "dotCase"
|
|
22
|
+
camelCase("PascalCase"); //=> "pascalCase"
|
|
23
|
+
camelCase("version 1.2.10"); //=> "version_1_2_10"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The function also accepts [`options`](https://github.com/blakeembrey/change-case#options).
|
|
27
|
+
|
|
28
|
+
### Merge Numbers
|
|
29
|
+
|
|
30
|
+
If you'd like to remove the behavior prefixing `_` before numbers, you can use `camelCaseTransformMerge`:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { camelCaseTransformMerge } from "camel-case";
|
|
34
|
+
|
|
35
|
+
camelCase("version 12", { transform: camelCaseTransformMerge }); //=> "version12"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
MIT
|
|
41
|
+
|
|
42
|
+
[npm-image]: https://img.shields.io/npm/v/camel-case.svg?style=flat
|
|
43
|
+
[npm-url]: https://npmjs.org/package/camel-case
|
|
44
|
+
[downloads-image]: https://img.shields.io/npm/dm/camel-case.svg?style=flat
|
|
45
|
+
[downloads-url]: https://npmjs.org/package/camel-case
|
|
46
|
+
[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/camel-case.svg
|
|
47
|
+
[bundlephobia-url]: https://bundlephobia.com/result?p=camel-case
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Options } from "pascal-case";
|
|
2
|
+
export { Options };
|
|
3
|
+
export declare function camelCaseTransform(input: string, index: number): string;
|
|
4
|
+
export declare function camelCaseTransformMerge(input: string, index: number): string;
|
|
5
|
+
export declare function camelCase(input: string, options?: Options): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.camelCase = exports.camelCaseTransformMerge = exports.camelCaseTransform = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var pascal_case_1 = require("pascal-case");
|
|
6
|
+
function camelCaseTransform(input, index) {
|
|
7
|
+
if (index === 0)
|
|
8
|
+
return input.toLowerCase();
|
|
9
|
+
return pascal_case_1.pascalCaseTransform(input, index);
|
|
10
|
+
}
|
|
11
|
+
exports.camelCaseTransform = camelCaseTransform;
|
|
12
|
+
function camelCaseTransformMerge(input, index) {
|
|
13
|
+
if (index === 0)
|
|
14
|
+
return input.toLowerCase();
|
|
15
|
+
return pascal_case_1.pascalCaseTransformMerge(input);
|
|
16
|
+
}
|
|
17
|
+
exports.camelCaseTransformMerge = camelCaseTransformMerge;
|
|
18
|
+
function camelCase(input, options) {
|
|
19
|
+
if (options === void 0) { options = {}; }
|
|
20
|
+
return pascal_case_1.pascalCase(input, tslib_1.__assign({ transform: camelCaseTransform }, options));
|
|
21
|
+
}
|
|
22
|
+
exports.camelCase = camelCase;
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,2CAKqB;AAIrB,SAAgB,kBAAkB,CAAC,KAAa,EAAE,KAAa;IAC7D,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;IAC5C,OAAO,iCAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC3C,CAAC;AAHD,gDAGC;AAED,SAAgB,uBAAuB,CAAC,KAAa,EAAE,KAAa;IAClE,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;IAC5C,OAAO,sCAAwB,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAHD,0DAGC;AAED,SAAgB,SAAS,CAAC,KAAa,EAAE,OAAqB;IAArB,wBAAA,EAAA,YAAqB;IAC5D,OAAO,wBAAU,CAAC,KAAK,qBACrB,SAAS,EAAE,kBAAkB,IAC1B,OAAO,EACV,CAAC;AACL,CAAC;AALD,8BAKC","sourcesContent":["import {\n pascalCase,\n pascalCaseTransform,\n pascalCaseTransformMerge,\n Options,\n} from \"pascal-case\";\n\nexport { Options };\n\nexport function camelCaseTransform(input: string, index: number) {\n if (index === 0) return input.toLowerCase();\n return pascalCaseTransform(input, index);\n}\n\nexport function camelCaseTransformMerge(input: string, index: number) {\n if (index === 0) return input.toLowerCase();\n return pascalCaseTransformMerge(input);\n}\n\nexport function camelCase(input: string, options: Options = {}) {\n return pascalCase(input, {\n transform: camelCaseTransform,\n ...options,\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var _1 = require(".");
|
|
4
|
+
var TEST_CASES = [
|
|
5
|
+
["", ""],
|
|
6
|
+
["test", "test"],
|
|
7
|
+
["test string", "testString"],
|
|
8
|
+
["Test String", "testString"],
|
|
9
|
+
["TestV2", "testV2"],
|
|
10
|
+
["_foo_bar_", "fooBar"],
|
|
11
|
+
["version 1.2.10", "version_1_2_10"],
|
|
12
|
+
["version 1.21.0", "version_1_21_0"],
|
|
13
|
+
["version 1.2.10", "version1210", { transform: _1.camelCaseTransformMerge }],
|
|
14
|
+
];
|
|
15
|
+
describe("camel case", function () {
|
|
16
|
+
var _loop_1 = function (input, result, options) {
|
|
17
|
+
it(input + " -> " + result, function () {
|
|
18
|
+
expect(_1.camelCase(input, options)).toEqual(result);
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
for (var _i = 0, TEST_CASES_1 = TEST_CASES; _i < TEST_CASES_1.length; _i++) {
|
|
22
|
+
var _a = TEST_CASES_1[_i], input = _a[0], result = _a[1], options = _a[2];
|
|
23
|
+
_loop_1(input, result, options);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=index.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":";;AAAA,sBAAgE;AAEhE,IAAM,UAAU,GAAiC;IAC/C,CAAC,EAAE,EAAE,EAAE,CAAC;IACR,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,aAAa,EAAE,YAAY,CAAC;IAC7B,CAAC,aAAa,EAAE,YAAY,CAAC;IAC7B,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACpB,CAAC,WAAW,EAAE,QAAQ,CAAC;IACvB,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IACpC,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IACpC,CAAC,gBAAgB,EAAE,aAAa,EAAE,EAAE,SAAS,EAAE,0BAAuB,EAAE,CAAC;CAC1E,CAAC;AAEF,QAAQ,CAAC,YAAY,EAAE;4BACT,KAAK,EAAE,MAAM,EAAE,OAAO;QAChC,EAAE,CAAI,KAAK,YAAO,MAAQ,EAAE;YAC1B,MAAM,CAAC,YAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;;IAHL,KAAuC,UAAU,EAAV,yBAAU,EAAV,wBAAU,EAAV,IAAU;QAAtC,IAAA,qBAAwB,EAAvB,KAAK,QAAA,EAAE,MAAM,QAAA,EAAE,OAAO,QAAA;gBAAtB,KAAK,EAAE,MAAM,EAAE,OAAO;KAIjC;AACH,CAAC,CAAC,CAAC","sourcesContent":["import { camelCase, camelCaseTransformMerge, Options } from \".\";\n\nconst TEST_CASES: [string, string, Options?][] = [\n [\"\", \"\"],\n [\"test\", \"test\"],\n [\"test string\", \"testString\"],\n [\"Test String\", \"testString\"],\n [\"TestV2\", \"testV2\"],\n [\"_foo_bar_\", \"fooBar\"],\n [\"version 1.2.10\", \"version_1_2_10\"],\n [\"version 1.21.0\", \"version_1_21_0\"],\n [\"version 1.2.10\", \"version1210\", { transform: camelCaseTransformMerge }],\n];\n\ndescribe(\"camel case\", () => {\n for (const [input, result, options] of TEST_CASES) {\n it(`${input} -> ${result}`, () => {\n expect(camelCase(input, options)).toEqual(result);\n });\n }\n});\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Options } from "pascal-case";
|
|
2
|
+
export { Options };
|
|
3
|
+
export declare function camelCaseTransform(input: string, index: number): string;
|
|
4
|
+
export declare function camelCaseTransformMerge(input: string, index: number): string;
|
|
5
|
+
export declare function camelCase(input: string, options?: Options): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { pascalCase, pascalCaseTransform, pascalCaseTransformMerge, } from "pascal-case";
|
|
3
|
+
export function camelCaseTransform(input, index) {
|
|
4
|
+
if (index === 0)
|
|
5
|
+
return input.toLowerCase();
|
|
6
|
+
return pascalCaseTransform(input, index);
|
|
7
|
+
}
|
|
8
|
+
export function camelCaseTransformMerge(input, index) {
|
|
9
|
+
if (index === 0)
|
|
10
|
+
return input.toLowerCase();
|
|
11
|
+
return pascalCaseTransformMerge(input);
|
|
12
|
+
}
|
|
13
|
+
export function camelCase(input, options) {
|
|
14
|
+
if (options === void 0) { options = {}; }
|
|
15
|
+
return pascalCase(input, __assign({ transform: camelCaseTransform }, options));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,wBAAwB,GAEzB,MAAM,aAAa,CAAC;AAIrB,MAAM,UAAU,kBAAkB,CAAC,KAAa,EAAE,KAAa;IAC7D,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;IAC5C,OAAO,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,KAAa,EAAE,KAAa;IAClE,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;IAC5C,OAAO,wBAAwB,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAa,EAAE,OAAqB;IAArB,wBAAA,EAAA,YAAqB;IAC5D,OAAO,UAAU,CAAC,KAAK,aACrB,SAAS,EAAE,kBAAkB,IAC1B,OAAO,EACV,CAAC;AACL,CAAC","sourcesContent":["import {\n pascalCase,\n pascalCaseTransform,\n pascalCaseTransformMerge,\n Options,\n} from \"pascal-case\";\n\nexport { Options };\n\nexport function camelCaseTransform(input: string, index: number) {\n if (index === 0) return input.toLowerCase();\n return pascalCaseTransform(input, index);\n}\n\nexport function camelCaseTransformMerge(input: string, index: number) {\n if (index === 0) return input.toLowerCase();\n return pascalCaseTransformMerge(input);\n}\n\nexport function camelCase(input: string, options: Options = {}) {\n return pascalCase(input, {\n transform: camelCaseTransform,\n ...options,\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { camelCase, camelCaseTransformMerge } from ".";
|
|
2
|
+
var TEST_CASES = [
|
|
3
|
+
["", ""],
|
|
4
|
+
["test", "test"],
|
|
5
|
+
["test string", "testString"],
|
|
6
|
+
["Test String", "testString"],
|
|
7
|
+
["TestV2", "testV2"],
|
|
8
|
+
["_foo_bar_", "fooBar"],
|
|
9
|
+
["version 1.2.10", "version_1_2_10"],
|
|
10
|
+
["version 1.21.0", "version_1_21_0"],
|
|
11
|
+
["version 1.2.10", "version1210", { transform: camelCaseTransformMerge }],
|
|
12
|
+
];
|
|
13
|
+
describe("camel case", function () {
|
|
14
|
+
var _loop_1 = function (input, result, options) {
|
|
15
|
+
it(input + " -> " + result, function () {
|
|
16
|
+
expect(camelCase(input, options)).toEqual(result);
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
for (var _i = 0, TEST_CASES_1 = TEST_CASES; _i < TEST_CASES_1.length; _i++) {
|
|
20
|
+
var _a = TEST_CASES_1[_i], input = _a[0], result = _a[1], options = _a[2];
|
|
21
|
+
_loop_1(input, result, options);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=index.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAW,MAAM,GAAG,CAAC;AAEhE,IAAM,UAAU,GAAiC;IAC/C,CAAC,EAAE,EAAE,EAAE,CAAC;IACR,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,aAAa,EAAE,YAAY,CAAC;IAC7B,CAAC,aAAa,EAAE,YAAY,CAAC;IAC7B,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACpB,CAAC,WAAW,EAAE,QAAQ,CAAC;IACvB,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IACpC,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IACpC,CAAC,gBAAgB,EAAE,aAAa,EAAE,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;CAC1E,CAAC;AAEF,QAAQ,CAAC,YAAY,EAAE;4BACT,KAAK,EAAE,MAAM,EAAE,OAAO;QAChC,EAAE,CAAI,KAAK,YAAO,MAAQ,EAAE;YAC1B,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;;IAHL,KAAuC,UAAU,EAAV,yBAAU,EAAV,wBAAU,EAAV,IAAU;QAAtC,IAAA,qBAAwB,EAAvB,KAAK,QAAA,EAAE,MAAM,QAAA,EAAE,OAAO,QAAA;gBAAtB,KAAK,EAAE,MAAM,EAAE,OAAO;KAIjC;AACH,CAAC,CAAC,CAAC","sourcesContent":["import { camelCase, camelCaseTransformMerge, Options } from \".\";\n\nconst TEST_CASES: [string, string, Options?][] = [\n [\"\", \"\"],\n [\"test\", \"test\"],\n [\"test string\", \"testString\"],\n [\"Test String\", \"testString\"],\n [\"TestV2\", \"testV2\"],\n [\"_foo_bar_\", \"fooBar\"],\n [\"version 1.2.10\", \"version_1_2_10\"],\n [\"version 1.21.0\", \"version_1_21_0\"],\n [\"version 1.2.10\", \"version1210\", { transform: camelCaseTransformMerge }],\n];\n\ndescribe(\"camel case\", () => {\n for (const [input, result, options] of TEST_CASES) {\n it(`${input} -> ${result}`, () => {\n expect(camelCase(input, options)).toEqual(result);\n });\n }\n});\n"]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "camel-case",
|
|
3
|
+
"version": "4.1.2",
|
|
4
|
+
"description": "Transform into a string with the separator denoted by the next word capitalized",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"typings": "dist/index.d.ts",
|
|
7
|
+
"module": "dist.es2015/index.js",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"jsnext:main": "dist.es2015/index.js",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/",
|
|
12
|
+
"dist.es2015/",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"lint": "tslint \"src/**/*\" --project tsconfig.json",
|
|
17
|
+
"build": "rimraf dist/ dist.es2015/ && tsc && tsc -P tsconfig.es2015.json",
|
|
18
|
+
"specs": "jest --coverage",
|
|
19
|
+
"test": "npm run build && npm run lint && npm run specs",
|
|
20
|
+
"size": "size-limit",
|
|
21
|
+
"prepare": "npm run build"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git://github.com/blakeembrey/change-case.git"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"camel",
|
|
29
|
+
"case",
|
|
30
|
+
"camelcase",
|
|
31
|
+
"camel-case",
|
|
32
|
+
"convert",
|
|
33
|
+
"transform",
|
|
34
|
+
"identifier"
|
|
35
|
+
],
|
|
36
|
+
"author": {
|
|
37
|
+
"name": "Blake Embrey",
|
|
38
|
+
"email": "hello@blakeembrey.com",
|
|
39
|
+
"url": "http://blakeembrey.me"
|
|
40
|
+
},
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/blakeembrey/change-case/issues"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://github.com/blakeembrey/change-case/tree/master/packages/camel-case#readme",
|
|
46
|
+
"size-limit": [
|
|
47
|
+
{
|
|
48
|
+
"path": "dist/index.js",
|
|
49
|
+
"limit": "450 B"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"jest": {
|
|
53
|
+
"roots": [
|
|
54
|
+
"<rootDir>/src/"
|
|
55
|
+
],
|
|
56
|
+
"transform": {
|
|
57
|
+
"\\.tsx?$": "ts-jest"
|
|
58
|
+
},
|
|
59
|
+
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$",
|
|
60
|
+
"moduleFileExtensions": [
|
|
61
|
+
"ts",
|
|
62
|
+
"tsx",
|
|
63
|
+
"js",
|
|
64
|
+
"jsx",
|
|
65
|
+
"json",
|
|
66
|
+
"node"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"publishConfig": {
|
|
70
|
+
"access": "public"
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"pascal-case": "^3.1.2",
|
|
74
|
+
"tslib": "^2.0.3"
|
|
75
|
+
},
|
|
76
|
+
"devDependencies": {
|
|
77
|
+
"@size-limit/preset-small-lib": "^2.2.1",
|
|
78
|
+
"@types/jest": "^24.0.23",
|
|
79
|
+
"@types/node": "^12.12.14",
|
|
80
|
+
"jest": "^24.9.0",
|
|
81
|
+
"rimraf": "^3.0.0",
|
|
82
|
+
"ts-jest": "^24.2.0",
|
|
83
|
+
"tslint": "^5.20.1",
|
|
84
|
+
"tslint-config-prettier": "^1.18.0",
|
|
85
|
+
"tslint-config-standard": "^9.0.0",
|
|
86
|
+
"typescript": "^4.1.2"
|
|
87
|
+
},
|
|
88
|
+
"gitHead": "76a21a7f6f2a226521ef6abd345ff309cbd01fb0"
|
|
89
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
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,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Capital Case
|
|
2
|
+
|
|
3
|
+
[![NPM version][npm-image]][npm-url]
|
|
4
|
+
[![NPM downloads][downloads-image]][downloads-url]
|
|
5
|
+
[![Bundle size][bundlephobia-image]][bundlephobia-url]
|
|
6
|
+
|
|
7
|
+
> Transform into a space separated string with each word capitalized.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
npm install capital-case --save
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import { capitalCase } from "capital-case";
|
|
19
|
+
|
|
20
|
+
capitalCase("string"); //=> "String"
|
|
21
|
+
capitalCase("dot.case"); //=> "Dot Case"
|
|
22
|
+
capitalCase("PascalCase"); //=> "Pascal Case"
|
|
23
|
+
capitalCase("version 1.2.10"); //=> "Version 1 2 10"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The function also accepts [`options`](https://github.com/blakeembrey/change-case#options).
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
|
|
30
|
+
MIT
|
|
31
|
+
|
|
32
|
+
[npm-image]: https://img.shields.io/npm/v/capital-case.svg?style=flat
|
|
33
|
+
[npm-url]: https://npmjs.org/package/capital-case
|
|
34
|
+
[downloads-image]: https://img.shields.io/npm/dm/capital-case.svg?style=flat
|
|
35
|
+
[downloads-url]: https://npmjs.org/package/capital-case
|
|
36
|
+
[bundlephobia-image]: https://img.shields.io/bundlephobia/minzip/capital-case.svg
|
|
37
|
+
[bundlephobia-url]: https://bundlephobia.com/result?p=capital-case
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.capitalCase = exports.capitalCaseTransform = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var no_case_1 = require("no-case");
|
|
6
|
+
var upper_case_first_1 = require("upper-case-first");
|
|
7
|
+
function capitalCaseTransform(input) {
|
|
8
|
+
return upper_case_first_1.upperCaseFirst(input.toLowerCase());
|
|
9
|
+
}
|
|
10
|
+
exports.capitalCaseTransform = capitalCaseTransform;
|
|
11
|
+
function capitalCase(input, options) {
|
|
12
|
+
if (options === void 0) { options = {}; }
|
|
13
|
+
return no_case_1.noCase(input, tslib_1.__assign({ delimiter: " ", transform: capitalCaseTransform }, options));
|
|
14
|
+
}
|
|
15
|
+
exports.capitalCase = capitalCase;
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,mCAA0C;AAC1C,qDAAkD;AAIlD,SAAgB,oBAAoB,CAAC,KAAa;IAChD,OAAO,iCAAc,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;AAC7C,CAAC;AAFD,oDAEC;AAED,SAAgB,WAAW,CAAC,KAAa,EAAE,OAAqB;IAArB,wBAAA,EAAA,YAAqB;IAC9D,OAAO,gBAAM,CAAC,KAAK,qBACjB,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,oBAAoB,IAC5B,OAAO,EACV,CAAC;AACL,CAAC;AAND,kCAMC","sourcesContent":["import { noCase, Options } from \"no-case\";\nimport { upperCaseFirst } from \"upper-case-first\";\n\nexport { Options };\n\nexport function capitalCaseTransform(input: string) {\n return upperCaseFirst(input.toLowerCase());\n}\n\nexport function capitalCase(input: string, options: Options = {}) {\n return noCase(input, {\n delimiter: \" \",\n transform: capitalCaseTransform,\n ...options,\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var _1 = require(".");
|
|
4
|
+
var TEST_CASES = [
|
|
5
|
+
["", ""],
|
|
6
|
+
["test", "Test"],
|
|
7
|
+
["test string", "Test String"],
|
|
8
|
+
["Test String", "Test String"],
|
|
9
|
+
["TestV2", "Test V2"],
|
|
10
|
+
["version 1.2.10", "Version 1 2 10"],
|
|
11
|
+
["version 1.21.0", "Version 1 21 0"],
|
|
12
|
+
];
|
|
13
|
+
describe("capital case", function () {
|
|
14
|
+
var _loop_1 = function (input, result) {
|
|
15
|
+
it(input + " -> " + result, function () {
|
|
16
|
+
expect(_1.capitalCase(input)).toEqual(result);
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
for (var _i = 0, TEST_CASES_1 = TEST_CASES; _i < TEST_CASES_1.length; _i++) {
|
|
20
|
+
var _a = TEST_CASES_1[_i], input = _a[0], result = _a[1];
|
|
21
|
+
_loop_1(input, result);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=index.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":";;AAAA,sBAAgC;AAEhC,IAAM,UAAU,GAAuB;IACrC,CAAC,EAAE,EAAE,EAAE,CAAC;IACR,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,aAAa,EAAE,aAAa,CAAC;IAC9B,CAAC,aAAa,EAAE,aAAa,CAAC;IAC9B,CAAC,QAAQ,EAAE,SAAS,CAAC;IACrB,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IACpC,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;CACrC,CAAC;AAEF,QAAQ,CAAC,cAAc,EAAE;4BACX,KAAK,EAAE,MAAM;QACvB,EAAE,CAAI,KAAK,YAAO,MAAQ,EAAE;YAC1B,MAAM,CAAC,cAAW,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;;IAHL,KAA8B,UAAU,EAAV,yBAAU,EAAV,wBAAU,EAAV,IAAU;QAA7B,IAAA,qBAAe,EAAd,KAAK,QAAA,EAAE,MAAM,QAAA;gBAAb,KAAK,EAAE,MAAM;KAIxB;AACH,CAAC,CAAC,CAAC","sourcesContent":["import { capitalCase } from \".\";\n\nconst TEST_CASES: [string, string][] = [\n [\"\", \"\"],\n [\"test\", \"Test\"],\n [\"test string\", \"Test String\"],\n [\"Test String\", \"Test String\"],\n [\"TestV2\", \"Test V2\"],\n [\"version 1.2.10\", \"Version 1 2 10\"],\n [\"version 1.21.0\", \"Version 1 21 0\"],\n];\n\ndescribe(\"capital case\", () => {\n for (const [input, result] of TEST_CASES) {\n it(`${input} -> ${result}`, () => {\n expect(capitalCase(input)).toEqual(result);\n });\n }\n});\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { __assign } from "tslib";
|
|
2
|
+
import { noCase } from "no-case";
|
|
3
|
+
import { upperCaseFirst } from "upper-case-first";
|
|
4
|
+
export function capitalCaseTransform(input) {
|
|
5
|
+
return upperCaseFirst(input.toLowerCase());
|
|
6
|
+
}
|
|
7
|
+
export function capitalCase(input, options) {
|
|
8
|
+
if (options === void 0) { options = {}; }
|
|
9
|
+
return noCase(input, __assign({ delimiter: " ", transform: capitalCaseTransform }, options));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAW,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,OAAO,cAAc,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAa,EAAE,OAAqB;IAArB,wBAAA,EAAA,YAAqB;IAC9D,OAAO,MAAM,CAAC,KAAK,aACjB,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,oBAAoB,IAC5B,OAAO,EACV,CAAC;AACL,CAAC","sourcesContent":["import { noCase, Options } from \"no-case\";\nimport { upperCaseFirst } from \"upper-case-first\";\n\nexport { Options };\n\nexport function capitalCaseTransform(input: string) {\n return upperCaseFirst(input.toLowerCase());\n}\n\nexport function capitalCase(input: string, options: Options = {}) {\n return noCase(input, {\n delimiter: \" \",\n transform: capitalCaseTransform,\n ...options,\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { capitalCase } from ".";
|
|
2
|
+
var TEST_CASES = [
|
|
3
|
+
["", ""],
|
|
4
|
+
["test", "Test"],
|
|
5
|
+
["test string", "Test String"],
|
|
6
|
+
["Test String", "Test String"],
|
|
7
|
+
["TestV2", "Test V2"],
|
|
8
|
+
["version 1.2.10", "Version 1 2 10"],
|
|
9
|
+
["version 1.21.0", "Version 1 21 0"],
|
|
10
|
+
];
|
|
11
|
+
describe("capital case", function () {
|
|
12
|
+
var _loop_1 = function (input, result) {
|
|
13
|
+
it(input + " -> " + result, function () {
|
|
14
|
+
expect(capitalCase(input)).toEqual(result);
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
for (var _i = 0, TEST_CASES_1 = TEST_CASES; _i < TEST_CASES_1.length; _i++) {
|
|
18
|
+
var _a = TEST_CASES_1[_i], input = _a[0], result = _a[1];
|
|
19
|
+
_loop_1(input, result);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=index.spec.js.map
|