@cdktn/provider-schema 0.21.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/README.md +3 -0
- package/ambient.d.ts +10 -0
- package/eslint.config.mjs +75 -0
- package/jest.config.js +19 -0
- package/package.json +70 -0
- package/src/__tests__/__snapshots__/provider-schema.test.ts.snap +864 -0
- package/src/__tests__/fixtures/local-json-module/module.tf.json +17 -0
- package/src/__tests__/fixtures/local-module/module.tf +33 -0
- package/src/__tests__/provider-schema.test.d.ts +2 -0
- package/src/__tests__/provider-schema.test.d.ts.map +1 -0
- package/src/__tests__/provider-schema.test.js +170 -0
- package/src/cache.d.ts +7 -0
- package/src/cache.d.ts.map +1 -0
- package/src/cache.js +66 -0
- package/src/index.d.ts +7 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +12 -0
- package/src/provider-schema.d.ts +45 -0
- package/src/provider-schema.d.ts.map +1 -0
- package/src/provider-schema.js +218 -0
- package/src/read.d.ts +13 -0
- package/src/read.d.ts.map +1 -0
- package/src/read.js +47 -0
- package/src/util.d.ts +12 -0
- package/src/util.d.ts.map +1 -0
- package/src/util.js +89 -0
package/README.md
ADDED
package/ambient.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { fixupConfigRules } from "@eslint/compat";
|
|
7
|
+
import eslint from "@eslint/js";
|
|
8
|
+
import tseslint from "typescript-eslint";
|
|
9
|
+
import tsParser from "@typescript-eslint/parser";
|
|
10
|
+
import react from "eslint-plugin-react";
|
|
11
|
+
import prettierConfig from "eslint-plugin-prettier/recommended";
|
|
12
|
+
import path from "node:path";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
14
|
+
import js from "@eslint/js";
|
|
15
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
16
|
+
|
|
17
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
18
|
+
const __dirname = path.dirname(__filename);
|
|
19
|
+
const compat = new FlatCompat({
|
|
20
|
+
baseDirectory: __dirname,
|
|
21
|
+
recommendedConfig: js.configs.recommended,
|
|
22
|
+
allConfig: js.configs.all,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export default [
|
|
26
|
+
{
|
|
27
|
+
ignores: [
|
|
28
|
+
"**/node_modules",
|
|
29
|
+
"**/dist",
|
|
30
|
+
"**/coverage",
|
|
31
|
+
"**/*.d.ts",
|
|
32
|
+
"**/*.js",
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
...tseslint.config(eslint.configs.recommended, tseslint.configs.recommended),
|
|
36
|
+
{
|
|
37
|
+
settings: {
|
|
38
|
+
react: {
|
|
39
|
+
version: "detect",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
react.configs.flat.recommended,
|
|
44
|
+
...fixupConfigRules(compat.extends("plugin:react-hooks/recommended")).map(
|
|
45
|
+
(config) => ({
|
|
46
|
+
...config,
|
|
47
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
48
|
+
}),
|
|
49
|
+
),
|
|
50
|
+
{
|
|
51
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
52
|
+
|
|
53
|
+
languageOptions: {
|
|
54
|
+
parser: tsParser,
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
rules: {
|
|
58
|
+
"@typescript-eslint/no-explicit-any": 0,
|
|
59
|
+
"@typescript-eslint/explicit-function-return-type": 0,
|
|
60
|
+
"@typescript-eslint/no-use-before-define": 0,
|
|
61
|
+
"@typescript-eslint/explicit-module-boundary-types": 0,
|
|
62
|
+
"@typescript-eslint/no-var-requires": 0,
|
|
63
|
+
"react/no-unescaped-entities": 0,
|
|
64
|
+
"no-sequences": "error",
|
|
65
|
+
|
|
66
|
+
"no-irregular-whitespace": [
|
|
67
|
+
"error",
|
|
68
|
+
{
|
|
69
|
+
skipTemplates: true,
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
prettierConfig,
|
|
75
|
+
];
|
package/jest.config.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) HashiCorp, Inc.
|
|
3
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
roots: [
|
|
8
|
+
"<rootDir>"
|
|
9
|
+
],
|
|
10
|
+
testMatch: ['**/*.test.ts', '**/*.test.tsx'],
|
|
11
|
+
transform: {
|
|
12
|
+
"^.+\\.tsx?$": "ts-jest"
|
|
13
|
+
},
|
|
14
|
+
moduleFileExtensions: [
|
|
15
|
+
"js",
|
|
16
|
+
"ts",
|
|
17
|
+
"tsx"
|
|
18
|
+
],
|
|
19
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cdktn/provider-schema",
|
|
3
|
+
"version": "0.21.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"description": "CDK Terrain utilities to work with provider schemas",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"watch": "tsc -w",
|
|
11
|
+
"watch-preserve-output": "tsc -w --preserveWatchOutput",
|
|
12
|
+
"lint": "eslint . ",
|
|
13
|
+
"lint:fix": "eslint . --fix",
|
|
14
|
+
"pretest": "yarn build",
|
|
15
|
+
"pretest:ci": "yarn build",
|
|
16
|
+
"test": "yarn lint && jest",
|
|
17
|
+
"test:ci": "yarn lint && jest --ci",
|
|
18
|
+
"test:update": "jest -u",
|
|
19
|
+
"jest-watch": "jest --watch",
|
|
20
|
+
"package": "./package.sh",
|
|
21
|
+
"dist-clean": "rm -rf dist",
|
|
22
|
+
"package:js": "./package.sh"
|
|
23
|
+
},
|
|
24
|
+
"main": "src/index.js",
|
|
25
|
+
"types": "src/index.d.ts",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git://github.com/open-constructs/cdk-terrain.git",
|
|
29
|
+
"directory": "packages/@cdktn/provider-schema"
|
|
30
|
+
},
|
|
31
|
+
"author": {
|
|
32
|
+
"name": "OpenConstructs",
|
|
33
|
+
"url": "https://github.com/open-constructs"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"cdk",
|
|
37
|
+
"cdktf",
|
|
38
|
+
"terraform"
|
|
39
|
+
],
|
|
40
|
+
"license": "MPL-2.0",
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@cdktn/commons": "0.21.0",
|
|
43
|
+
"@cdktn/hcl2json": "0.21.0",
|
|
44
|
+
"deepmerge": "4.3.1",
|
|
45
|
+
"fs-extra": "11.3.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@eslint/compat": "^1.2.9",
|
|
49
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
50
|
+
"@eslint/js": "^9.27.0",
|
|
51
|
+
"@types/follow-redirects": "1.14.4",
|
|
52
|
+
"@types/fs-extra": "11.0.4",
|
|
53
|
+
"@types/json-stable-stringify": "1.2.0",
|
|
54
|
+
"@types/uuid": "9.0.8",
|
|
55
|
+
"@typescript-eslint/parser": "^8.32.1",
|
|
56
|
+
"eslint": "^9.27.0",
|
|
57
|
+
"eslint-plugin-prettier": "^5.4.0",
|
|
58
|
+
"eslint-plugin-react": "7.37.5",
|
|
59
|
+
"jest": "^29.7.0",
|
|
60
|
+
"json-stable-stringify": "1.3.0",
|
|
61
|
+
"lint-staged": "^15.5.2",
|
|
62
|
+
"ts-jest": "29.3.4",
|
|
63
|
+
"tsc-files": "1.1.4",
|
|
64
|
+
"typescript": "5.4.5",
|
|
65
|
+
"typescript-eslint": "^8.32.1"
|
|
66
|
+
},
|
|
67
|
+
"lint-staged": {
|
|
68
|
+
"src/**/*.{ts,tsx}": "tsc-files ambient.d.ts --noEmit"
|
|
69
|
+
}
|
|
70
|
+
}
|