@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.
- package/README.md +198 -0
- package/asset/component-templates/browser/src/component.ts +7 -0
- package/asset/component-templates/browser/src/index.ts +3 -0
- package/asset/component-templates/browser/src/types.ts +1 -0
- package/asset/component-templates/browser/tests/index.html +15 -0
- package/asset/component-templates/browser/tests/main.js +1 -0
- package/asset/component-templates/browser/tests/public/icons/.gitkeep +0 -0
- package/asset/component-templates/browser/tests/public/images/.gitkeep +0 -0
- package/asset/component-templates/browser/tests/public/translations/en.json +7 -0
- package/asset/component-templates/browser/tests/snapshot.test.ts +12 -0
- package/asset/component-templates/browser/tests/unit.test.ts +69 -0
- package/asset/component-templates/browser/views/index.html +29 -0
- package/asset/component-templates/browser/views/main.js +13 -0
- package/asset/component-templates/browser/views/public/icons/.gitkeep +0 -0
- package/asset/component-templates/browser/views/public/images/.gitkeep +0 -0
- package/asset/component-templates/browser/views/public/translations/en.json +7 -0
- package/asset/component-templates/browser/views/style.css +28 -0
- package/asset/component-templates/game/src/component.ts +7 -0
- package/asset/component-templates/game/src/index.ts +3 -0
- package/asset/component-templates/game/src/types.ts +1 -0
- package/asset/component-templates/game/tests/index.html +15 -0
- package/asset/component-templates/game/tests/main.js +34 -0
- package/asset/component-templates/game/tests/public/models/.gitkeep +0 -0
- package/asset/component-templates/game/tests/public/textures/.gitkeep +0 -0
- package/asset/component-templates/game/tests/public/translations/en.json +7 -0
- package/asset/component-templates/game/tests/snapshot.test.ts +12 -0
- package/asset/component-templates/game/tests/unit.test.ts +18 -0
- package/asset/component-templates/game/views/index.html +22 -0
- package/asset/component-templates/game/views/main.js +34 -0
- package/asset/component-templates/game/views/public/models/.gitkeep +0 -0
- package/asset/component-templates/game/views/public/textures/.gitkeep +0 -0
- package/asset/component-templates/game/views/public/translations/en.json +7 -0
- package/asset/component-templates/game/views/style.css +9 -0
- package/asset/component-templates/node/src/component.ts +7 -0
- package/asset/component-templates/node/src/index.ts +3 -0
- package/asset/component-templates/node/src/types.ts +1 -0
- package/asset/component-templates/node/tests/unit.test.js +10 -0
- package/asset/component-templates/theme/lib/theme.css +80 -0
- package/asset/component-templates/theme/src/theme.css +205 -0
- package/asset/component-templates/theme/tests/index.html +15 -0
- package/asset/component-templates/theme/tests/main.js +1 -0
- package/asset/component-templates/theme/tests/public/icons/.gitkeep +0 -0
- package/asset/component-templates/theme/tests/public/images/.gitkeep +0 -0
- package/asset/component-templates/theme/tests/public/translations/en.json +7 -0
- package/asset/component-templates/theme/tests/snapshot.test.ts +12 -0
- package/asset/component-templates/theme/tests/unit.test.ts +67 -0
- package/asset/component-templates/theme/views/index.html +110 -0
- package/asset/component-templates/theme/views/main.js +14 -0
- package/asset/component-templates/theme/views/style.css +241 -0
- package/asset/component-templates/web-component/src/component.ts +31 -0
- package/asset/component-templates/web-component/src/index.ts +15 -0
- package/asset/component-templates/web-component/src/style.css +4 -0
- package/asset/component-templates/web-component/src/types.ts +1 -0
- package/asset/component-templates/web-component/tests/index.html +17 -0
- package/asset/component-templates/web-component/tests/main.js +1 -0
- package/asset/component-templates/web-component/tests/public/icons/.gitkeep +0 -0
- package/asset/component-templates/web-component/tests/public/images/.gitkeep +0 -0
- package/asset/component-templates/web-component/tests/public/translations/en.json +7 -0
- package/asset/component-templates/web-component/tests/snapshot.test.ts +12 -0
- package/asset/component-templates/web-component/tests/unit.test.ts +69 -0
- package/asset/component-templates/web-component/views/index.html +28 -0
- package/asset/component-templates/web-component/views/main.js +14 -0
- package/asset/component-templates/web-component/views/public/icons/.gitkeep +0 -0
- package/asset/component-templates/web-component/views/public/images/.gitkeep +0 -0
- package/asset/component-templates/web-component/views/public/translations/en.json +7 -0
- package/asset/component-templates/web-component/views/style.css +28 -0
- package/asset/package-templates/browser/README.md +44 -0
- package/asset/package-templates/browser/asset/icons/.gitkeep +0 -0
- package/asset/package-templates/browser/asset/images/.gitkeep +0 -0
- package/asset/package-templates/browser/asset/translations/en.json +7 -0
- package/asset/package-templates/browser/package.json +76 -0
- package/asset/package-templates/browser/src/.gitkeep +0 -0
- package/asset/package-templates/browser/tests/playwright.config.ts +81 -0
- package/asset/package-templates/browser/tests/tsconfig.json +9 -0
- package/asset/package-templates/browser/tsconfig.json +41 -0
- package/asset/package-templates/browser/tsconfig.prod.json +9 -0
- package/asset/package-templates/game/README.md +40 -0
- package/asset/package-templates/game/asset/models/.gitkeep +0 -0
- package/asset/package-templates/game/asset/textures/.gitkeep +0 -0
- package/asset/package-templates/game/asset/translations/en.json +7 -0
- package/asset/package-templates/game/package.json +78 -0
- package/asset/package-templates/game/src/.gitkeep +0 -0
- package/asset/package-templates/game/tests/playwright.config.ts +80 -0
- package/asset/package-templates/game/tests/tsconfig.json +9 -0
- package/asset/package-templates/game/tsconfig.json +41 -0
- package/asset/package-templates/game/tsconfig.prod.json +9 -0
- package/asset/package-templates/game/views/.gitkeep +0 -0
- package/asset/package-templates/game/views/tsconfig.json +9 -0
- package/asset/package-templates/node/README.md +40 -0
- package/asset/package-templates/node/asset/translations/en.json +7 -0
- package/asset/package-templates/node/package.json +70 -0
- package/asset/package-templates/node/src/.gitkeep +0 -0
- package/asset/package-templates/node/tests/.gitkeep +0 -0
- package/asset/package-templates/node/tests/tsconfig.json +9 -0
- package/asset/package-templates/node/tsconfig.json +38 -0
- package/asset/package-templates/node/tsconfig.prod.json +9 -0
- package/asset/package-templates/theme/README.md +44 -0
- package/asset/package-templates/theme/asset/icons/.gitkeep +0 -0
- package/asset/package-templates/theme/asset/images/.gitkeep +0 -0
- package/asset/package-templates/theme/asset/translations/en.json +7 -0
- package/asset/package-templates/theme/package.json +70 -0
- package/asset/package-templates/theme/tests/playwright.config.ts +81 -0
- package/asset/package-templates/theme/tsconfig.json +39 -0
- package/asset/package-templates/theme/tsconfig.prod.json +9 -0
- package/asset/package-templates/web-component/README.md +55 -0
- package/asset/package-templates/web-component/asset/icons/.gitkeep +0 -0
- package/asset/package-templates/web-component/asset/images/.gitkeep +0 -0
- package/asset/package-templates/web-component/asset/translations/en.json +7 -0
- package/asset/package-templates/web-component/package.json +79 -0
- package/asset/package-templates/web-component/src/global-css.d.ts +4 -0
- package/asset/package-templates/web-component/tests/playwright.config.ts +81 -0
- package/asset/package-templates/web-component/tests/tsconfig.json +9 -0
- package/asset/package-templates/web-component/tsconfig.json +42 -0
- package/asset/package-templates/web-component/tsconfig.prod.json +9 -0
- package/asset/package-templates/web-component/views/.gitkeep +0 -0
- package/asset/package-templates/web-component/views/tsconfig.json +9 -0
- package/asset/project-template/.eslintrc +26 -0
- package/asset/project-template/.gitattributes +1 -0
- package/asset/project-template/.github/ISSUE_TEMPLATE/CONTRIBUTING.md +101 -0
- package/asset/project-template/.github/workflows/build-cache.yml +30 -0
- package/asset/project-template/.github/workflows/initialise.yml +49 -0
- package/asset/project-template/.github/workflows/publish.yml +59 -0
- package/asset/project-template/.github/workflows/pull-request.yml +73 -0
- package/asset/project-template/.github/workflows/update-snapshots.yml +80 -0
- package/asset/project-template/.nvmrc +1 -0
- package/asset/project-template/.vscode/settings.json +19 -0
- package/asset/project-template/.vscode/web-components.code-workspace +25 -0
- package/asset/project-template/README.md +45 -0
- package/asset/project-template/bin/clean.mjs +28 -0
- package/asset/project-template/bin/runners/example-runner/runner.js +4 -0
- package/asset/project-template/bin/spawn-command.mjs +31 -0
- package/asset/project-template/bin/test.mjs +94 -0
- package/asset/project-template/package.json +42 -0
- package/asset/project-template/packages/atoms/.gitkeep +0 -0
- package/asset/project-template/packages/molecules/.gitkeep +0 -0
- package/asset/project-template/packages/organisms/.gitkeep +0 -0
- package/asset/project-template/packages/pages/.gitkeep +0 -0
- package/asset/project-template/packages/templates/.gitkeep +0 -0
- package/lib/bundle.d.ts +1 -0
- package/lib/bundle.js +4 -0
- package/package.json +72 -0
|
@@ -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,55 @@
|
|
|
1
|
+
# VARIABLE_FULL_NAME
|
|
2
|
+
|
|
3
|
+
VARIABLE_DESCRIPTION
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
[](VARIABLE_GITHUB_REPO/actions/workflows/pull-request.yml)
|
|
11
|
+
[](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).
|
|
File without changes
|
|
File without changes
|
|
@@ -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,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,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
|
+
}
|
|
File without changes
|
|
@@ -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.
|