mirror of
https://github.com/RocketChat/Rocket.Chat.git
synced 2025-12-28 06:47:25 +00:00
chore(peggy-loader): Review build configuration (#37629)
This commit is contained in:
parent
66a2a20f2a
commit
f0531bc985
@ -1,2 +0,0 @@
|
||||
/node_modules
|
||||
/dist
|
||||
@ -1,8 +1,4 @@
|
||||
{
|
||||
"extends": ["@rocket.chat/eslint-config"],
|
||||
"plugins": ["jest"],
|
||||
"env": {
|
||||
"jest/globals": true
|
||||
},
|
||||
"ignorePatterns": ["**/dist"]
|
||||
"ignorePatterns": ["dist"]
|
||||
}
|
||||
|
||||
1
packages/peggy-loader/.gitignore
vendored
1
packages/peggy-loader/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/dist
|
||||
@ -1,2 +0,0 @@
|
||||
/node_modules
|
||||
/dist
|
||||
@ -1 +0,0 @@
|
||||
module.exports = require('@rocket.chat/prettier-config/fuselage');
|
||||
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
packages/peggy-loader/tsconfig.build.json
Normal file
9
packages/peggy-loader/tsconfig.build.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"sourceMap": true,
|
||||
}
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"outDir": "./dist/cjs"
|
||||
}
|
||||
}
|
||||
@ -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"]
|
||||
}
|
||||
|
||||
@ -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:^"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user