@justeattakeaway/pie-components-config 0.12.0 → 0.14.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/package.json CHANGED
@@ -1,14 +1,18 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-components-config",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "author": "Just Eat Takeaway.com - Design System Team",
7
7
  "description": "Shared configuration files for PIE components",
8
+ "bin": {
9
+ "playwright-lit-setup": "./scripts/playwright-lit-setup.js"
10
+ },
8
11
  "files": [
9
12
  "custom-elements-manifest.config.js",
10
13
  "vite.config.js",
11
14
  "tsconfig.json",
15
+ "playwright/**",
12
16
  "playwright-lit-config.js",
13
17
  "playwright-lit-visual-config.js"
14
18
  ],
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <link rel="preload" href="https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Regular-optimised.woff2" as="font" type="font/woff2" crossorigin>
7
+ <link rel="preload" href="https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Bold-optimised.woff2" as="font" type="font/woff2" crossorigin>
8
+ <link rel="preload" href="https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-ExtraBold-optimised.woff2" as="font" type="font/woff2" crossorigin>
9
+ <style>
10
+ @font-face {
11
+ font-family: JETSansDigital;
12
+ src: url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Regular-optimised.woff2') format("woff2"),
13
+ url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Regular-optimised.woff') format("woff");
14
+ font-weight: 400;
15
+ font-display: swap;
16
+ }
17
+ @font-face {
18
+ font-family: JETSansDigital;
19
+ src: url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Bold-optimised.woff2') format("woff2"),
20
+ url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-Bold-optimised.woff') format("woff");
21
+ font-weight: 700;
22
+ font-display: swap;
23
+ }
24
+ @font-face {
25
+ font-family: JETSansDigital;
26
+ src: url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-ExtraBold-optimised.woff2') format("woff2"),
27
+ url('https://d30v2pzvrfyzpo.cloudfront.net/fonts/JETSansDigital-ExtraBold-optimised.woff') format("woff");
28
+ font-weight: 800;
29
+ font-display: swap;
30
+ }
31
+ body {
32
+ font-feature-settings: "tnum"; /* Enable tabular numbers */
33
+ }
34
+ /* basic styles to center align components and give them some spacing */
35
+ #root {
36
+ padding: 1em;
37
+ }
38
+
39
+ #root > * {
40
+ display: block;
41
+ margin-inline: auto;
42
+ }
43
+
44
+ #root > * + * {
45
+ margin-top: 1em;
46
+ }
47
+ </style>
48
+ <title>Testing Page</title>
49
+ <link rel="stylesheet" type="text/css" href="https://unpkg.com/@justeattakeaway/pie-css/dist/index.css" />
50
+ <link rel="stylesheet" type="text/css" href="https://unpkg.com/@justeat/pie-design-tokens/dist/jet.css" />
51
+ <link rel="stylesheet" type="text/css" href="https://unpkg.com/@justeat/pie-design-tokens/dist/jet-hsl-colors.css" />
52
+ </head>
53
+ <body>
54
+ <div id="root"></div>
55
+ <script type="module" src="./index.ts"></script>
56
+ </body>
57
+ </html>
@@ -0,0 +1 @@
1
+ // Despite being an empty file, Playwright component tests are dependant on this file existing.
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import fs from 'fs/promises';
5
+
6
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = path.dirname(__filename);
8
+
9
+ const destinationDir = path.resolve(process.cwd(), 'playwright');
10
+
11
+ async function copyPlaywrightFiles () {
12
+ try {
13
+ try {
14
+ await fs.access(destinationDir);
15
+ } catch (err) {
16
+ await fs.mkdir(destinationDir, { recursive: true });
17
+ }
18
+
19
+ const playwrightFiles = ['index.html', 'index.ts'];
20
+ playwrightFiles.forEach(async (file) => {
21
+ const sourceFile = path.resolve(__dirname, '..', `playwright/${file}`);
22
+ const destinationFile = path.resolve(destinationDir, file);
23
+
24
+ await fs.copyFile(sourceFile, destinationFile);
25
+ console.log(`Playwright ${file} copied successfully.`);
26
+ });
27
+ } catch (err) {
28
+ console.error('Error copying Playwright files.:', err);
29
+ }
30
+ }
31
+
32
+ copyPlaywrightFiles();
package/tsconfig.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "ES6",
3
+ "target": "es2021",
4
4
  "module": "ES2022",
5
- "lib": ["es2020", "DOM", "DOM.Iterable"],
5
+ "lib": ["es2021", "DOM", "DOM.Iterable"],
6
6
  "declaration": true,
7
7
  "declarationMap": true,
8
8
  "sourceMap": true,
@@ -21,7 +21,8 @@
21
21
  "forceConsistentCasingInFileNames": true,
22
22
  "allowImportingTsExtensions": true,
23
23
  "noEmit": true,
24
- "types": ["vitest/globals"]
24
+ "types": ["vitest/globals"],
25
+ "useDefineForClassFields": false
25
26
  },
26
27
  "exclude": []
27
28
  }