@morda-dev/create-sdk 1.0.1

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 (123) hide show
  1. package/bin/create-sdk.js +107 -0
  2. package/package.json +14 -0
  3. package/template/.editorconfig +0 -0
  4. package/template/.github/CODEOWNERS +2 -0
  5. package/template/.github/ISSUE_TEMPLATE/bug_report.md +35 -0
  6. package/template/.github/ISSUE_TEMPLATE/feature_request.md +26 -0
  7. package/template/.github/dependabot.yml +18 -0
  8. package/template/.github/pull_request_template.md +25 -0
  9. package/template/.github/workflows/auto-release.yml +77 -0
  10. package/template/.github/workflows/ci.yml +35 -0
  11. package/template/.github/workflows/deploy-pages.yml +73 -0
  12. package/template/.github/workflows/docs-ci.yml +38 -0
  13. package/template/.github/workflows/docs.yml +19 -0
  14. package/template/.github/workflows/release.yml +51 -0
  15. package/template/.husky/commit-msg +4 -0
  16. package/template/.husky/pre-commit +4 -0
  17. package/template/.prettierrc +0 -0
  18. package/template/CHANGELOG.md +49 -0
  19. package/template/CODE_OF_CONDUCT.md +40 -0
  20. package/template/CONTRIBUTING.md +38 -0
  21. package/template/LICENSE +21 -0
  22. package/template/README.md +49 -0
  23. package/template/SECURITY.md +16 -0
  24. package/template/TEST_DEPLOY.md +0 -0
  25. package/template/api-extractor.json +33 -0
  26. package/template/ci-cd.md +93 -0
  27. package/template/commitlint.config.cjs +3 -0
  28. package/template/coverage/base.css +224 -0
  29. package/template/coverage/block-navigation.js +87 -0
  30. package/template/coverage/clover.xml +6 -0
  31. package/template/coverage/coverage-final.json +1 -0
  32. package/template/coverage/favicon.png +0 -0
  33. package/template/coverage/index.html +101 -0
  34. package/template/coverage/prettify.css +1 -0
  35. package/template/coverage/prettify.js +2 -0
  36. package/template/coverage/sort-arrow-sprite.png +0 -0
  37. package/template/coverage/sorter.js +210 -0
  38. package/template/docs/api/README.md +5 -0
  39. package/template/docs/api-auto/README.md +5 -0
  40. package/template/docs/index.html +73 -0
  41. package/template/docs/index.md +28 -0
  42. package/template/docusaurus-build/.github/workflows/deploy-docs.yml +46 -0
  43. package/template/docusaurus-build/.github/workflows/deploy-pages.yml +43 -0
  44. package/template/docusaurus-build/README.md +44 -0
  45. package/template/docusaurus-build/blog/authors.yml +34 -0
  46. package/template/docusaurus-build/blog/hello-world.md +9 -0
  47. package/template/docusaurus-build/docs/ci-cd.md +62 -0
  48. package/template/docusaurus-build/docs/conventions.md +50 -0
  49. package/template/docusaurus-build/docs/folder-structure.md +24 -0
  50. package/template/docusaurus-build/docs/getting-started.md +24 -0
  51. package/template/docusaurus-build/docs/intro.md +14 -0
  52. package/template/docusaurus-build/docs/project-architecture.md +125 -0
  53. package/template/docusaurus-build/docs/project-template/architecture.md +82 -0
  54. package/template/docusaurus-build/docs/project-template/getting-started.md +24 -0
  55. package/template/docusaurus-build/docs/project-template/overview.md +78 -0
  56. package/template/docusaurus-build/docs/project-template/structure.md +145 -0
  57. package/template/docusaurus-build/docs/scripts.md +42 -0
  58. package/template/docusaurus-build/docs/testing.md +30 -0
  59. package/template/docusaurus-build/docusaurus-build/sidebars.ts +30 -0
  60. package/template/docusaurus-build/docusaurus-build/tsconfig.json +8 -0
  61. package/template/docusaurus-build/docusaurus-build/typedoc.tsconfig.json +28 -0
  62. package/template/docusaurus-build/docusaurus.config.ts +129 -0
  63. package/template/docusaurus-build/package-lock.json +18235 -0
  64. package/template/docusaurus-build/package.json +51 -0
  65. package/template/docusaurus-build/project-template/README.md +44 -0
  66. package/template/docusaurus-build/project-template/src/index.ts +4 -0
  67. package/template/docusaurus-build/project-template/src/modules/user.ts +20 -0
  68. package/template/docusaurus-build/project-template/src/types/user.ts +5 -0
  69. package/template/docusaurus-build/sidebars.ts +20 -0
  70. package/template/docusaurus-build/src/components/HomepageFeatures/index.tsx +71 -0
  71. package/template/docusaurus-build/src/components/HomepageFeatures/styles.module.css +11 -0
  72. package/template/docusaurus-build/src/css/custom.css +30 -0
  73. package/template/docusaurus-build/src/pages/index.module.css +23 -0
  74. package/template/docusaurus-build/src/pages/index.tsx +52 -0
  75. package/template/docusaurus-build/src/pages/markdown-page.md +7 -0
  76. package/template/docusaurus-build/static/.nojekyll +0 -0
  77. package/template/docusaurus-build/static/api/.nojekyll +1 -0
  78. package/template/docusaurus-build/static/api/assets/hierarchy.js +1 -0
  79. package/template/docusaurus-build/static/api/assets/highlight.css +22 -0
  80. package/template/docusaurus-build/static/api/assets/icons.js +18 -0
  81. package/template/docusaurus-build/static/api/assets/icons.svg +1 -0
  82. package/template/docusaurus-build/static/api/assets/main.js +60 -0
  83. package/template/docusaurus-build/static/api/assets/navigation.js +1 -0
  84. package/template/docusaurus-build/static/api/assets/search.js +1 -0
  85. package/template/docusaurus-build/static/api/assets/style.css +1633 -0
  86. package/template/docusaurus-build/static/api/functions/modules_user.getUser.html +1 -0
  87. package/template/docusaurus-build/static/api/functions/modules_user.sumAges.html +1 -0
  88. package/template/docusaurus-build/static/api/hierarchy.html +1 -0
  89. package/template/docusaurus-build/static/api/index.html +1 -0
  90. package/template/docusaurus-build/static/api/modules/index.html +1 -0
  91. package/template/docusaurus-build/static/api/modules/modules_user.html +1 -0
  92. package/template/docusaurus-build/static/api/modules/types_user.html +1 -0
  93. package/template/docusaurus-build/static/api/types/types_user.ApiResult.html +3 -0
  94. package/template/docusaurus-build/static/api/types/types_user.User.html +4 -0
  95. package/template/docusaurus-build/static/img/docusaurus-social-card.jpg +0 -0
  96. package/template/docusaurus-build/static/img/docusaurus.png +0 -0
  97. package/template/docusaurus-build/static/img/favicon.ico +0 -0
  98. package/template/docusaurus-build/static/img/logo.svg +1 -0
  99. package/template/docusaurus-build/static/img/undraw_docusaurus_mountain.svg +171 -0
  100. package/template/docusaurus-build/static/img/undraw_docusaurus_react.svg +170 -0
  101. package/template/docusaurus-build/static/img/undraw_docusaurus_tree.svg +40 -0
  102. package/template/docusaurus-build/tsconfig.json +8 -0
  103. package/template/docusaurus-build/typedoc.json +14 -0
  104. package/template/docusaurus-build/typedoc.tsconfig.json +7 -0
  105. package/template/eslint.config.mjs +72 -0
  106. package/template/etc/project-template.api.md +32 -0
  107. package/template/morda-dev-project-template-0.1.1.tgz +0 -0
  108. package/template/package-lock.json +45 -0
  109. package/template/package.json +35 -0
  110. package/template/scripts/commitlint-runner.mjs +10 -0
  111. package/template/src/index.ts +19 -0
  112. package/template/src/modules/user.ts +12 -0
  113. package/template/src/types/user.ts +9 -0
  114. package/template/test.ts +4 -0
  115. package/template/tests/example.test.js +3 -0
  116. package/template/tests/public-api.snapshot.test.ts +13 -0
  117. package/template/tests/public-api.test.ts +58 -0
  118. package/template/tests/user.test.ts +16 -0
  119. package/template/tsconfig.build.json +11 -0
  120. package/template/tsconfig.eslint.json +14 -0
  121. package/template/tsconfig.json +12 -0
  122. package/template/typedoc.json +6 -0
  123. package/template/vitest.config.ts +12 -0
@@ -0,0 +1,58 @@
1
+ import { describe, it, expect } from "vitest";
2
+
3
+ // ❗ ТЕСТИРУЕМ ТО, ЧТО ПОПАДАЕТ В npm
4
+ import type { User, ApiResult } from "../dist";
5
+ import { getUser, sumAges } from "../dist";
6
+
7
+ describe("Public API contract", () => {
8
+ it("exports expected functions", () => {
9
+ expect(typeof getUser).toBe("function");
10
+ expect(typeof sumAges).toBe("function");
11
+ });
12
+
13
+ it("User type shape is stable", () => {
14
+ const user: User = {
15
+ id: 1,
16
+ name: "John",
17
+ age: 30,
18
+ };
19
+
20
+ expect(user.id).toBeTypeOf("number");
21
+ expect(user.name).toBeTypeOf("string");
22
+ expect(user.age).toBeTypeOf("number");
23
+ });
24
+
25
+ it("ApiResult<T> contract is stable", () => {
26
+ const result: ApiResult<User> = {
27
+ ok: true,
28
+ data: {
29
+ id: 1,
30
+ name: "John",
31
+ age: 30,
32
+ },
33
+ };
34
+
35
+ expect(result.ok).toBe(true);
36
+ if (result.ok) {
37
+ expect(result.data.id).toBe(1);
38
+ }
39
+ });
40
+
41
+ it("getUser returns ApiResult<User>", () => {
42
+ const result = getUser(1);
43
+
44
+ expect(result.ok).toBe(true);
45
+ if (result.ok) {
46
+ expect(result.data.id).toBe(1);
47
+ }
48
+ });
49
+
50
+ it("sumAges computes total age correctly", () => {
51
+ const total = sumAges([
52
+ { id: 1, name: "John", age: 30 },
53
+ { id: 2, name: "Jane", age: 25 },
54
+ ]);
55
+
56
+ expect(total).toBe(55);
57
+ });
58
+ });
@@ -0,0 +1,16 @@
1
+ import { getUser, sumAges } from "../src/modules/user";
2
+
3
+ test("getUser returns correct user", () => {
4
+ const user = getUser("123");
5
+ expect(user.id).toBe("123");
6
+ expect(user.name).toBe("John Doe");
7
+ expect(user.age).toBe(25);
8
+ });
9
+
10
+ test("sumAges returns correct sum", () => {
11
+ const sum = sumAges(
12
+ { id: "1", name: "A", age: 20 },
13
+ { id: "2", name: "B", age: 30 },
14
+ );
15
+ expect(sum).toBe(50);
16
+ });
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "outDir": "dist",
7
+ "declaration": true,
8
+ "emitDeclarationOnly": false
9
+ },
10
+ "include": ["src"]
11
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+
4
+ "compilerOptions": {
5
+ "noEmit": true,
6
+
7
+ "baseUrl": ".",
8
+ "paths": {
9
+ "project-template": ["src/index.ts"]
10
+ }
11
+ },
12
+
13
+ "include": ["src/**/*.ts", "tests/**/*.ts"]
14
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ES2022",
5
+ "moduleResolution": "NodeNext",
6
+ "outDir": "dist",
7
+ "rootDir": "src",
8
+ "declaration": true,
9
+ "strict": true
10
+ },
11
+ "include": ["src"]
12
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "entryPoints": ["src/index.ts"],
3
+ "out": "static/api",
4
+ "stripInternal": true,
5
+ "excludeInternal": true
6
+ }
@@ -0,0 +1,12 @@
1
+ import { defineConfig } from "vitest/config";
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ globals: true,
6
+ environment: "node",
7
+ coverage: {
8
+ provider: "v8",
9
+ reports: ["text", "html"],
10
+ },
11
+ },
12
+ });