chore: apply types-correct in ui pkg

This commit is contained in:
Thijs Louisse 2022-11-23 15:50:06 +01:00 committed by Thomas Allmer
parent 0176eabe23
commit 9d912f6618
5 changed files with 10 additions and 11 deletions

5
package-lock.json generated
View file

@ -11518,9 +11518,8 @@
"node_modules/globby": { "node_modules/globby": {
"version": "13.1.2", "version": "13.1.2",
"resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz",
"integrity": "sha1-KQRxBVgkJ6tuyk+QUgBmewVtpRU=", "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==",
"dev": true, "dev": true,
"license": "MIT",
"dependencies": { "dependencies": {
"dir-glob": "^3.0.1", "dir-glob": "^3.0.1",
"fast-glob": "^3.2.11", "fast-glob": "^3.2.11",
@ -32529,7 +32528,7 @@
"globby": { "globby": {
"version": "13.1.2", "version": "13.1.2",
"resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz", "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.2.tgz",
"integrity": "sha1-KQRxBVgkJ6tuyk+QUgBmewVtpRU=", "integrity": "sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"dir-glob": "^3.0.1", "dir-glob": "^3.0.1",

View file

@ -31,9 +31,8 @@
"test:node": "npm run test:node --workspaces --if-present", "test:node": "npm run test:node --workspaces --if-present",
"test:screenshots": "rimraf screenshots/.diff/ && rimraf screenshots/.current/ && mocha --require scripts/screenshots/bootstrap.js --exit --timeout 10000 \"packages/**/test/*.screenshots-test.js\"", "test:screenshots": "rimraf screenshots/.diff/ && rimraf screenshots/.current/ && mocha --require scripts/screenshots/bootstrap.js --exit --timeout 10000 \"packages/**/test/*.screenshots-test.js\"",
"test:screenshots:update": "cross-env UPDATE_SCREENSHOTS=true npm run test:screenshots", "test:screenshots:update": "cross-env UPDATE_SCREENSHOTS=true npm run test:screenshots",
"types": "npm run types --workspaces --if-present && npm run types-correct-after-build", "types": "npm run types --workspaces --if-present",
"types-check-only": "npm run types-check-only --workspaces --if-present", "types-check-only": "npm run types-check-only --workspaces --if-present"
"types-correct-after-build": "node ./scripts/types-correct-after-build.mjs"
}, },
"workspaces": [ "workspaces": [
"packages/*", "packages/*",

View file

@ -42,7 +42,8 @@
"prepublishOnly": "npm run types && npm run publish-docs && npm run custom-elements-manifest", "prepublishOnly": "npm run types && npm run publish-docs && npm run custom-elements-manifest",
"test": "cd ../../ && npm run test:browser", "test": "cd ../../ && npm run test:browser",
"types": "wireit", "types": "wireit",
"types-check-only": "tsc --project tsconfig-check-only.json" "types-check-only": "tsc --project tsconfig-check-only.json",
"types-correct-after-build": "node ./scripts/types-correct-after-build.js"
}, },
"dependencies": { "dependencies": {
"@bundled-es-modules/message-format": "^6.0.4", "@bundled-es-modules/message-format": "^6.0.4",
@ -65,7 +66,7 @@
"customElements": "custom-elements.json", "customElements": "custom-elements.json",
"wireit": { "wireit": {
"types": { "types": {
"command": "tsc --build --pretty", "command": "tsc --build --pretty && npm run types-correct-after-build",
"dependencies": [ "dependencies": [
"../singleton-manager:types" "../singleton-manager:types"
], ],

View file

@ -15,10 +15,10 @@ import fs from 'fs';
import { globby } from 'globby'; import { globby } from 'globby';
import { fileURLToPath } from 'url'; import { fileURLToPath } from 'url';
const monorepoRootPath = fileURLToPath(new URL('../', import.meta.url)); const packageRoot = fileURLToPath(new URL('../', import.meta.url));
async function alignLitImports() { async function alignLitImports() {
const fileNames = await globby([`${monorepoRootPath}/packages/ui/dist-types`]); const fileNames = await globby([`${packageRoot}/dist-types`]);
for (const fileName of fileNames) { for (const fileName of fileNames) {
// eslint-disable-next-line no-await-in-loop // eslint-disable-next-line no-await-in-loop
const contents = await fs.promises.readFile(fileName, 'utf-8'); const contents = await fs.promises.readFile(fileName, 'utf-8');

View file

@ -1,5 +1,5 @@
{ {
"//": "this runs after 'scripts/types-correct-after-build.mjs' has been applied", "//": "this runs after 'scripts/types-correct-after-build.js' has been applied",
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
"emitDeclarationOnly": false, "emitDeclarationOnly": false,