Gathering detailed insights and metrics for relay-compiler-webpack-plugin
Gathering detailed insights and metrics for relay-compiler-webpack-plugin
Gathering detailed insights and metrics for relay-compiler-webpack-plugin
Gathering detailed insights and metrics for relay-compiler-webpack-plugin
@ch1ffa/relay-compiler-webpack-plugin
Webpack pluging for running relay-compiler in webpack dev mode
relay-compiler
A compiler tool for building GraphQL-driven applications.
@ngtools/webpack
Webpack plugin that AoT compiles your Angular components and modules.
relay-compiler-language-typescript
A language plugin for Relay that adds TypeScript support, including emitting type definitions.
npm install relay-compiler-webpack-plugin
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
65 Stars
256 Commits
35 Forks
4 Watching
15 Branches
29 Contributors
Updated on 25 Aug 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-6.2%
256
Compared to previous day
Last week
-8.3%
1,426
Compared to previous week
Last month
-28%
12,399
Compared to previous month
Last year
134.7%
136,049
Compared to previous year
3
34
Are you running Relay Modern? Are you annoyed with constantly running the relay-compiler
to generate code, especially
if you're already running Webpack?
Well be annoyed no more! Simply install this plugin to automatically hook into Webpack's build process to generate these files for you.
1 yarn add --dev relay-compiler-webpack-plugin graphql 2 # Or if you're using npm 3 npm install --save-dev relay-compiler-webpack-plugin graphql
1// const RelayCompilerLanguageTypescript = require('relay-compiler-language-typescript').default 2const RelayCompilerWebpackPlugin = require('relay-compiler-webpack-plugin') 3const path = require('path') 4 5module.exports = { 6 // ... Your existing Webpack configuration 7 plugins: [ 8 // ... 9 new RelayCompilerWebpackPlugin({ 10 // languagePlugin: RelayCompilerLanguageTypescript, 11 schema: path.resolve(__dirname, './relative/path/to/schema.graphql'), // or schema.json 12 src: path.resolve(__dirname, './relative/path/to/source/files'), 13 }) 14 ] 15 // ... 16}
Note: TypeScript projects also needs to add the TypeScript language plugin as shown in the commented out lines in the above snippet.
If there are multiple versions of GraphQL in your dependency tree it will cause schema validation errors. To get around this, ensure you have the same graphql version as your relay-compiler version depends on. To assist this you can install dependencies as flat which ensures only one version of each dependency.
relay-compiler-webpack-plugin
exposes a few tapable hooks, for plugins or tooling to use.
beforeWrite
called before the plugin starts to compile queriesafterWrite(compileResult)
: called after writing is complete1class MyPlugin { 2 apply (compiler) { 3 compiler.hooks.compilation.tap('MyPlugin', async (compilation) => { 4 RelayCompilerWebpackPlugin.getHooks(compilation).afterWrite.tapPromise( 5 'MyPlugin', // <-- Set a meaningful name for stacktraces 6 async (compileResult) => { 7 if (compileResult === 'HAS_CHANGES') { 8 await doSomething() 9 } 10 } 11 ) 12 }) 13 } 14}
To see an example of its usage within a project, see relay-compiler-webpack-plugin-example.
Running tests:
1yarn test
Running tests with coverage:
1yarn test:coverage
Relay Compiler Webpack Plugin may be redistributed according to the BSD 3-Clause License.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/18 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
40 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More