Gathering detailed insights and metrics for universal-scripts
Gathering detailed insights and metrics for universal-scripts
Gathering detailed insights and metrics for universal-scripts
Gathering detailed insights and metrics for universal-scripts
@jetshop/react-scripts
Create server-rendered universal JavaScript applications with no configuration
universal-common-scripts
Local module, import as a node module path. Install with `npm link ./path/to/here`
universal-react-scripts
Configuration and scripts for Create React App.
@coreyleelarson/universal-react-scripts
## Install
npm install universal-scripts
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (60.64%)
TypeScript (33.98%)
HTML (2.71%)
SCSS (1.79%)
Shell (0.76%)
CSS (0.06%)
Procfile (0.05%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
23 Stars
423 Commits
1 Forks
1 Watchers
24 Branches
5 Contributors
Updated on May 19, 2025
Latest Version
3.6.4
Package Id
universal-scripts@3.6.4
Unpacked Size
65.28 kB
Size
20.26 kB
File Count
49
NPM Version
10.8.2
Node Version
20.18.2
Published on
May 19, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
39
5
Universal Scripts is a highly flexible framework for React projects, offering advanced features such as Server-Side Rendering (SSR) and internationalization (i18n). It allows you to extend or override existing configuration easily, giving you complete control over your setup.
react-intl
,react-helmet-async
.redux-toolkit
and types support.ruse-fetch
to provide a modern way of fetching data with Suspense
.SWC
for better performance.You can use the pre-built templates, such as the TypeScript template, or create your own to match your preferences. Below are the main folders defined in the default template:
src/locales
: Store your translations, the first key in index.ts
is the default language.src/routes
: The index file serves as the root component, where you can define your application routes with react-router
.src/static
: Contains static assets like images, fonts, etc. These files will be copied to the build.src/store
: Add your slices and place them inside the slices folder.src/styles
: The main entry point for global styles.These are the default folders, but you can create additional ones such as components, hooks, contexts, and more. Additionally, the tsconfig file includes predefined aliases, which you can customize or extend as needed.
In Universal, you have the flexibility to use pre-built plugins or develop your own. These plugins are designed to work seamlessly without requiring any additional configuration—just install them, and they are ready to use. This allows for a more efficient development process, enabling you to extend functionality effortlessly while maintaining a clean and modular project structure.
This documentation describes the configuration of the following universal pre-installed plugins in a project:
universal-plugin-helmet
This plugin introduces configuration for react-helmet-async
, enabling efficient metadata management in React applications.
- Enables full functionality of react-helmet-async.
- Allows dynamic <head> management in a React application.
- Improves SEO optimization and accessibility.
- Enables customizable social sharing with dynamic Open Graph metadata.
universal-plugin-jest
This plugin configures Jest
, to run your test suites.
- Configures Jest for unit and integration testing.
- Use SWC for better performance.
In addition to the pre-installed plugins, you can create your own plugins or use other existing ones, such as the universal-plugin-sass
for Sass support.
If you want to use for example universal-plugin-sass
you just have to install this as a dependency. And universal will recognize them without any configuration.
1yarn add universal-plugin-sass
If using npm
1npm install universal-plugin-sass
Universal is already configured to use ruse-fetch
, making data fetching simple and efficient.
1import { useFetch } from 'ruse-fetch' 2 3const Users = () => { 4 const users = useFetch('https://reqres.in/api/users') 5 return ( 6 <ul> 7 {users.data.map((u) => ( 8 <li key={u.id}>u.first_name</li> 9 ))} 10 </ul> 11 ) 12} 13 14const Home = () => { 15 return ( 16 <section> 17 ... 18 <Suspense fallback={<span>Loading...</span>}> 19 <Users> 20 </Suspense> 21 ... 22 </section> 23 ) 24} 25
To maintain a structured and scalable Redux store in your application, follow this setup.
Inside the store directory, use the slices folder where all your Redux slices will be stored. Then, import all slices into the central reducers file.
This ensures that Universal will automatically recognize all slice types and include them in the store, providing full type safety.
With useAppSelector
, you can access the fully-typed Redux store, including elements provided by Universal.
1 2import { updateIntl, useAppDispatch, useAppSelector } from 'universal-scripts' 3import locales from 'src/locales' 4 5function SelectLanguage() { 6 const locale = useAppSelector((state) => state.intl.lang) 7 const dispatch = useAppDispatch() 8 9 const changeLang = (event) => { 10 const lang = event.target.value 11 dispatch( 12 updateIntl({ 13 lang, 14 messages: locales[lang] 15 }) 16 ) 17 } 18 19 return ( 20 <select value={locale} onChange={changeLang}> 21 {Object.keys(locales).map((lang) => ( 22 <option key={lang} value={lang}> 23 {lang.toUpperCase()} 24 </option> 25 ))} 26 </select> 27 ) 28}
Environment variables are declared in the .env file. These variables are not included in the generated build by default, ensuring that sensitive information is not stored in the build. The variables are read during the application startup and are sent from the server to the client. Only variables that start with PUBLIC_
are passed from the server to the client. If server-side rendering (SSR) is disabled, the variables are still sent to the client in the same way.
If you modify the .env
file in development, Universal will automatically perform a hot reload with the updated variable values. In production mode, you only need to restart the app to apply the new variables—there’s no need to rebuild the app to see the changes.
This section explains how the main folders work in Universal. The core is built around js.conf.d
, which allows us to split the configuration into multiple files. This approach makes it possible to create new configurations or even override the built-in ones.
build.conf.d
– Contains everything related to the Webpack bundling process.runtime.conf.d
– Manages configurations related to the runtime of the application, such as redux, render....lib
– Provides common functionality and utilities.scripts
– Contains scripts defined in the scripts
section of package.json
, used for automation and task execution.server
– The main entry point for the server, containing all configurations for Express and middleware setup.client
– The main entry point for the client-side application.With this structure configurations in this way, Universal enables modular, maintainable, and customizable setups. 🚀
Check out the documentation to explore all features or follow the getting started guide.
For common use cases, support has been added to define configuration in a universal.config.mjs
file located at the root of your application.
You can export a plugins
object to customize specific plugin options, and a default
export for the main Universal configuration.
Currently, the following options are supported:
noSsr
: Disables server-side rendering. The server will return a minimal HTML file that only loads the client scripts.
extraBuilds
: An array of strings representing the names of additional builds to include.
No vulnerabilities found.
Reason
17 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/29 approved changesets -- score normalized to 0
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
68 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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