From 5ce9a0a638d557a73c217c54b2d4e88d0a106025 Mon Sep 17 00:00:00 2001 From: Anurag Gupta Date: Sat, 27 Jul 2024 02:38:12 +0530 Subject: [PATCH 01/12] fix: win path --- package-lock.json | 74 +++++++++++++++++++++++++++++++++++++++++++++++ scripts/build.js | 4 +-- scripts/utils.js | 5 ++++ 3 files changed, 81 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index aeff60e1..44619f56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10147,6 +10147,10 @@ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, + "node_modules/ecc-client-elixir-drs-filer": { + "resolved": "packages/ecc-client-elixir-drs-filer", + "link": true + }, "node_modules/ecc-docs": { "resolved": "apps/documentation", "link": true @@ -24117,6 +24121,76 @@ "url": "https://github.com/sponsors/wooorm" } }, + "packages/ecc-client-elixir-drs-filer": { + "version": "0.1.0", + "license": "Apache-2.0", + "devDependencies": { + "@elixir-cloud/eslint-config": "*", + "@lit/react": "*", + "commander": "*", + "custom-element-jet-brains-integration": "*", + "custom-element-vs-code-integration": "*", + "eslint": "^8.41.0", + "eslint-plugin-prettier": "^4.2.1", + "react": "*", + "typescript": "*" + } + }, + "packages/ecc-client-elixir-drs-filer/node_modules/eslint": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "packages/ecc-client-elixir-trs-filer": { "name": "@elixir-cloud/trs-filer", "version": "0.0.0", diff --git a/scripts/build.js b/scripts/build.js index 2cf1737c..3861d5ee 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -10,7 +10,7 @@ const tsup = require("tsup"); const { program } = require("commander"); const { execSync } = require("child_process"); const fs = require("fs"); -const { npmDir } = require("./utils.js"); +const { npmDir, normalizePath } = require("./utils.js"); const path = require("path"); const { reactDir } = require("./utils.js"); @@ -120,7 +120,7 @@ nextTask("Building source", async () => { format: "esm", target: "es2017", entry: [ - `${sourceDir}/index.ts`, + normalizePath(path.join(sourceDir, "index.ts")), ...(await fg(`${sourceDir}/components/**/!(*.(test)).ts`)), ...(await fg(`${sourceDir}/react/**/*.ts`)), ...(await fg(`${sourceDir}/utilities/**/*.ts`)), diff --git a/scripts/utils.js b/scripts/utils.js index beb4ee0f..5c822e5a 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -36,10 +36,15 @@ function pascalCase(str) { .join(""); } +function normalizePath(filename) { + return filename.split(path.win32.sep).join(path.posix.sep); +} + module.exports = { componentsPrefix, npmDir, getAllComponents, pascalCase, reactDir: path.join(cwd(), "./src/react"), + normalizePath, }; From cc7d21daa4d9c5a8b76cb94bc30aa6641938b673 Mon Sep 17 00:00:00 2001 From: Salihu <91833785+SalihuDickson@users.noreply.github.com> Date: Mon, 5 Aug 2024 22:52:03 +0100 Subject: [PATCH 02/12] Fix/win path (#341) Co-authored-by: salihuDickson --- scripts/build.js | 8 ++++---- scripts/utils.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index 3861d5ee..83afc4e6 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -120,10 +120,10 @@ nextTask("Building source", async () => { format: "esm", target: "es2017", entry: [ - normalizePath(path.join(sourceDir, "index.ts")), - ...(await fg(`${sourceDir}/components/**/!(*.(test)).ts`)), - ...(await fg(`${sourceDir}/react/**/*.ts`)), - ...(await fg(`${sourceDir}/utilities/**/*.ts`)), + normalizePath(`${sourceDir}/index.ts`), + ...(await fg(normalizePath(`${sourceDir}/components/**/!(*.(test)).ts`))), + ...(await fg(normalizePath(`${sourceDir}/react/**/*.ts`))), + ...(await fg(normalizePath(`${sourceDir}/utilities/**/*.ts`))), ], splitting: true, treeshake: true, diff --git a/scripts/utils.js b/scripts/utils.js index 5c822e5a..da815876 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -45,6 +45,6 @@ module.exports = { npmDir, getAllComponents, pascalCase, - reactDir: path.join(cwd(), "./src/react"), + reactDir: path.join(cwd(), ".", "src", "react"), normalizePath, }; From a8164952c13d1e702cca41e17590ac25be1f7602 Mon Sep 17 00:00:00 2001 From: salihuDickson Date: Tue, 6 Aug 2024 17:45:24 +0100 Subject: [PATCH 03/12] add engine requirement --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 85fb820e..e5d2d619 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,9 @@ "@rollup/rollup-linux-x64-gnu": "4.6.1" }, "packageManager": "npm@9.2.0", + "engines": { + "node": ">=16.0.0" + }, "workspaces": [ "apps/*", "packages/*" From c88869adf0b68e26418b0bbbfdd388cb299e1903 Mon Sep 17 00:00:00 2001 From: Shivang Date: Sun, 11 Aug 2024 14:35:04 +0530 Subject: [PATCH 04/12] Initial boiler plate for ro-crate package --- package-lock.json | 626 ++++++++++++++++-- .../ecc-client-elixir-ro-crate/.eslintignore | 21 + packages/ecc-client-elixir-ro-crate/.eslintrc | 7 + .../ecc-client-elixir-ro-crate/.gitignore | 14 + .../ecc-client-elixir-ro-crate/LICENSE.hbs | 202 ++++++ packages/ecc-client-elixir-ro-crate/README.md | 12 + .../custom-elements-manifest.config.js | 152 +++++ .../images/logo-elixir-cloud-aai.svg | 112 ++++ .../images/logo-elixir.svg | 82 +++ .../ecc-client-elixir-ro-crate/package.json | 46 ++ .../ecc-client-elixir-ro-crate/src/index.ts | 0 .../ecc-client-elixir-ro-crate/tsconfig.json | 23 + .../tsconfig.prod.json | 9 + .../web-dev-server.config.mjs | 27 + .../web-test-runner.config.mjs | 49 ++ 15 files changed, 1339 insertions(+), 43 deletions(-) create mode 100644 packages/ecc-client-elixir-ro-crate/.eslintignore create mode 100644 packages/ecc-client-elixir-ro-crate/.eslintrc create mode 100644 packages/ecc-client-elixir-ro-crate/.gitignore create mode 100644 packages/ecc-client-elixir-ro-crate/LICENSE.hbs create mode 100644 packages/ecc-client-elixir-ro-crate/README.md create mode 100644 packages/ecc-client-elixir-ro-crate/custom-elements-manifest.config.js create mode 100644 packages/ecc-client-elixir-ro-crate/images/logo-elixir-cloud-aai.svg create mode 100644 packages/ecc-client-elixir-ro-crate/images/logo-elixir.svg create mode 100644 packages/ecc-client-elixir-ro-crate/package.json create mode 100644 packages/ecc-client-elixir-ro-crate/src/index.ts create mode 100644 packages/ecc-client-elixir-ro-crate/tsconfig.json create mode 100644 packages/ecc-client-elixir-ro-crate/tsconfig.prod.json create mode 100644 packages/ecc-client-elixir-ro-crate/web-dev-server.config.mjs create mode 100644 packages/ecc-client-elixir-ro-crate/web-test-runner.config.mjs diff --git a/package-lock.json b/package-lock.json index 44619f56..75320bd9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,6 +33,9 @@ "turbo": "^1.13.0", "typescript": "^5.3.3" }, + "engines": { + "node": ">=16.0.0" + }, "optionalDependencies": { "@rollup/rollup-linux-x64-gnu": "4.6.1" } @@ -3404,6 +3407,70 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/@puppeteer/browsers": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.3.0.tgz", + "integrity": "sha512-ioXoq9gPxkss4MYhD+SFaU9p1IHFUX0ILAWFPyjGaBdjLsYAlZw6j1iLA0N/m12uVHLFDfSYNF7EQccjinIMDA==", + "dev": true, + "dependencies": { + "debug": "^4.3.5", + "extract-zip": "^2.0.1", + "progress": "^2.0.3", + "proxy-agent": "^6.4.0", + "semver": "^7.6.3", + "tar-fs": "^3.0.6", + "unbzip2-stream": "^1.4.3", + "yargs": "^17.7.2" + }, + "bin": { + "browsers": "lib/cjs/main-cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@puppeteer/browsers/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@puppeteer/browsers/node_modules/tar-fs": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.6.tgz", + "integrity": "sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w==", + "dev": true, + "dependencies": { + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^2.1.1", + "bare-path": "^2.1.0" + } + }, + "node_modules/@puppeteer/browsers/node_modules/tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "dev": true, + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, "node_modules/@react-spring/animated": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/@react-spring/animated/-/animated-9.6.1.tgz", @@ -5219,22 +5286,22 @@ } }, "node_modules/@web/dev-server": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@web/dev-server/-/dev-server-0.4.4.tgz", - "integrity": "sha512-Gye0DhDbst/KVNRCFzRd+4V9LJmuuQYJBsf6UXeEbCYuBSKeshEW4AA1esLsfy1gONsD6NIGiru5509l35P9Ug==", + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/@web/dev-server/-/dev-server-0.4.6.tgz", + "integrity": "sha512-jj/1bcElAy5EZet8m2CcUdzxT+CRvUjIXGh8Lt7vxtthkN9PzY9wlhWx/9WOs5iwlnG1oj0VGo6f/zvbPO0s9w==", "dev": true, "dependencies": { "@babel/code-frame": "^7.12.11", "@types/command-line-args": "^5.0.0", "@web/config-loader": "^0.3.0", - "@web/dev-server-core": "^0.7.1", + "@web/dev-server-core": "^0.7.2", "@web/dev-server-rollup": "^0.6.1", "camelcase": "^6.2.0", "command-line-args": "^5.1.1", "command-line-usage": "^7.0.1", "debounce": "^1.2.0", "deepmerge": "^4.2.2", - "ip": "^2.0.1", + "internal-ip": "^6.2.0", "nanocolors": "^0.2.1", "open": "^8.0.2", "portfinder": "^1.0.32" @@ -5248,9 +5315,9 @@ } }, "node_modules/@web/dev-server-core": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@web/dev-server-core/-/dev-server-core-0.7.1.tgz", - "integrity": "sha512-alHd2j0f4e1ekqYDR8lWScrzR7D5gfsUZq3BP3De9bkFWM3AELINCmqqlVKmCtlkAdEc9VyQvNiEqrxraOdc2A==", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@web/dev-server-core/-/dev-server-core-0.7.2.tgz", + "integrity": "sha512-Q/0jpF13Ipk+qGGQ+Yx/FW1TQBYazpkfgYHHo96HBE7qv4V4KKHqHglZcSUxti/zd4bToxX1cFTz8dmbTlb8JA==", "dev": true, "dependencies": { "@types/koa": "^2.11.6", @@ -7247,6 +7314,45 @@ "dev": true, "optional": true }, + "node_modules/bare-fs": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-2.3.1.tgz", + "integrity": "sha512-W/Hfxc/6VehXlsgFtbB5B4xFcsCl+pAh30cYhoFyXErf6oGrwjh8SwiPAdHgpmWonKuYpZgGywN0SXt7dgsADA==", + "dev": true, + "optional": true, + "dependencies": { + "bare-events": "^2.0.0", + "bare-path": "^2.0.0", + "bare-stream": "^2.0.0" + } + }, + "node_modules/bare-os": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-2.4.0.tgz", + "integrity": "sha512-v8DTT08AS/G0F9xrhyLtepoo9EJBJ85FRSMbu1pQUlAf6A8T0tEEQGMVObWeqpjhSPXsE0VGlluFBJu2fdoTNg==", + "dev": true, + "optional": true + }, + "node_modules/bare-path": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-2.1.3.tgz", + "integrity": "sha512-lh/eITfU8hrj9Ru5quUp0Io1kJWIk1bTjzo7JH1P5dWmQ2EL4hFUlfI8FonAhSlgIfhn63p84CDY/x+PisgcXA==", + "dev": true, + "optional": true, + "dependencies": { + "bare-os": "^2.1.0" + } + }, + "node_modules/bare-stream": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.1.3.tgz", + "integrity": "sha512-tiDAH9H/kP+tvNO5sczyn9ZAA7utrSMobyDchsnyyXBuUe2FSQWbxhtuHB8jwpHYYevVo2UJpcmvvjrbHboUUQ==", + "dev": true, + "optional": true, + "dependencies": { + "streamx": "^2.18.0" + } + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -10151,6 +10257,10 @@ "resolved": "packages/ecc-client-elixir-drs-filer", "link": true }, + "node_modules/ecc-client-elixir-ro-crate": { + "resolved": "packages/ecc-client-elixir-ro-crate", + "link": true + }, "node_modules/ecc-docs": { "resolved": "apps/documentation", "link": true @@ -13649,6 +13759,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/internal-ip": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-6.2.0.tgz", + "integrity": "sha512-D8WGsR6yDt8uq7vDMu7mjcR+yRMm3dW8yufyChmszWRjcSHuxLBkR3GdS2HZAjodsaGuCvXeEJpueisXJULghg==", + "dev": true, + "dependencies": { + "default-gateway": "^6.0.0", + "ipaddr.js": "^1.9.1", + "is-ip": "^3.1.0", + "p-event": "^4.2.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/internal-ip?sponsor=1" + } + }, "node_modules/internal-slot": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", @@ -13704,6 +13832,15 @@ "node": ">= 12" } }, + "node_modules/ip-regex": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", + "integrity": "sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -13979,6 +14116,18 @@ "node": ">=8" } }, + "node_modules/is-ip": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-3.1.0.tgz", + "integrity": "sha512-35vd5necO7IitFPjd/YBeqwWnyDWbuLH9ZXQdMfDA8TEo7pv5X8yfrvVO3xbJbLUlERCMvf6X0hTUamQxCYJ9Q==", + "dev": true, + "dependencies": { + "ip-regex": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/is-lower-case": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/is-lower-case/-/is-lower-case-1.1.3.tgz", @@ -14816,9 +14965,9 @@ } }, "node_modules/lit-html": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.1.2.tgz", - "integrity": "sha512-3OBZSUrPnAHoKJ9AMjRL/m01YJxQMf+TMHanNtTHG68ubjnZxK0RFl102DPzsw4mWnHibfZIBJm3LWCZ/LmMvg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.2.0.tgz", + "integrity": "sha512-pwT/HwoxqI9FggTrYVarkBKFN9MlTUpLrDHubTmW4SrkL3kkqW5gxwbxMMUnbbRHBC0WTZnYHcjDSCM559VyfA==", "dependencies": { "@types/trusted-types": "^2.0.2" } @@ -17592,6 +17741,21 @@ "integrity": "sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==", "dev": true }, + "node_modules/p-event": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-4.2.0.tgz", + "integrity": "sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==", + "dev": true, + "dependencies": { + "p-timeout": "^3.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-filter": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-2.1.0.tgz", @@ -17691,6 +17855,18 @@ "node": ">=8" } }, + "node_modules/p-timeout": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-3.2.0.tgz", + "integrity": "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg==", + "dev": true, + "dependencies": { + "p-finally": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -19863,13 +20039,10 @@ } }, "node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -19877,24 +20050,6 @@ "node": ">=10" } }, - "node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/send": { "version": "0.18.0", "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", @@ -20644,13 +20799,14 @@ } }, "node_modules/streamx": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.16.1.tgz", - "integrity": "sha512-m9QYj6WygWyWa3H1YY69amr4nVgy61xfjys7xO7kviL5rfIEc2naf+ewFiOA+aEJD7y0JO3h2GoiUv4TDwEGzQ==", + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.18.0.tgz", + "integrity": "sha512-LLUC1TWdjVdn1weXGcSxyTR3T4+acB6tVGXT95y0nGbca4t4o/ng1wKAGTljm9VicuCVLvRlqFYXYy5GwgM7sQ==", "dev": true, "dependencies": { - "fast-fifo": "^1.1.0", - "queue-tick": "^1.0.1" + "fast-fifo": "^1.3.2", + "queue-tick": "^1.0.1", + "text-decoder": "^1.1.0" }, "optionalDependencies": { "bare-events": "^2.2.0" @@ -21291,6 +21447,15 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "node_modules/text-decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.1.1.tgz", + "integrity": "sha512-8zll7REEv4GDD3x4/0pW+ppIxSNs7H1J10IKFZsuOMscumCdM2a+toDGLPA3T+1+fLBql4zbt5z83GEQGGV5VA==", + "dev": true, + "dependencies": { + "b4a": "^1.6.4" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -23001,6 +23166,12 @@ "punycode": "^2.1.0" } }, + "node_modules/urlpattern-polyfill": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.0.0.tgz", + "integrity": "sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg==", + "dev": true + }, "node_modules/use-sync-external-store": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", @@ -24089,9 +24260,9 @@ } }, "node_modules/zod": { - "version": "3.22.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", - "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -24191,6 +24362,375 @@ "url": "https://opencollective.com/eslint" } }, + "packages/ecc-client-elixir-ro-crate": { + "version": "0.1.0", + "license": "Apache-2.0", + "dependencies": { + "@elixir-cloud/design": "^0.1.1", + "lit": "^3.2.0" + }, + "devDependencies": { + "@elixir-cloud/eslint-config": "*", + "@lit/react": "*", + "@web/dev-server": "^0.4.6", + "@web/test-runner": "^0.18.3", + "commander": "*", + "custom-element-jet-brains-integration": "*", + "custom-element-vs-code-integration": "*", + "eslint": "^8.41.0", + "eslint-plugin-prettier": "^4.2.1", + "react": "*", + "typescript": "*" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/@lit/reactive-element": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.0.4.tgz", + "integrity": "sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/@web/browser-logs": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@web/browser-logs/-/browser-logs-0.4.0.tgz", + "integrity": "sha512-/EBiDAUCJ2DzZhaFxTPRIznEPeafdLbXShIL6aTu7x73x7ZoxSDv7DGuTsh2rWNMUa4+AKli4UORrpyv6QBOiA==", + "dev": true, + "dependencies": { + "errorstacks": "^2.2.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/@web/config-loader": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@web/config-loader/-/config-loader-0.3.1.tgz", + "integrity": "sha512-IYjHXUgSGGNpO3YJQ9foLcazbJlAWDdJGRe9be7aOhon0Nd6Na5JIOJAej7jsMu76fKHr4b4w2LfIdNQ4fJ8pA==", + "dev": true, + "engines": { + "node": ">=18.0.0" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/@web/test-runner": { + "version": "0.18.3", + "resolved": "https://registry.npmjs.org/@web/test-runner/-/test-runner-0.18.3.tgz", + "integrity": "sha512-QkVK8Qguw3Zhyu8SYR7F4VdcjyXBeJNr8W8L++s4zO/Ok7DR/Wu7+rLswn3H7OH3xYoCHRmwteehcFejefz6ew==", + "dev": true, + "dependencies": { + "@web/browser-logs": "^0.4.0", + "@web/config-loader": "^0.3.0", + "@web/dev-server": "^0.4.0", + "@web/test-runner-chrome": "^0.16.0", + "@web/test-runner-commands": "^0.9.0", + "@web/test-runner-core": "^0.13.0", + "@web/test-runner-mocha": "^0.9.0", + "camelcase": "^6.2.0", + "command-line-args": "^5.1.1", + "command-line-usage": "^7.0.1", + "convert-source-map": "^2.0.0", + "diff": "^5.0.0", + "globby": "^11.0.1", + "nanocolors": "^0.2.1", + "portfinder": "^1.0.32", + "source-map": "^0.7.3" + }, + "bin": { + "web-test-runner": "dist/bin.js", + "wtr": "dist/bin.js" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/@web/test-runner-chrome": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@web/test-runner-chrome/-/test-runner-chrome-0.16.0.tgz", + "integrity": "sha512-Edc6Y49aVB6k18S5IOj9OCX3rEf8F3jptIu0p95+imqxmcutFEh1GNmlAk2bQGnXS0U6uVY7Xbf61fiaXUQqhg==", + "dev": true, + "dependencies": { + "@web/test-runner-core": "^0.13.0", + "@web/test-runner-coverage-v8": "^0.8.0", + "async-mutex": "0.4.0", + "chrome-launcher": "^0.15.0", + "puppeteer-core": "^22.0.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/@web/test-runner-core": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/@web/test-runner-core/-/test-runner-core-0.13.3.tgz", + "integrity": "sha512-ilDqF/v2sj0sD69FNSIDT7uw4M1yTVedLBt32/lXy3MMi6suCM7m/ZlhsBy8PXhf879WMvzBOl/vhJBpEMB9vA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.11", + "@types/babel__code-frame": "^7.0.2", + "@types/co-body": "^6.1.0", + "@types/convert-source-map": "^2.0.0", + "@types/debounce": "^1.2.0", + "@types/istanbul-lib-coverage": "^2.0.3", + "@types/istanbul-reports": "^3.0.0", + "@web/browser-logs": "^0.4.0", + "@web/dev-server-core": "^0.7.2", + "chokidar": "^3.4.3", + "cli-cursor": "^3.1.0", + "co-body": "^6.1.0", + "convert-source-map": "^2.0.0", + "debounce": "^1.2.0", + "dependency-graph": "^0.11.0", + "globby": "^11.0.1", + "internal-ip": "^6.2.0", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.0.2", + "log-update": "^4.0.0", + "nanocolors": "^0.2.1", + "nanoid": "^3.1.25", + "open": "^8.0.2", + "picomatch": "^2.2.2", + "source-map": "^0.7.3" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/@web/test-runner-coverage-v8": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@web/test-runner-coverage-v8/-/test-runner-coverage-v8-0.8.0.tgz", + "integrity": "sha512-PskiucYpjUtgNfR2zF2AWqWwjXL7H3WW/SnCAYmzUrtob7X9o/+BjdyZ4wKbOxWWSbJO4lEdGIDLu+8X2Xw+lA==", + "dev": true, + "dependencies": { + "@web/test-runner-core": "^0.13.0", + "istanbul-lib-coverage": "^3.0.0", + "lru-cache": "^8.0.4", + "picomatch": "^2.2.2", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/@web/test-runner-mocha": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@web/test-runner-mocha/-/test-runner-mocha-0.9.0.tgz", + "integrity": "sha512-ZL9F6FXd0DBQvo/h/+mSfzFTSRVxzV9st/AHhpgABtUtV/AIpVE9to6+xdkpu6827kwjezdpuadPfg+PlrBWqQ==", + "dev": true, + "dependencies": { + "@web/test-runner-core": "^0.13.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/chromium-bidi": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.6.3.tgz", + "integrity": "sha512-qXlsCmpCZJAnoTYI83Iu6EdYQpMYdVkCfq08KDh2pmlVqK5t5IA9mGs4/LwCwp4fqisSOMXZxP3HIh8w8aRn0A==", + "dev": true, + "dependencies": { + "mitt": "3.0.1", + "urlpattern-polyfill": "10.0.0", + "zod": "3.23.8" + }, + "peerDependencies": { + "devtools-protocol": "*" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/devtools-protocol": { + "version": "0.0.1312386", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1312386.tgz", + "integrity": "sha512-DPnhUXvmvKT2dFA/j7B+riVLUt9Q6RKJlcppojL5CoRywJJKLDYnRlw0gTFKfgDPHP5E04UoB71SxoJlVZy8FA==", + "dev": true + }, + "packages/ecc-client-elixir-ro-crate/node_modules/eslint": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/lit": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lit/-/lit-3.2.0.tgz", + "integrity": "sha512-s6tI33Lf6VpDu7u4YqsSX78D28bYQulM+VAzsGch4fx2H0eLZnJsUBsPWmGYSGoKDNbjtRv02rio1o+UdPVwvw==", + "dependencies": { + "@lit/reactive-element": "^2.0.4", + "lit-element": "^4.1.0", + "lit-html": "^3.2.0" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/lit-element": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.1.0.tgz", + "integrity": "sha512-gSejRUQJuMQjV2Z59KAS/D4iElUhwKpIyJvZ9w+DIagIQjfJnhR20h2Q5ddpzXGS+fF0tMZ/xEYGMnKmaI/iww==", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0", + "@lit/reactive-element": "^2.0.4", + "lit-html": "^3.2.0" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/lru-cache": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-8.0.5.tgz", + "integrity": "sha512-MhWWlVnuab1RG5/zMRRcVGXZLCXrZTgfwMikgzCegsPnG62yDQo5JnqKkrK4jO5iKqDAZGItAqN5CtKBCBWRUA==", + "dev": true, + "engines": { + "node": ">=16.14" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", + "dev": true + }, + "packages/ecc-client-elixir-ro-crate/node_modules/puppeteer-core": { + "version": "22.15.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-22.15.0.tgz", + "integrity": "sha512-cHArnywCiAAVXa3t4GGL2vttNxh7GqXtIYGym99egkNJ3oG//wL9LkvO4WE8W1TJe95t1F1ocu9X4xWaGsOKOA==", + "dev": true, + "dependencies": { + "@puppeteer/browsers": "2.3.0", + "chromium-bidi": "0.6.3", + "debug": "^4.3.6", + "devtools-protocol": "0.0.1312386", + "ws": "^8.18.0" + }, + "engines": { + "node": ">=18" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "packages/ecc-client-elixir-ro-crate/node_modules/ws": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "packages/ecc-client-elixir-trs-filer": { "name": "@elixir-cloud/trs-filer", "version": "0.0.0", diff --git a/packages/ecc-client-elixir-ro-crate/.eslintignore b/packages/ecc-client-elixir-ro-crate/.eslintignore new file mode 100644 index 00000000..b25dbca7 --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/.eslintignore @@ -0,0 +1,21 @@ +# Never lint node_modules +node_modules + +# Never lint build output +dist + +# Never lint coverage output +coverage + +# Never lint +**/.git +**/.svn +**/.hg +**/node_modules + +/.github/* +CONTRIBUTING.md +LICENSE +README.md +CONTRIBUTORS.md +CODE_OF_CONDUCT.md diff --git a/packages/ecc-client-elixir-ro-crate/.eslintrc b/packages/ecc-client-elixir-ro-crate/.eslintrc new file mode 100644 index 00000000..d4955fa7 --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/.eslintrc @@ -0,0 +1,7 @@ +{ + "extends": ["@elixir-cloud", "prettier"], + "plugins": ["prettier"], + "rules": { + "prettier/prettier": "error" + } +} diff --git a/packages/ecc-client-elixir-ro-crate/.gitignore b/packages/ecc-client-elixir-ro-crate/.gitignore new file mode 100644 index 00000000..9b9b7ba2 --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/.gitignore @@ -0,0 +1,14 @@ +/dist +/www +/node_modules +/build +.DS_Store +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* \ No newline at end of file diff --git a/packages/ecc-client-elixir-ro-crate/LICENSE.hbs b/packages/ecc-client-elixir-ro-crate/LICENSE.hbs new file mode 100644 index 00000000..977ad8c5 --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/LICENSE.hbs @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2022 ELIXIR, Wellcome Genome Campus, Hinxton, Cambridgeshire, CB10 1SD, UK + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/packages/ecc-client-elixir-ro-crate/README.md b/packages/ecc-client-elixir-ro-crate/README.md new file mode 100644 index 00000000..86e4c118 --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/README.md @@ -0,0 +1,12 @@ +# ecc-client-elixir-ro-crate Components + +Web components for interacting with ro-crates + +[![logo-elixir][logo-elixir]][elixir] +[![logo-elixir-cloud-aai][logo-elixir-cloud-aai]][elixir-cloud-aai] + + +[elixir]: https://elixir-europe.org/ +[elixir-cloud-aai]: https://elixir-cloud.dcc.sib.swiss/ +[logo-elixir]: images/logo-elixir.svg +[logo-elixir-cloud-aai]: images/logo-elixir-cloud-aai.svg diff --git a/packages/ecc-client-elixir-ro-crate/custom-elements-manifest.config.js b/packages/ecc-client-elixir-ro-crate/custom-elements-manifest.config.js new file mode 100644 index 00000000..741b3d03 --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/custom-elements-manifest.config.js @@ -0,0 +1,152 @@ +/* eslint-disable import/no-extraneous-dependencies */ +/* eslint-disable no-param-reassign */ +import fs from "fs"; +import { program } from "commander"; +import { customElementVsCodePlugin } from "custom-element-vs-code-integration"; +import { customElementJetBrainsPlugin } from "custom-element-jet-brains-integration"; +import packageJson from "./package.json" assert { type: "json" }; + +const options = program + .option("-o, --outdir ") + .option("--litelement") + .option("--analyze", "", true) + .parse() + .opts(); + +const componentsPrefix = packageJson.componentsPrefix; +const packageData = JSON.parse(fs.readFileSync("package.json", "utf8")); +const { name, description, version, author, homepage, license } = packageData; + +const getComponentDocumentation = (tag) => + `https://elixir-cloud-components.vercel.app/design/components/${tag.replace( + componentsPrefix, + "" + )}.html`; + +function replace(string, terms) { + terms.forEach(({ from, to }) => { + string = string?.replace(from, to); + }); + + return string; +} + +export default { + globs: ["src/components/**/*.ts"], + exclude: ["**/*.styles.ts", "**/*.test.ts", "index.ts"], + plugins: [ + // Append package data + { + name: "elixir-cloud-package-data", + packageLinkPhase({ customElementsManifest }) { + customElementsManifest.package = { + name, + description, + version, + author, + homepage, + license, + }; + }, + }, + { + name: "shoelace-react-event-names", + analyzePhase({ ts, node, moduleDoc }) { + switch (node.kind) { + case ts.SyntaxKind.ClassDeclaration: { + const className = node.name.getText(); + const classDoc = moduleDoc?.declarations?.find( + (declaration) => declaration.name === className + ); + + classDoc.jsDoc = node.jsDoc + ?.map((jsDoc) => jsDoc.getFullText()) + .join("\n"); + + if (classDoc?.events) { + classDoc.events.forEach((event) => { + // eslint-disable-next-line no-undef + event.reactName = `on${pascalCase(event.name)}`; + // eslint-disable-next-line no-undef + event.eventName = `${pascalCase(event.name)}Event`; + }); + } + break; + } + default: + break; + } + }, + }, + { + name: "shoelace-translate-module-paths", + packageLinkPhase({ customElementsManifest }) { + customElementsManifest?.modules?.forEach((mod) => { + // + // CEM paths look like this: + // + // src/components/form/index.ts + // + // But we want them to look like this: + // + // components/form/index.js + // + const terms = [ + { from: /^src\//, to: "" }, // Strip the src/ prefix + { from: /\.(t|j)sx?$/, to: ".js" }, // Convert .ts to .js + ]; + + mod.path = replace(mod.path, terms); + + for (const ex of mod.exports ?? []) { + ex.declaration.module = replace(ex.declaration.module, terms); + } + + for (const dec of mod.declarations ?? []) { + if (dec.kind === "class") { + for (const member of dec.members ?? []) { + if (member.inheritedFrom) { + member.inheritedFrom.module = replace( + member.inheritedFrom.module, + terms + ); + } + } + } + } + }); + }, + }, + // Generate custom VS Code data + customElementVsCodePlugin({ + outdir: options.outdir, + cssFileName: null, + referencesTemplate: (_, tag) => [ + { + name: "Documentation", + url: getComponentDocumentation(tag), + }, + ], + }), + customElementJetBrainsPlugin({ + outdir: "./dist", + excludeCss: true, + packageJson: false, + referencesTemplate: (_, tag) => ({ + name: "Documentation", + url: getComponentDocumentation(tag), + }), + }), + ], +}; + +function pascalCase(str) { + if (!str || typeof str !== "string") return ""; + + return str + .match(/[a-z]+/gi) + .map(function (word) { + return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); + }) + .join(""); +} diff --git a/packages/ecc-client-elixir-ro-crate/images/logo-elixir-cloud-aai.svg b/packages/ecc-client-elixir-ro-crate/images/logo-elixir-cloud-aai.svg new file mode 100644 index 00000000..18ecf217 --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/images/logo-elixir-cloud-aai.svg @@ -0,0 +1,112 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/packages/ecc-client-elixir-ro-crate/images/logo-elixir.svg b/packages/ecc-client-elixir-ro-crate/images/logo-elixir.svg new file mode 100644 index 00000000..af9d4b92 --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/images/logo-elixir.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + diff --git a/packages/ecc-client-elixir-ro-crate/package.json b/packages/ecc-client-elixir-ro-crate/package.json new file mode 100644 index 00000000..fe01f5a5 --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/package.json @@ -0,0 +1,46 @@ +{ + "name": "ecc-client-elixir-ro-crate", + "description": "Web components for interacting with ro-crates", + "main": "index.js", + "type": "module", + "version": "0.1.0", + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "https://github.com/elixir-cloud-aai/cloud-components.git" + }, + "files": [ + "dist", + "README.md", + "package.json", + "LICENSE" + ], + "scripts": { + "analyze": "cem analyze --litelement", + "build": "node ../../scripts/build.js -p ecc-client-elixir-drs-filer-", + "dev": "concurrently -r \"npm run build -- --watch\" \"wds\"", + "clean": "rm -rf dist node_modules custom-elements-manifest.config.js", + "test": "wtr --coverage", + "test:watch": "wtr --watch", + "lint": "npx eslint .", + "lint:fix": "npm run lint -- --fix", + "prepublish": "npm run build" + }, + "devDependencies": { + "@elixir-cloud/eslint-config": "*", + "@lit/react": "*", + "@web/dev-server": "^0.4.6", + "@web/test-runner": "^0.18.3", + "commander": "*", + "custom-element-jet-brains-integration": "*", + "custom-element-vs-code-integration": "*", + "eslint": "^8.41.0", + "eslint-plugin-prettier": "^4.2.1", + "react": "*", + "typescript": "*" + }, + "dependencies": { + "@elixir-cloud/design": "^0.1.1", + "lit": "^3.2.0" + } +} diff --git a/packages/ecc-client-elixir-ro-crate/src/index.ts b/packages/ecc-client-elixir-ro-crate/src/index.ts new file mode 100644 index 00000000..e69de29b diff --git a/packages/ecc-client-elixir-ro-crate/tsconfig.json b/packages/ecc-client-elixir-ro-crate/tsconfig.json new file mode 100644 index 00000000..8c445248 --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "es2018", + "module": "esnext", + "moduleResolution": "node", + "noEmitOnError": true, + "lib": ["es2017", "dom"], + "strict": true, + "esModuleInterop": false, + "allowSyntheticDefaultImports": true, + "experimentalDecorators": true, + "importHelpers": true, + "outDir": "dist", + "sourceMap": true, + "inlineSources": true, + "rootDir": "./", + "declaration": true, + "emitDeclarationOnly": true, + "skipLibCheck": true + }, + "include": ["**/*.ts"], + "exclude": ["node_modules", "dist"] +} diff --git a/packages/ecc-client-elixir-ro-crate/tsconfig.prod.json b/packages/ecc-client-elixir-ro-crate/tsconfig.prod.json new file mode 100644 index 00000000..7a6b129d --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/tsconfig.prod.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig", + "compilerOptions": { + "rootDir": "./src" + }, + "include": ["src"], + "exclude": ["src/**/*.test.ts"] + } + \ No newline at end of file diff --git a/packages/ecc-client-elixir-ro-crate/web-dev-server.config.mjs b/packages/ecc-client-elixir-ro-crate/web-dev-server.config.mjs new file mode 100644 index 00000000..47b952c2 --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/web-dev-server.config.mjs @@ -0,0 +1,27 @@ +// import { hmrPlugin, presets } from '@open-wc/dev-server-hmr'; + +/** Use Hot Module replacement by adding --hmr to the start command */ +const hmr = process.argv.includes("--hmr"); + +export default /** @type {import('@web/dev-server').DevServerConfig} */ ({ + open: "/demo/", + /** Use regular watch mode if HMR is not enabled. */ + watch: !hmr, + /** Resolve bare module imports */ + nodeResolve: { + exportConditions: ["browser", "development"], + }, + + /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */ + // esbuildTarget: 'auto' + + /** Set appIndex to enable SPA routing */ + // appIndex: 'demo/index.html', + + plugins: [ + /** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */ + // hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }), + ], + + // See documentation for all available options +}); diff --git a/packages/ecc-client-elixir-ro-crate/web-test-runner.config.mjs b/packages/ecc-client-elixir-ro-crate/web-test-runner.config.mjs new file mode 100644 index 00000000..4b702999 --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/web-test-runner.config.mjs @@ -0,0 +1,49 @@ +// import { playwrightLauncher } from '@web/test-runner-playwright'; +import { esbuildPlugin } from "@web/dev-server-esbuild"; + +const filteredLogs = ["Running in dev mode", "lit-html is in dev mode"]; + +export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({ + /** Test files to run */ + files: "src/**/**/*.test.ts", + + /** Resolve bare module imports */ + nodeResolve: { + exportConditions: ["browser", "development"], + }, + + /** Filter out lit dev mode logs */ + filterBrowserLogs(log) { + for (const arg of log.args) { + if ( + typeof arg === "string" && + filteredLogs.some((l) => arg.includes(l)) + ) { + return false; + } + } + return true; + }, + + port: 8001, + + plugins: [esbuildPlugin({ ts: true })], + + /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */ + // esbuildTarget: 'auto', + + /** Amount of browsers to run concurrently */ + // concurrentBrowsers: 2, + + /** Amount of test files per browser to test concurrently */ + // concurrency: 1, + + /** Browsers to run tests on */ + // browsers: [ + // playwrightLauncher({ product: 'chromium' }), + // playwrightLauncher({ product: 'firefox' }), + // playwrightLauncher({ product: 'webkit' }), + // ], + + // See documentation for all available options +}); From 372c42eea54ad95d64af8c38e60fd6ce6539397a Mon Sep 17 00:00:00 2001 From: salihuDickson Date: Mon, 12 Aug 2024 21:42:54 +0100 Subject: [PATCH 05/12] modify .gitignore --- .gitignore | 6 ---- .../ecc-client-elixir-ro-crate/.gitignore | 30 ++++++++++++++++++- .../template-package/.gitignore.hbs | 30 ++++++++++++++++++- 3 files changed, 58 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 2cdabe4e..3d97bbbe 100644 --- a/.gitignore +++ b/.gitignore @@ -35,9 +35,3 @@ yarn-error.log* # vercel .vercel - -# prettier -.prettierrc - -# Don't ignore prettier in apps/documentation -!apps/documentation/.prettierrc diff --git a/packages/ecc-client-elixir-ro-crate/.gitignore b/packages/ecc-client-elixir-ro-crate/.gitignore index 9b9b7ba2..9422c383 100644 --- a/packages/ecc-client-elixir-ro-crate/.gitignore +++ b/packages/ecc-client-elixir-ro-crate/.gitignore @@ -11,4 +11,32 @@ npm-debug.log* yarn-debug.log* -yarn-error.log* \ No newline at end of file +yarn-error.log* + +## editors +/.idea +/.vscode + +## system files +.DS_Store + +## npm +/node_modules/ +/npm-debug.log + +## testing +/coverage/ + +## temp folders +/.tmp/ + +## build +/_site/ +/dist/ +/out-tsc/ + +## generated files +/src/react +custom-elements-manifest.config.js + +custom-elements.json \ No newline at end of file diff --git a/turbo/generators/template-package/.gitignore.hbs b/turbo/generators/template-package/.gitignore.hbs index 9b9b7ba2..9422c383 100644 --- a/turbo/generators/template-package/.gitignore.hbs +++ b/turbo/generators/template-package/.gitignore.hbs @@ -11,4 +11,32 @@ npm-debug.log* yarn-debug.log* -yarn-error.log* \ No newline at end of file +yarn-error.log* + +## editors +/.idea +/.vscode + +## system files +.DS_Store + +## npm +/node_modules/ +/npm-debug.log + +## testing +/coverage/ + +## temp folders +/.tmp/ + +## build +/_site/ +/dist/ +/out-tsc/ + +## generated files +/src/react +custom-elements-manifest.config.js + +custom-elements.json \ No newline at end of file From eff674fcde44072dab4df440fd102b0822041555 Mon Sep 17 00:00:00 2001 From: Salihu <91833785+SalihuDickson@users.noreply.github.com> Date: Wed, 14 Aug 2024 23:34:45 +0100 Subject: [PATCH 06/12] Update package.json Signed-off-by: Salihu <91833785+SalihuDickson@users.noreply.github.com> --- packages/ecc-client-elixir-ro-crate/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ecc-client-elixir-ro-crate/package.json b/packages/ecc-client-elixir-ro-crate/package.json index fe01f5a5..9d58cefd 100644 --- a/packages/ecc-client-elixir-ro-crate/package.json +++ b/packages/ecc-client-elixir-ro-crate/package.json @@ -20,7 +20,7 @@ "build": "node ../../scripts/build.js -p ecc-client-elixir-drs-filer-", "dev": "concurrently -r \"npm run build -- --watch\" \"wds\"", "clean": "rm -rf dist node_modules custom-elements-manifest.config.js", - "test": "wtr --coverage", + "test": "", "test:watch": "wtr --watch", "lint": "npx eslint .", "lint:fix": "npm run lint -- --fix", From 63f200a280406fcde51a1f7c01dc9b866ca85344 Mon Sep 17 00:00:00 2001 From: Salihu <91833785+SalihuDickson@users.noreply.github.com> Date: Wed, 14 Aug 2024 23:41:13 +0100 Subject: [PATCH 07/12] Delete packages/ecc-client-elixir-ro-crate/custom-elements-manifest.config.js Signed-off-by: Salihu <91833785+SalihuDickson@users.noreply.github.com> --- .../custom-elements-manifest.config.js | 152 ------------------ 1 file changed, 152 deletions(-) delete mode 100644 packages/ecc-client-elixir-ro-crate/custom-elements-manifest.config.js diff --git a/packages/ecc-client-elixir-ro-crate/custom-elements-manifest.config.js b/packages/ecc-client-elixir-ro-crate/custom-elements-manifest.config.js deleted file mode 100644 index 741b3d03..00000000 --- a/packages/ecc-client-elixir-ro-crate/custom-elements-manifest.config.js +++ /dev/null @@ -1,152 +0,0 @@ -/* eslint-disable import/no-extraneous-dependencies */ -/* eslint-disable no-param-reassign */ -import fs from "fs"; -import { program } from "commander"; -import { customElementVsCodePlugin } from "custom-element-vs-code-integration"; -import { customElementJetBrainsPlugin } from "custom-element-jet-brains-integration"; -import packageJson from "./package.json" assert { type: "json" }; - -const options = program - .option("-o, --outdir ") - .option("--litelement") - .option("--analyze", "", true) - .parse() - .opts(); - -const componentsPrefix = packageJson.componentsPrefix; -const packageData = JSON.parse(fs.readFileSync("package.json", "utf8")); -const { name, description, version, author, homepage, license } = packageData; - -const getComponentDocumentation = (tag) => - `https://elixir-cloud-components.vercel.app/design/components/${tag.replace( - componentsPrefix, - "" - )}.html`; - -function replace(string, terms) { - terms.forEach(({ from, to }) => { - string = string?.replace(from, to); - }); - - return string; -} - -export default { - globs: ["src/components/**/*.ts"], - exclude: ["**/*.styles.ts", "**/*.test.ts", "index.ts"], - plugins: [ - // Append package data - { - name: "elixir-cloud-package-data", - packageLinkPhase({ customElementsManifest }) { - customElementsManifest.package = { - name, - description, - version, - author, - homepage, - license, - }; - }, - }, - { - name: "shoelace-react-event-names", - analyzePhase({ ts, node, moduleDoc }) { - switch (node.kind) { - case ts.SyntaxKind.ClassDeclaration: { - const className = node.name.getText(); - const classDoc = moduleDoc?.declarations?.find( - (declaration) => declaration.name === className - ); - - classDoc.jsDoc = node.jsDoc - ?.map((jsDoc) => jsDoc.getFullText()) - .join("\n"); - - if (classDoc?.events) { - classDoc.events.forEach((event) => { - // eslint-disable-next-line no-undef - event.reactName = `on${pascalCase(event.name)}`; - // eslint-disable-next-line no-undef - event.eventName = `${pascalCase(event.name)}Event`; - }); - } - break; - } - default: - break; - } - }, - }, - { - name: "shoelace-translate-module-paths", - packageLinkPhase({ customElementsManifest }) { - customElementsManifest?.modules?.forEach((mod) => { - // - // CEM paths look like this: - // - // src/components/form/index.ts - // - // But we want them to look like this: - // - // components/form/index.js - // - const terms = [ - { from: /^src\//, to: "" }, // Strip the src/ prefix - { from: /\.(t|j)sx?$/, to: ".js" }, // Convert .ts to .js - ]; - - mod.path = replace(mod.path, terms); - - for (const ex of mod.exports ?? []) { - ex.declaration.module = replace(ex.declaration.module, terms); - } - - for (const dec of mod.declarations ?? []) { - if (dec.kind === "class") { - for (const member of dec.members ?? []) { - if (member.inheritedFrom) { - member.inheritedFrom.module = replace( - member.inheritedFrom.module, - terms - ); - } - } - } - } - }); - }, - }, - // Generate custom VS Code data - customElementVsCodePlugin({ - outdir: options.outdir, - cssFileName: null, - referencesTemplate: (_, tag) => [ - { - name: "Documentation", - url: getComponentDocumentation(tag), - }, - ], - }), - customElementJetBrainsPlugin({ - outdir: "./dist", - excludeCss: true, - packageJson: false, - referencesTemplate: (_, tag) => ({ - name: "Documentation", - url: getComponentDocumentation(tag), - }), - }), - ], -}; - -function pascalCase(str) { - if (!str || typeof str !== "string") return ""; - - return str - .match(/[a-z]+/gi) - .map(function (word) { - return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); - }) - .join(""); -} From a6e5aff110261ffce1f11e147d7becc355498400 Mon Sep 17 00:00:00 2001 From: Shivang Date: Thu, 22 Aug 2024 01:21:16 +0530 Subject: [PATCH 08/12] Created basic sections and their forms --- .../demo/about/index.html | 27 +++ .../demo/index.html | 19 +++ .../src/components/about/about.ts | 160 ++++++++++++++++++ .../src/components/about/index.ts | 15 ++ .../src/components/index.ts | 1 + .../ecc-client-elixir-ro-crate/src/index.ts | 0 6 files changed, 222 insertions(+) create mode 100644 packages/ecc-client-elixir-ro-crate/demo/about/index.html create mode 100644 packages/ecc-client-elixir-ro-crate/demo/index.html create mode 100644 packages/ecc-client-elixir-ro-crate/src/components/about/about.ts create mode 100644 packages/ecc-client-elixir-ro-crate/src/components/about/index.ts create mode 100644 packages/ecc-client-elixir-ro-crate/src/components/index.ts delete mode 100644 packages/ecc-client-elixir-ro-crate/src/index.ts diff --git a/packages/ecc-client-elixir-ro-crate/demo/about/index.html b/packages/ecc-client-elixir-ro-crate/demo/about/index.html new file mode 100644 index 00000000..e2c78144 --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/demo/about/index.html @@ -0,0 +1,27 @@ + + + + + + + ecc-client-ga4gh-wes-runs + +
+ + + + diff --git a/packages/ecc-client-elixir-ro-crate/demo/index.html b/packages/ecc-client-elixir-ro-crate/demo/index.html new file mode 100644 index 00000000..23b17b84 --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/demo/index.html @@ -0,0 +1,19 @@ + + + + + + ecc-client-ga4gh-tes + + + +
+ About +
+
+ + diff --git a/packages/ecc-client-elixir-ro-crate/src/components/about/about.ts b/packages/ecc-client-elixir-ro-crate/src/components/about/about.ts new file mode 100644 index 00000000..98cf05fa --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/src/components/about/about.ts @@ -0,0 +1,160 @@ +import { LitElement, html } from "lit"; +import { state } from "lit/decorators.js"; +// import EccUtilDesignForm from "@elixir-cloud/design/dist/react/form/index"; +import "@elixir-cloud/design/dist/components/form/index.js"; +import { Field } from "@elixir-cloud/design/dist/components/form/form"; + +export default class ECCCLientRoCrateAbout extends LitElement { + @state() + private activeTab = 0; + + // Method to switch tabs + private _switchTab(index: number) { + this.activeTab = index; + } + + static AboutFields: Field[] = [ + { + key: "@id", + label: "@id", + type: "text", + fieldOptions: { + tooltip: + "Persistent, managed unique ID in URL format (if available), for example a DOI for a collection or an ORCID, personal home page URL or email address for a person", + default: "./", + }, + }, + + { + key: "@type", + label: "Type", + type: "array", + fieldOptions: { + tooltip: "The type of the entity.", + }, + arrayOptions: { + defaultInstances: 1, + max: 3, + }, + children: [ + { + key: "Type", + label: "Select", + type: "text", + fieldOptions: { + required: true, + default: "Dataset", + tooltip: "Your house number", + }, + }, + ], + }, + + { + key: "name", + label: "Name", + type: "text", + fieldOptions: { + tooltip: "The name of the item.", + }, + }, + { + key: "description", + label: "Description", + type: "text", + fieldOptions: { + tooltip: "A description of the item.", + }, + }, + { + key: "datePublished", + label: "Date Published", + type: "date", + fieldOptions: { + tooltip: "Date of first broadcast or publication.", + }, + }, + { + key: "about", + label: "About", + type: "text", + fieldOptions: { + tooltip: "The subject matter of the content", + }, + }, + ]; + + static RelatedPeopleFields: Field[] = [ + // todo : dropdown + { + key: "author", + label: "Author", + type: "text", + fieldOptions: { + default: "Choose a Type", + }, + }, + { + key: "pulisher", + label: "Publisher", + type: "text", + fieldOptions: { + default: "Choose a Type", + }, + }, + ]; + + static StructureFields: Field[] = [ + // todo : dropdown + { + key: "HasPart", + label: "Has Part", + type: "text", + fieldOptions: { + default: "Choose a Type", + }, + }, + ]; + + render() { + return html` +
+
+ About +
+
+ Related People, Orgs & Works +
+
+ Structure +
+
+
+ ${this.activeTab === 0 + ? html`` + : ""} + ${this.activeTab === 1 + ? html`` + : ""} + ${this.activeTab === 2 + ? html`` + : ""} +
+ `; + } +} diff --git a/packages/ecc-client-elixir-ro-crate/src/components/about/index.ts b/packages/ecc-client-elixir-ro-crate/src/components/about/index.ts new file mode 100644 index 00000000..726adc80 --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/src/components/about/index.ts @@ -0,0 +1,15 @@ +import ECCCLientRoCrateAbout from "./about.js"; + +export * from "./about.js"; +export default ECCCLientRoCrateAbout; + +window.customElements.define( + "ecc-client-elixir-ro-crate-about", + ECCCLientRoCrateAbout +); + +declare global { + interface HTMLElementTagNameMap { + "ecc-client-elixir-ro-crate-about": ECCCLientRoCrateAbout; + } +} diff --git a/packages/ecc-client-elixir-ro-crate/src/components/index.ts b/packages/ecc-client-elixir-ro-crate/src/components/index.ts new file mode 100644 index 00000000..36218803 --- /dev/null +++ b/packages/ecc-client-elixir-ro-crate/src/components/index.ts @@ -0,0 +1 @@ +import "./about/about.js"; diff --git a/packages/ecc-client-elixir-ro-crate/src/index.ts b/packages/ecc-client-elixir-ro-crate/src/index.ts deleted file mode 100644 index e69de29b..00000000 From 110cadfff3d7c0a7014482284daf677a77122cfc Mon Sep 17 00:00:00 2001 From: Anurag Gupta Date: Sun, 8 Sep 2024 03:20:36 +0530 Subject: [PATCH 09/12] feat: form events --- package-lock.json | 18 ++------ .../src/react/index.ts | 0 .../ecc-utils-design/demo/form/index.html | 3 ++ .../src/components/form/form.ts | 41 ++++++++++++++++++- 4 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 packages/ecc-client-elixir-drs-filer/src/react/index.ts diff --git a/package-lock.json b/package-lock.json index bab3b66e..4bd9a0c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,7 @@ "typescript": "^5.3.3" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "optionalDependencies": { "@rollup/rollup-linux-x64-gnu": "4.6.1" @@ -7761,6 +7761,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, "dependencies": { "fill-range": "^7.1.1" }, @@ -10453,18 +10454,6 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, - "node_modules/ecc-client-elixir-drs-filer": { - "resolved": "packages/ecc-client-elixir-drs-filer", - "link": true - }, - "node_modules/ecc-client-elixir-ro-crate": { - "resolved": "packages/ecc-client-elixir-ro-crate", - "link": true - }, - "node_modules/ecc-client-elixir-drs-filer": { - "resolved": "packages/ecc-client-elixir-drs-filer", - "link": true - }, "node_modules/ecc-client-elixir-ro-crate": { "resolved": "packages/ecc-client-elixir-ro-crate", "link": true @@ -12009,6 +11998,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -24645,6 +24635,7 @@ } }, "packages/ecc-client-elixir-drs-filer": { + "name": "@elixir-cloud/drs-filer", "version": "0.1.0", "license": "Apache-2.0", "devDependencies": { @@ -25083,7 +25074,6 @@ } } }, - "packages/ecc-client-elixir-trs-filer": { "name": "@elixir-cloud/trs-filer", "version": "0.0.0", diff --git a/packages/ecc-client-elixir-drs-filer/src/react/index.ts b/packages/ecc-client-elixir-drs-filer/src/react/index.ts new file mode 100644 index 00000000..e69de29b diff --git a/packages/ecc-utils-design/demo/form/index.html b/packages/ecc-utils-design/demo/form/index.html index 9111f551..2b2464da 100644 --- a/packages/ecc-utils-design/demo/form/index.html +++ b/packages/ecc-utils-design/demo/form/index.html @@ -245,6 +245,9 @@ .error({ message: "Error fetching data" }); } }} + @ecc-utils-change=${(e) => { + console.log("form - changed", e.detail); + }} > `, document.querySelector("#demo") diff --git a/packages/ecc-utils-design/src/components/form/form.ts b/packages/ecc-utils-design/src/components/form/form.ts index 3a3d6a1f..e93ccf95 100644 --- a/packages/ecc-utils-design/src/components/form/form.ts +++ b/packages/ecc-utils-design/src/components/form/form.ts @@ -129,6 +129,16 @@ export default class EccUtilsDesignForm extends LitElement { @sl-change=${(e: Event) => { _.set(this.form, path, (e.target as HTMLInputElement).checked); this.requestUpdate(); + this.dispatchEvent( + new CustomEvent("ecc-utils-change", { + detail: { + key: field.key, + value: (e.target as HTMLInputElement).checked, + }, + bubbles: true, + composed: true, + }) + ); }} > @@ -176,6 +186,16 @@ export default class EccUtilsDesignForm extends LitElement { const { files } = e.target as HTMLInputElement; _.set(this.form, path, files); this.requestUpdate(); + this.dispatchEvent( + new CustomEvent("ecc-utils-change", { + detail: { + key: field.key, + value: files, + }, + bubbles: true, + composed: true, + }) + ); }} /> @@ -219,6 +239,16 @@ export default class EccUtilsDesignForm extends LitElement { const label = selectElement.selectedOptions[0].textContent; _.set(this.form, path, label); this.requestUpdate(); + this.dispatchEvent( + new CustomEvent("ecc-utils-change", { + detail: { + key: field.key, + value: selectElement.value, + }, + bubbles: true, + composed: true, + }) + ); }} > ${field.selectOptions?.map( @@ -247,8 +277,17 @@ export default class EccUtilsDesignForm extends LitElement { } else { _.set(this.form, path, value); } - this.requestUpdate(); + this.dispatchEvent( + new CustomEvent("ecc-utils-change", { + detail: { + key: field.key, + value, + }, + bubbles: true, + composed: true, + }) + ); }} >