diff --git a/packages/peggy-loader/.eslintignore b/packages/peggy-loader/.eslintignore deleted file mode 100644 index 8225baa4a77..00000000000 --- a/packages/peggy-loader/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -/node_modules -/dist diff --git a/packages/peggy-loader/.eslintrc.json b/packages/peggy-loader/.eslintrc.json index 6a4609388dd..eb0ad3575e6 100644 --- a/packages/peggy-loader/.eslintrc.json +++ b/packages/peggy-loader/.eslintrc.json @@ -1,8 +1,4 @@ { "extends": ["@rocket.chat/eslint-config"], - "plugins": ["jest"], - "env": { - "jest/globals": true - }, - "ignorePatterns": ["**/dist"] + "ignorePatterns": ["dist"] } diff --git a/packages/peggy-loader/.gitignore b/packages/peggy-loader/.gitignore deleted file mode 100644 index 9b1c8b133c9..00000000000 --- a/packages/peggy-loader/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/dist diff --git a/packages/peggy-loader/.prettierignore b/packages/peggy-loader/.prettierignore deleted file mode 100644 index 8225baa4a77..00000000000 --- a/packages/peggy-loader/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -/node_modules -/dist diff --git a/packages/peggy-loader/.prettierrc.js b/packages/peggy-loader/.prettierrc.js deleted file mode 100644 index b57f474edb9..00000000000 --- a/packages/peggy-loader/.prettierrc.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@rocket.chat/prettier-config/fuselage'); diff --git a/packages/peggy-loader/package.json b/packages/peggy-loader/package.json index cb2358aad34..5ee3652f217 100644 --- a/packages/peggy-loader/package.json +++ b/packages/peggy-loader/package.json @@ -1,59 +1,57 @@ { - "name": "@rocket.chat/peggy-loader", - "version": "0.31.27", - "description": "Peggy loader for webpack", - "keywords": [ - "peggy", - "loader", - "webpack" - ], - "author": { - "name": "Rocket.Chat", - "url": "https://rocket.chat/" - }, - "homepage": "https://github.com/RocketChat/fuselage#readme", - "license": "MIT", - "publishConfig": { - "access": "public" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/RocketChat/fuselage.git", - "directory": "packages/peggy-loader" - }, - "main": "dist/cjs/index.js", - "module": "dist/esm/index.js", - "types": "dist/esm/index.d.ts", - "files": [ - "/dist" - ], - "scripts": { - "build": "run-s .:build:clean .:build:esm .:build:cjs", - ".:build:clean": "rimraf dist", - ".:build:esm": "tsc -p tsconfig.json", - ".:build:cjs": "tsc -p tsconfig.cjs.json", - "lint": "eslint src" - }, - "bugs": { - "url": "https://github.com/RocketChat/fuselage/issues" - }, - "peerDependencies": { - "peggy": "*", - "webpack": "*" - }, - "devDependencies": { - "@rocket.chat/eslint-config": "workspace:~", - "@rocket.chat/prettier-config": "~0.31.25", - "@types/node": "~22.16.5", - "eslint": "~8.45.0", - "npm-run-all": "^4.1.5", - "peggy": "4.1.1", - "prettier": "~3.3.3", - "rimraf": "^6.0.1", - "typescript": "~5.9.3", - "webpack": "~5.99.9" - }, - "volta": { - "extends": "../../package.json" - } + "name": "@rocket.chat/peggy-loader", + "version": "0.31.27", + "description": "Peggy loader for webpack", + "keywords": [ + "peggy", + "loader", + "webpack" + ], + "homepage": "https://github.com/RocketChat/fuselage#readme", + "bugs": { + "url": "https://github.com/RocketChat/fuselage/issues" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/RocketChat/fuselage.git", + "directory": "packages/peggy-loader" + }, + "license": "MIT", + "author": { + "name": "Rocket.Chat", + "url": "https://rocket.chat/" + }, + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "/dist" + ], + "scripts": { + ".:build:clean": "rimraf dist", + ".:build:tsc": "tsc -p tsconfig.build.json", + "build": "run-s .:build:clean .:build:tsc", + "lint": "eslint src" + }, + "devDependencies": { + "@rocket.chat/eslint-config": "workspace:~", + "@rocket.chat/prettier-config": "~0.31.25", + "@types/node": "~22.16.5", + "eslint": "~8.45.0", + "npm-run-all": "^4.1.5", + "peggy": "4.1.1", + "prettier": "~3.3.3", + "rimraf": "^6.0.1", + "typescript": "~5.9.3", + "webpack": "~5.99.9" + }, + "peerDependencies": { + "peggy": "*", + "webpack": "*" + }, + "volta": { + "extends": "../../package.json" + }, + "publishConfig": { + "access": "public" + } } diff --git a/packages/peggy-loader/src/index.ts b/packages/peggy-loader/src/index.ts index 5dcf3054243..a04c69c50f0 100644 --- a/packages/peggy-loader/src/index.ts +++ b/packages/peggy-loader/src/index.ts @@ -1,38 +1,32 @@ import type { - BuildOptionsBase, - OutputFormatAmdCommonjsEs, - OutputFormatBare, - OutputFormatGlobals, - OutputFormatUmd, - SourceOptionsBase, + BuildOptionsBase, + OutputFormatAmdCommonjsEs, + OutputFormatBare, + OutputFormatGlobals, + OutputFormatUmd, + SourceOptionsBase, } from 'peggy'; import peggy from 'peggy'; import type { LoaderContext } from 'webpack'; type Options = BuildOptionsBase & - ( - | Omit< - OutputFormatAmdCommonjsEs<'source'>, - keyof SourceOptionsBase<'source'> - > - | Omit, keyof SourceOptionsBase<'source'>> - | Omit, keyof SourceOptionsBase<'source'>> - | Omit, keyof SourceOptionsBase<'source'>> - ); + ( + | Omit, keyof SourceOptionsBase<'source'>> + | Omit, keyof SourceOptionsBase<'source'>> + | Omit, keyof SourceOptionsBase<'source'>> + | Omit, keyof SourceOptionsBase<'source'>> + ); -function peggyLoader( - this: LoaderContext, - grammarContent: string, -): string { - const options: Options = { - format: 'commonjs', - ...this.getOptions(), - }; +function peggyLoader(this: LoaderContext, grammarContent: string): string { + const options: Options = { + format: 'commonjs', + ...this.getOptions(), + }; - return peggy.generate(grammarContent, { - output: 'source', - ...options, - }); + return peggy.generate(grammarContent, { + output: 'source', + ...options, + }); } export default peggyLoader; diff --git a/packages/peggy-loader/tsconfig.build.json b/packages/peggy-loader/tsconfig.build.json new file mode 100644 index 00000000000..b9b6e6d5d2f --- /dev/null +++ b/packages/peggy-loader/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + } +} diff --git a/packages/peggy-loader/tsconfig.cjs.json b/packages/peggy-loader/tsconfig.cjs.json deleted file mode 100644 index 44b902831e4..00000000000 --- a/packages/peggy-loader/tsconfig.cjs.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "commonjs", - "outDir": "./dist/cjs" - } -} diff --git a/packages/peggy-loader/tsconfig.json b/packages/peggy-loader/tsconfig.json index 9d2804b0261..1915aa6f354 100644 --- a/packages/peggy-loader/tsconfig.json +++ b/packages/peggy-loader/tsconfig.json @@ -1,16 +1,7 @@ { - "compilerOptions": { - "target": "es5", - "module": "ESNext", - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "outDir": "./dist/esm", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "moduleResolution": "node", - "resolveJsonModule": true - } + "extends": "@rocket.chat/tsconfig/server.json", + "compilerOptions": { + "module": "esnext", + }, + "include": ["src"] } diff --git a/yarn.lock b/yarn.lock index fb515e3453d..c288d3c4172 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8708,7 +8708,7 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/fuselage@npm:*, @rocket.chat/fuselage@npm:~0.68.1": +"@rocket.chat/fuselage@npm:~0.68.1": version: 0.68.1 resolution: "@rocket.chat/fuselage@npm:0.68.1" dependencies: @@ -8847,7 +8847,7 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/icons@npm:*, @rocket.chat/icons@npm:~0.45.0": +"@rocket.chat/icons@npm:~0.45.0": version: 0.45.0 resolution: "@rocket.chat/icons@npm:0.45.0" checksum: 10/9e0967eba17cbef1c482616bb94cf871dfac20e92ac5fad6164cbe60bab95882d9675bf9de2c611928da6d37806a1279d671b0a3463dda0a3148cdade9291147 @@ -10394,11 +10394,11 @@ __metadata: "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/ddp-client": "workspace:~" "@rocket.chat/emitter": "npm:~0.31.25" - "@rocket.chat/fuselage": "npm:*" + "@rocket.chat/fuselage": "npm:~0.68.1" "@rocket.chat/fuselage-hooks": "npm:~0.38.1" "@rocket.chat/fuselage-tokens": "npm:~0.33.2" "@rocket.chat/i18n": "workspace:~" - "@rocket.chat/icons": "npm:*" + "@rocket.chat/icons": "npm:~0.45.0" "@rocket.chat/jest-presets": "workspace:~" "@rocket.chat/password-policies": "workspace:^" "@rocket.chat/rest-typings": "workspace:^"