@papit/create 0.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 (141) hide show
  1. package/README.md +198 -0
  2. package/asset/component-templates/browser/src/component.ts +7 -0
  3. package/asset/component-templates/browser/src/index.ts +3 -0
  4. package/asset/component-templates/browser/src/types.ts +1 -0
  5. package/asset/component-templates/browser/tests/index.html +15 -0
  6. package/asset/component-templates/browser/tests/main.js +1 -0
  7. package/asset/component-templates/browser/tests/public/icons/.gitkeep +0 -0
  8. package/asset/component-templates/browser/tests/public/images/.gitkeep +0 -0
  9. package/asset/component-templates/browser/tests/public/translations/en.json +7 -0
  10. package/asset/component-templates/browser/tests/snapshot.test.ts +12 -0
  11. package/asset/component-templates/browser/tests/unit.test.ts +69 -0
  12. package/asset/component-templates/browser/views/index.html +29 -0
  13. package/asset/component-templates/browser/views/main.js +13 -0
  14. package/asset/component-templates/browser/views/public/icons/.gitkeep +0 -0
  15. package/asset/component-templates/browser/views/public/images/.gitkeep +0 -0
  16. package/asset/component-templates/browser/views/public/translations/en.json +7 -0
  17. package/asset/component-templates/browser/views/style.css +28 -0
  18. package/asset/component-templates/game/src/component.ts +7 -0
  19. package/asset/component-templates/game/src/index.ts +3 -0
  20. package/asset/component-templates/game/src/types.ts +1 -0
  21. package/asset/component-templates/game/tests/index.html +15 -0
  22. package/asset/component-templates/game/tests/main.js +34 -0
  23. package/asset/component-templates/game/tests/public/models/.gitkeep +0 -0
  24. package/asset/component-templates/game/tests/public/textures/.gitkeep +0 -0
  25. package/asset/component-templates/game/tests/public/translations/en.json +7 -0
  26. package/asset/component-templates/game/tests/snapshot.test.ts +12 -0
  27. package/asset/component-templates/game/tests/unit.test.ts +18 -0
  28. package/asset/component-templates/game/views/index.html +22 -0
  29. package/asset/component-templates/game/views/main.js +34 -0
  30. package/asset/component-templates/game/views/public/models/.gitkeep +0 -0
  31. package/asset/component-templates/game/views/public/textures/.gitkeep +0 -0
  32. package/asset/component-templates/game/views/public/translations/en.json +7 -0
  33. package/asset/component-templates/game/views/style.css +9 -0
  34. package/asset/component-templates/node/src/component.ts +7 -0
  35. package/asset/component-templates/node/src/index.ts +3 -0
  36. package/asset/component-templates/node/src/types.ts +1 -0
  37. package/asset/component-templates/node/tests/unit.test.js +10 -0
  38. package/asset/component-templates/theme/lib/theme.css +80 -0
  39. package/asset/component-templates/theme/src/theme.css +205 -0
  40. package/asset/component-templates/theme/tests/index.html +15 -0
  41. package/asset/component-templates/theme/tests/main.js +1 -0
  42. package/asset/component-templates/theme/tests/public/icons/.gitkeep +0 -0
  43. package/asset/component-templates/theme/tests/public/images/.gitkeep +0 -0
  44. package/asset/component-templates/theme/tests/public/translations/en.json +7 -0
  45. package/asset/component-templates/theme/tests/snapshot.test.ts +12 -0
  46. package/asset/component-templates/theme/tests/unit.test.ts +67 -0
  47. package/asset/component-templates/theme/views/index.html +110 -0
  48. package/asset/component-templates/theme/views/main.js +14 -0
  49. package/asset/component-templates/theme/views/style.css +241 -0
  50. package/asset/component-templates/web-component/src/component.ts +31 -0
  51. package/asset/component-templates/web-component/src/index.ts +15 -0
  52. package/asset/component-templates/web-component/src/style.css +4 -0
  53. package/asset/component-templates/web-component/src/types.ts +1 -0
  54. package/asset/component-templates/web-component/tests/index.html +17 -0
  55. package/asset/component-templates/web-component/tests/main.js +1 -0
  56. package/asset/component-templates/web-component/tests/public/icons/.gitkeep +0 -0
  57. package/asset/component-templates/web-component/tests/public/images/.gitkeep +0 -0
  58. package/asset/component-templates/web-component/tests/public/translations/en.json +7 -0
  59. package/asset/component-templates/web-component/tests/snapshot.test.ts +12 -0
  60. package/asset/component-templates/web-component/tests/unit.test.ts +69 -0
  61. package/asset/component-templates/web-component/views/index.html +28 -0
  62. package/asset/component-templates/web-component/views/main.js +14 -0
  63. package/asset/component-templates/web-component/views/public/icons/.gitkeep +0 -0
  64. package/asset/component-templates/web-component/views/public/images/.gitkeep +0 -0
  65. package/asset/component-templates/web-component/views/public/translations/en.json +7 -0
  66. package/asset/component-templates/web-component/views/style.css +28 -0
  67. package/asset/package-templates/browser/README.md +44 -0
  68. package/asset/package-templates/browser/asset/icons/.gitkeep +0 -0
  69. package/asset/package-templates/browser/asset/images/.gitkeep +0 -0
  70. package/asset/package-templates/browser/asset/translations/en.json +7 -0
  71. package/asset/package-templates/browser/package.json +76 -0
  72. package/asset/package-templates/browser/src/.gitkeep +0 -0
  73. package/asset/package-templates/browser/tests/playwright.config.ts +81 -0
  74. package/asset/package-templates/browser/tests/tsconfig.json +9 -0
  75. package/asset/package-templates/browser/tsconfig.json +41 -0
  76. package/asset/package-templates/browser/tsconfig.prod.json +9 -0
  77. package/asset/package-templates/game/README.md +40 -0
  78. package/asset/package-templates/game/asset/models/.gitkeep +0 -0
  79. package/asset/package-templates/game/asset/textures/.gitkeep +0 -0
  80. package/asset/package-templates/game/asset/translations/en.json +7 -0
  81. package/asset/package-templates/game/package.json +78 -0
  82. package/asset/package-templates/game/src/.gitkeep +0 -0
  83. package/asset/package-templates/game/tests/playwright.config.ts +80 -0
  84. package/asset/package-templates/game/tests/tsconfig.json +9 -0
  85. package/asset/package-templates/game/tsconfig.json +41 -0
  86. package/asset/package-templates/game/tsconfig.prod.json +9 -0
  87. package/asset/package-templates/game/views/.gitkeep +0 -0
  88. package/asset/package-templates/game/views/tsconfig.json +9 -0
  89. package/asset/package-templates/node/README.md +40 -0
  90. package/asset/package-templates/node/asset/translations/en.json +7 -0
  91. package/asset/package-templates/node/package.json +70 -0
  92. package/asset/package-templates/node/src/.gitkeep +0 -0
  93. package/asset/package-templates/node/tests/.gitkeep +0 -0
  94. package/asset/package-templates/node/tests/tsconfig.json +9 -0
  95. package/asset/package-templates/node/tsconfig.json +38 -0
  96. package/asset/package-templates/node/tsconfig.prod.json +9 -0
  97. package/asset/package-templates/theme/README.md +44 -0
  98. package/asset/package-templates/theme/asset/icons/.gitkeep +0 -0
  99. package/asset/package-templates/theme/asset/images/.gitkeep +0 -0
  100. package/asset/package-templates/theme/asset/translations/en.json +7 -0
  101. package/asset/package-templates/theme/package.json +70 -0
  102. package/asset/package-templates/theme/tests/playwright.config.ts +81 -0
  103. package/asset/package-templates/theme/tsconfig.json +39 -0
  104. package/asset/package-templates/theme/tsconfig.prod.json +9 -0
  105. package/asset/package-templates/web-component/README.md +55 -0
  106. package/asset/package-templates/web-component/asset/icons/.gitkeep +0 -0
  107. package/asset/package-templates/web-component/asset/images/.gitkeep +0 -0
  108. package/asset/package-templates/web-component/asset/translations/en.json +7 -0
  109. package/asset/package-templates/web-component/package.json +79 -0
  110. package/asset/package-templates/web-component/src/global-css.d.ts +4 -0
  111. package/asset/package-templates/web-component/tests/playwright.config.ts +81 -0
  112. package/asset/package-templates/web-component/tests/tsconfig.json +9 -0
  113. package/asset/package-templates/web-component/tsconfig.json +42 -0
  114. package/asset/package-templates/web-component/tsconfig.prod.json +9 -0
  115. package/asset/package-templates/web-component/views/.gitkeep +0 -0
  116. package/asset/package-templates/web-component/views/tsconfig.json +9 -0
  117. package/asset/project-template/.eslintrc +26 -0
  118. package/asset/project-template/.gitattributes +1 -0
  119. package/asset/project-template/.github/ISSUE_TEMPLATE/CONTRIBUTING.md +101 -0
  120. package/asset/project-template/.github/workflows/build-cache.yml +30 -0
  121. package/asset/project-template/.github/workflows/initialise.yml +49 -0
  122. package/asset/project-template/.github/workflows/publish.yml +59 -0
  123. package/asset/project-template/.github/workflows/pull-request.yml +73 -0
  124. package/asset/project-template/.github/workflows/update-snapshots.yml +80 -0
  125. package/asset/project-template/.nvmrc +1 -0
  126. package/asset/project-template/.vscode/settings.json +19 -0
  127. package/asset/project-template/.vscode/web-components.code-workspace +25 -0
  128. package/asset/project-template/README.md +45 -0
  129. package/asset/project-template/bin/clean.mjs +28 -0
  130. package/asset/project-template/bin/runners/example-runner/runner.js +4 -0
  131. package/asset/project-template/bin/spawn-command.mjs +31 -0
  132. package/asset/project-template/bin/test.mjs +94 -0
  133. package/asset/project-template/package.json +42 -0
  134. package/asset/project-template/packages/atoms/.gitkeep +0 -0
  135. package/asset/project-template/packages/molecules/.gitkeep +0 -0
  136. package/asset/project-template/packages/organisms/.gitkeep +0 -0
  137. package/asset/project-template/packages/pages/.gitkeep +0 -0
  138. package/asset/project-template/packages/templates/.gitkeep +0 -0
  139. package/lib/bundle.d.ts +1 -0
  140. package/lib/bundle.js +4 -0
  141. package/package.json +72 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "region": "GB",
4
+ "language": "en-UK"
5
+ },
6
+ "VARIABLE_NAME": "VARIABLE_NAME"
7
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "VARIABLE_FULL_NAME",
3
+ "description": "VARIABLE_DESCRIPTION",
4
+ "keywords": [
5
+ "papit",
6
+ "typescript",
7
+ "VARIABLE_NAME"
8
+ ],
9
+ "version": "0.0.1",
10
+ "scripts": {
11
+ "watch": "tsc -w",
12
+ "start": "npx @papit/server --info --live",
13
+ "test": "npx playwright test -c tests/playwright.config.ts $@",
14
+ "preversion": "papit-version",
15
+ "postversion": "papit-version",
16
+ "component": "npm create @papit -- --component",
17
+ "test:update-snapshots": "npx playwright test --update-snapshots -c tests/playwright.config.ts",
18
+ "test:chrome": "npm test -- --project=chromium"
19
+ },
20
+ "type": "module",
21
+ "files": [
22
+ "asset/",
23
+ "lib/"
24
+ ],
25
+ "style": "./lib/theme.css",
26
+ "exports": {
27
+ ".": "./lib/theme.css",
28
+ "./theme.css": "./lib/theme.css"
29
+ },
30
+ "author": "VARIABLE_USER",
31
+ "private": false,
32
+ "publishConfig": {
33
+ "access": "public",
34
+ "registry": "https://registry.npmjs.org/"
35
+ },
36
+ "license": "VARIABLE_PROJECTLICENSE",
37
+ "homepage": "VARIABLE_GITHUB_REPO/tree/main/VARIABLE_LOCAL_DESTINATION",
38
+ "bugs": {
39
+ "url": "VARIABLE_GITHUB_REPO/issues"
40
+ },
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "VARIABLE_GITHUB_REPO.git",
44
+ "directory": "VARIABLE_LOCAL_DESTINATION"
45
+ },
46
+ "sideEffects": true,
47
+ "engines": {
48
+ "node": ">=18"
49
+ },
50
+ "dependencies": {},
51
+ "devDependencies": {
52
+ "@playwright/test": "1.58.0",
53
+ "playwright": "1.58.0",
54
+ "typescript": "5.9.3",
55
+ "@papit/theme": "*",
56
+ "@papit/translator": "*",
57
+ "@papit/codeblock": "*"
58
+ },
59
+ "browserslist": [
60
+ "defaults",
61
+ "not IE 11",
62
+ "not dead"
63
+ ],
64
+ "papit": {
65
+ "publish": true,
66
+ "type": "theme",
67
+ "main": "VARIABLE_NAME",
68
+ "components": {}
69
+ }
70
+ }
@@ -0,0 +1,81 @@
1
+ import { Arguments } from "@papit/arguments";
2
+ import { Information, PackageGraph } from "@papit/information";
3
+ import { defineConfig, devices } from '@playwright/test';
4
+ import path from "node:path";
5
+
6
+ const dirname = path.join(PackageGraph.get("VARIABLE_FULL_NAME").location, "tests");
7
+ // const relative = path.relative(Information.root.location, PackageGraph.get("@papit/web-component").location);
8
+
9
+ export default defineConfig({
10
+ // Look for test files in the "tests" directory, relative to this configuration file.
11
+ testDir: dirname,
12
+
13
+ // Run all tests in parallel.
14
+ fullyParallel: true,
15
+
16
+ // Fail the build on CI if you accidentally left test.only in the source code.
17
+ forbidOnly: !!process.env.CI,
18
+
19
+ // Retry on CI only.
20
+ retries: 0,
21
+
22
+ // Opt out of parallel tests on CI.
23
+ workers: !!process.env.CI ? 1 : undefined,
24
+
25
+ // reporter, with output path for HTML reports.
26
+ reporter: [[
27
+ !!process.env.CI ? "github" : "html",
28
+ {
29
+ open: "never",
30
+ outputFolder: path.join(dirname, "test-reports"),
31
+ }
32
+ ]],
33
+
34
+ outputDir: path.join(dirname, "test-results"),
35
+
36
+ snapshotPathTemplate: '{testDir}/snapshots/{projectName}/{testFilePath}/{arg}-{platform}{ext}',
37
+
38
+ use: {
39
+ // Base URL to use in actions like `await page.goto('/')`.
40
+ baseURL: process.env.LOCATION ? `http://localhost:3500/${process.env.LOCATION}/` : 'http://localhost:3500/',
41
+
42
+ // Collect trace when retrying the failed test.
43
+ trace: 'on-first-retry',
44
+ screenshot: 'only-on-failure',
45
+ },
46
+
47
+
48
+ expect: {
49
+ toHaveScreenshot: {
50
+ maxDiffPixels: 100,
51
+ maxDiffPixelRatio: 0.2,
52
+ },
53
+ },
54
+ testIgnore: process.env.SKIP_SNAPSHOTS === "true"
55
+ ? ["**/snapshot.test.ts"]
56
+ : [],
57
+
58
+ // Configure projects for major browsers.
59
+ projects: [
60
+ {
61
+ name: 'chromium',
62
+ use: { ...devices['Desktop Chrome'] },
63
+ },
64
+ {
65
+ name: 'firefox',
66
+ use: { ...devices['Desktop Firefox'] },
67
+ },
68
+ {
69
+ name: 'webkit',
70
+ use: { ...devices['Desktop Safari'] },
71
+ },
72
+ ],
73
+ // running web-server before starting tests
74
+ webServer: {
75
+ command: 'npx @papit/server --serve --port=3500 --bundle',
76
+ url: 'http://localhost:3500',
77
+ reuseExistingServer: true,
78
+ stdout: 'pipe',
79
+ stderr: 'pipe'
80
+ },
81
+ });
@@ -0,0 +1,39 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2018",
4
+ "module": "esnext",
5
+ "moduleResolution": "node",
6
+ "noEmitOnError": true,
7
+ "lib": [
8
+ "es2020",
9
+ "dom",
10
+ "dom.iterable",
11
+ "esnext"
12
+ ],
13
+ "strict": true,
14
+ "esModuleInterop": false,
15
+ "allowSyntheticDefaultImports": true,
16
+ "experimentalDecorators": true,
17
+ "outDir": "lib",
18
+ "sourceMap": true,
19
+ "inlineSources": true,
20
+ "rootDir": "./",
21
+ "allowJs": true,
22
+ "declarationDir": "lib/types",
23
+ "declaration": true,
24
+ "incremental": true,
25
+ "resolveJsonModule": true,
26
+ "tsBuildInfoFile": ".temp/build/tsconfig.tsbuildinfo",
27
+ "baseUrl": "src",
28
+ "paths": {
29
+ "VARIABLE_FULL_NAME": [
30
+ "./index"
31
+ ],
32
+ }
33
+ },
34
+ "include": [
35
+ "src",
36
+ "views",
37
+ "tests"
38
+ ]
39
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "sourceMap": false,
5
+ "inlineSources": false,
6
+ "declarationMap": false,
7
+ "incremental": false
8
+ }
9
+ }
@@ -0,0 +1,55 @@
1
+ # VARIABLE_FULL_NAME
2
+
3
+ VARIABLE_DESCRIPTION
4
+
5
+ ![Logo](VARIABLE_GITHUB_REPO/blob/main/asset/logo.svg)
6
+
7
+ ---
8
+
9
+ ![Type](https://img.shields.io/badge/Type-VARIABLE_LAYER_FOLDER-orange)
10
+ [![Tests](VARIABLE_GITHUB_REPO/actions/workflows/pull-request.yml/badge.svg)](VARIABLE_GITHUB_REPO/actions/workflows/pull-request.yml)
11
+ [![NPM version](https://img.shields.io/npm/v/VARIABLE_FULL_NAME.svg?logo=npm)](https://www.npmjs.com/package/VARIABLE_FULL_NAME)
12
+
13
+ ---
14
+
15
+ ## installation
16
+
17
+ ```bash
18
+ npm install VARIABLE_FULL_NAME
19
+ ```
20
+
21
+ ### to use in **html**
22
+
23
+ ```html
24
+ <script type="module" defer>
25
+ import "VARIABLE_FULL_NAME";
26
+ </script>
27
+
28
+ <VARIABLE_HTML_NAME></VARIABLE_HTML_NAME>
29
+ ```
30
+
31
+
32
+ ## Contributing
33
+
34
+ Contributions are welcome! Please follow the development guidelines above and ensure all tests pass before submitting a pull request.
35
+
36
+ ## License
37
+
38
+ Licensed under the @Papit License 1.0 - Copyright (c) 2024 Henry Pap (@onkelhoy)
39
+
40
+ **Key points:**
41
+
42
+ - ✅ Free to use in commercial projects
43
+ - ✅ Free to modify and distribute
44
+ - ✅ Attribution required
45
+ - ❌ Cannot resell the component itself as a standalone product
46
+
47
+ See the [LICENSE](https://github.com/onkelhoy/papit/blob/main/LICENSE) file for full details.
48
+
49
+ ## Related Components
50
+
51
+ - [@papit/web-component](https://github.com/onkelhoy/papit/tree/main/packages/system/core): Core utilities, decorators, and base component class
52
+
53
+ ## Support
54
+
55
+ For issues, questions, or contributions, please visit the [GitHub repository](https://github.com/onkelhoy/papit).
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "region": "GB",
4
+ "language": "en-UK"
5
+ },
6
+ "VARIABLE_NAME": "VARIABLE_NAME"
7
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "VARIABLE_FULL_NAME",
3
+ "description": "VARIABLE_DESCRIPTION",
4
+ "keywords": [
5
+ "papit",
6
+ "web-component",
7
+ "typescript",
8
+ "VARIABLE_NAME"
9
+ ],
10
+ "version": "0.0.1",
11
+ "scripts": {
12
+ "build": "npx @papit/build --error",
13
+ "watch": "tsc -w",
14
+ "start": "npx @papit/server --info --live",
15
+ "test": "npx playwright test -c tests/playwright.config.ts $@",
16
+ "preversion": "papit-version",
17
+ "postversion": "papit-version",
18
+ "component": "npm create @papit --component",
19
+ "test:update-snapshots": "npx playwright test --update-snapshots -c tests/playwright.config.ts",
20
+ "test:chrome": "npm test -- --project=chromium",
21
+ "build:react": "bash ./bin/_utils/react.sh"
22
+ },
23
+ "main": "./lib/bundle.js",
24
+ "types": "./lib/bundle.d.ts",
25
+ "type": "module",
26
+ "files": [
27
+ "asset/",
28
+ "lib/"
29
+ ],
30
+ "exports": {
31
+ ".": {
32
+ "import": "./lib/bundle.js",
33
+ "types": "./lib/bundle.d.ts"
34
+ }
35
+ },
36
+ "author": "VARIABLE_USER",
37
+ "private": false,
38
+ "publishConfig": {
39
+ "access": "public",
40
+ "registry": "https://registry.npmjs.org/"
41
+ },
42
+ "license": "VARIABLE_PROJECTLICENSE",
43
+ "homepage": "VARIABLE_GITHUB_REPO/tree/main/VARIABLE_LOCAL_DESTINATION",
44
+ "bugs": {
45
+ "url": "VARIABLE_GITHUB_REPO/issues"
46
+ },
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "VARIABLE_GITHUB_REPO.git",
50
+ "directory": "VARIABLE_LOCAL_DESTINATION"
51
+ },
52
+ "sideEffects": true,
53
+ "engines": {
54
+ "node": ">=18"
55
+ },
56
+ "dependencies": {
57
+ "@papit/web-component": "*"
58
+ },
59
+ "devDependencies": {
60
+ "@playwright/test": "1.58.0",
61
+ "playwright": "1.58.0",
62
+ "typescript": "5.9.3",
63
+ "@papit/theme": "*",
64
+ "@papit/translator": "*",
65
+ "@papit/codeblock": "*"
66
+ },
67
+ "browserslist": [
68
+ "defaults",
69
+ "not IE 11",
70
+ "not dead"
71
+ ],
72
+ "papit": {
73
+ "publish": true,
74
+ "type": "web-component",
75
+ "main": "VARIABLE_NAME",
76
+ "htmlprefix": "VARIABLE_HTML_PREFIX",
77
+ "components": {}
78
+ }
79
+ }
@@ -0,0 +1,4 @@
1
+ declare module "*.css" {
2
+ const sheet: CSSStyleSheet;
3
+ export default sheet;
4
+ }
@@ -0,0 +1,81 @@
1
+ import { Arguments } from "@papit/arguments";
2
+ import { Information, PackageGraph } from "@papit/information";
3
+ import { defineConfig, devices } from '@playwright/test';
4
+ import path from "node:path";
5
+
6
+ const dirname = path.join(PackageGraph.get("VARIABLE_FULL_NAME").location, "tests");
7
+ // const relative = path.relative(Information.root.location, PackageGraph.get("@papit/web-component").location);
8
+
9
+ export default defineConfig({
10
+ // Look for test files in the "tests" directory, relative to this configuration file.
11
+ testDir: dirname,
12
+
13
+ // Run all tests in parallel.
14
+ fullyParallel: true,
15
+
16
+ // Fail the build on CI if you accidentally left test.only in the source code.
17
+ forbidOnly: !!process.env.CI,
18
+
19
+ // Retry on CI only.
20
+ retries: 0,
21
+
22
+ // Opt out of parallel tests on CI.
23
+ workers: !!process.env.CI ? 1 : undefined,
24
+
25
+ // reporter, with output path for HTML reports.
26
+ reporter: [[
27
+ !!process.env.CI ? "github" : "html",
28
+ {
29
+ open: "never",
30
+ outputFolder: path.join(dirname, "test-reports"),
31
+ }
32
+ ]],
33
+
34
+ outputDir: path.join(dirname, "test-results"),
35
+
36
+ snapshotPathTemplate: '{testDir}/snapshots/{projectName}/{testFilePath}/{arg}-{platform}{ext}',
37
+
38
+ use: {
39
+ // Base URL to use in actions like `await page.goto('/')`.
40
+ baseURL: process.env.LOCATION ? `http://localhost:3500/${process.env.LOCATION}/` : 'http://localhost:3500/',
41
+
42
+ // Collect trace when retrying the failed test.
43
+ trace: 'on-first-retry',
44
+ screenshot: 'only-on-failure',
45
+ },
46
+
47
+
48
+ expect: {
49
+ toHaveScreenshot: {
50
+ maxDiffPixels: 100,
51
+ maxDiffPixelRatio: 0.2,
52
+ },
53
+ },
54
+ testIgnore: process.env.SKIP_SNAPSHOTS === "true"
55
+ ? ["**/snapshot.test.ts"]
56
+ : [],
57
+
58
+ // Configure projects for major browsers.
59
+ projects: [
60
+ {
61
+ name: 'chromium',
62
+ use: { ...devices['Desktop Chrome'] },
63
+ },
64
+ {
65
+ name: 'firefox',
66
+ use: { ...devices['Desktop Firefox'] },
67
+ },
68
+ {
69
+ name: 'webkit',
70
+ use: { ...devices['Desktop Safari'] },
71
+ },
72
+ ],
73
+ // running web-server before starting tests
74
+ webServer: {
75
+ command: 'npx @papit/server --serve --port=3500 --bundle',
76
+ url: 'http://localhost:3500',
77
+ reuseExistingServer: true,
78
+ stdout: 'pipe',
79
+ stderr: 'pipe'
80
+ },
81
+ });
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": ".."
5
+ },
6
+ "include": [
7
+ "."
8
+ ]
9
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2018",
4
+ "module": "esnext",
5
+ "moduleResolution": "bundler",
6
+ // "moduleDetection": "force",
7
+ "noEmitOnError": true,
8
+ "skipLibCheck": true,
9
+ "lib": [
10
+ "es2020",
11
+ "dom",
12
+ "dom.iterable",
13
+ "esnext"
14
+ ],
15
+ "jsx": "react-jsx",
16
+ "strict": true,
17
+ "verbatimModuleSyntax": false,
18
+ "noUncheckedIndexedAccess": false, // use me for strict array/object access checks
19
+ "esModuleInterop": true,
20
+ "allowSyntheticDefaultImports": true,
21
+ "experimentalDecorators": true,
22
+ "useDefineForClassFields": false,
23
+ "outDir": "lib",
24
+ "rootDir": "src",
25
+ "declaration": true,
26
+ "resolveJsonModule": true,
27
+ "allowJs": true,
28
+ "baseUrl": "src",
29
+ "paths": {
30
+ "VARIABLE_FULL_NAME": [
31
+ "./index"
32
+ ]
33
+ },
34
+ "sourceMap": true,
35
+ "inlineSources": true,
36
+ "incremental": true,
37
+ "tsBuildInfoFile": ".temp/build/tsconfig.tsbuildinfo",
38
+ },
39
+ "include": [
40
+ "src"
41
+ ]
42
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "sourceMap": false,
5
+ "inlineSources": false,
6
+ "declarationMap": false,
7
+ "incremental": false
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": ".."
5
+ },
6
+ "include": [
7
+ "."
8
+ ]
9
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "parserOptions": {
3
+ "ecmaVersion": 2021, // or a later version
4
+ "sourceType": "module", // if you're using ES6 modules
5
+ "ecmaFeatures": {
6
+ "experimentalObjectRestSpread": true // Enable support for class properties
7
+ }
8
+ },
9
+ "env": {
10
+ "es6": true, // Make sure ES6 globals are enabled,
11
+ "node": true
12
+ },
13
+ "rules": {
14
+ "brace-style": [
15
+ "error",
16
+ "allman",
17
+ {
18
+ "allowSingleLine": true
19
+ }
20
+ ],
21
+ "indent": [
22
+ "error",
23
+ 2
24
+ ]
25
+ }
26
+ }
@@ -0,0 +1 @@
1
+ *.json linguist-language=JSON-with-Comments
@@ -0,0 +1,101 @@
1
+ # Git Workflow Guide
2
+
3
+ This document outlines the recommended workflow for handling tasks within our projects, emphasizing the use of git for version control. To ensure clarity, maintainability, and a clean project history, we adhere to specific practices for branching, committing, and merging changes.
4
+
5
+ ## Branch Management
6
+
7
+ For every task, whether it involves fixing bugs, adding features, or making minor updates, a new branch should be created. This approach keeps our project organized and ensures that each change is easily traceable to a specific task or issue.
8
+
9
+ ### Branch Creation Process
10
+
11
+ Follow these steps to start working on a new task:
12
+
13
+ 1. Open a new issue in the project's GitHub repository to document the task or bug.
14
+ 2. Create a branch for the task. Utilizing the GitHub GUI for both steps is recommended for convenience and consistency.
15
+
16
+ ## Commit Guidelines
17
+
18
+ Commit messages should clearly describe the changes made, following a structured prefix syntax to facilitate quick understanding and categorization of the commit's purpose.
19
+
20
+ ### Standard Commit Syntax
21
+
22
+ For general changes:
23
+
24
+ ```bash
25
+ git commit -m "prefix: description"
26
+ ```
27
+
28
+ For changes specific to a component:
29
+
30
+ ```bash
31
+ git commit -m "prefix: [component-name] description"
32
+ ```
33
+
34
+ For example:
35
+
36
+ ```bash
37
+ git commit -m "fix: [button] trigger click on enter press"
38
+ ```
39
+
40
+ ### Commit Prefixes
41
+
42
+ While the following prefixes are recommended, they are not exhaustive. Feel free to introduce new prefixes as needed, but aim for consistency and clarity across the project.
43
+
44
+ - **fix**: For fixes that correct bugs or issues.
45
+ - **bug**: Specifically for bug fixes.
46
+ - **chore**: For maintenance tasks that do not alter functionality.
47
+ - **add**: When adding new features or elements.
48
+ - **clean**: For clean-up tasks that improve the code without changing functionality.
49
+ - **style**: For changes related to styling and appearance.
50
+ - **react**: For changes specific to React components or functionality.
51
+ - **release**: For version releases and related tasks.
52
+ - **gen**: For auto-generated content or files.
53
+ - **resolve**: To indicate that an issue has been resolved, useful for final commits related to fixing a problem.
54
+
55
+ ## Merging Changes
56
+
57
+ Once your branch's task is completed, ensure it is integrated seamlessly with the main branch. This process involves updating your branch with the latest changes from the main branch and consolidating your work into a well-documented commit.
58
+
59
+ ### Finalizing Your Branch for Merge
60
+
61
+ 1. Update the main branch with the latest changes:
62
+
63
+ ```bash
64
+ git checkout main
65
+ git pull
66
+ ```
67
+
68
+ 2. Switch back to your task branch:
69
+
70
+ ```bash
71
+ git checkout your-branch-name
72
+ ```
73
+
74
+ 3. Start the rebase process interactively:
75
+
76
+ ```bash
77
+ git rebase -i main
78
+ ```
79
+
80
+ During the rebase, squash your commits into a single commit that captures the essence of your branch's work.
81
+
82
+ 4. Craft a comprehensive commit message that includes a changelog listing all significant changes. Ensure the branch's purpose is clear, and link the issue ticket using GitHub's syntax to automatically close the related issue upon merging.
83
+
84
+ #### Commit Message Example
85
+
86
+ ```
87
+ resolve: [button] Ensure click is triggered on enter press
88
+ closes: #888
89
+ changelog:
90
+ - fix: Corrected event handling
91
+ - clean: Optimized button click logic
92
+ ```
93
+
94
+ ### Tips for Effective Rebasing
95
+
96
+ Utilize Vim commands to streamline the rebase process:
97
+
98
+ - To squash all commits: `%s/pick /s /g`
99
+ - To format commit messages as a list during the rebase: `:%s/\([^:]\+\): /- \1: /g`
100
+
101
+ Adhering to these guidelines will help maintain a clean, understandable, and navigable project history, facilitating collaboration and review processes.