Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/peggy-loader/.eslintignore

This file was deleted.

6 changes: 1 addition & 5 deletions packages/peggy-loader/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"extends": ["@rocket.chat/eslint-config"],
"plugins": ["jest"],
"env": {
"jest/globals": true
},
"ignorePatterns": ["**/dist"]
"ignorePatterns": ["dist"]
}
1 change: 0 additions & 1 deletion packages/peggy-loader/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions packages/peggy-loader/.prettierignore

This file was deleted.

1 change: 0 additions & 1 deletion packages/peggy-loader/.prettierrc.js

This file was deleted.

112 changes: 55 additions & 57 deletions packages/peggy-loader/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
48 changes: 21 additions & 27 deletions packages/peggy-loader/src/index.ts
Original file line number Diff line number Diff line change
@@ -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<OutputFormatUmd<'source'>, keyof SourceOptionsBase<'source'>>
| Omit<OutputFormatGlobals<'source'>, keyof SourceOptionsBase<'source'>>
| Omit<OutputFormatBare<'source'>, keyof SourceOptionsBase<'source'>>
);
(
| Omit<OutputFormatAmdCommonjsEs<'source'>, keyof SourceOptionsBase<'source'>>
| Omit<OutputFormatUmd<'source'>, keyof SourceOptionsBase<'source'>>
| Omit<OutputFormatGlobals<'source'>, keyof SourceOptionsBase<'source'>>
| Omit<OutputFormatBare<'source'>, keyof SourceOptionsBase<'source'>>
);

function peggyLoader(
this: LoaderContext<Options>,
grammarContent: string,
): string {
const options: Options = {
format: 'commonjs',
...this.getOptions(),
};
function peggyLoader(this: LoaderContext<Options>, 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;
9 changes: 9 additions & 0 deletions packages/peggy-loader/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
}
}
7 changes: 0 additions & 7 deletions packages/peggy-loader/tsconfig.cjs.json

This file was deleted.

19 changes: 5 additions & 14 deletions packages/peggy-loader/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:^"
Expand Down
Loading