
Product
Introducing Socket Scanning for OpenVSX Extensions
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.
@sumup/foundry
Advanced tools
A toolkit that makes it a breeze to set up and maintain JavaScript + TypeScript applications. Foundry has tools for ๐ linting and currently supports Next.js, React, Emotion, Jest, Testing Library, Cypress, Playwright and Node.
Foundry should be installed as a dev-dependency. Run the following command in your terminal:
npm install --save-dev @sumup/foundry
Foundry exposes customizable configurations for the CLI tools it supports. Use the init command to initialize a configuration file for the tools you would like to use:
npx foundry init
Foundry will launch an interactive prompt to ask you questions about your project, such as whether you are planning to open source it. Once you have answered all questions, Foundry will write the config files (don't worry, it asks before overwriting existing files) and will add scripts to your package.json file to conveniently run the tools.
Alternatively, you can pass your answers to the init command directly as flags. This is useful for environments such as CI where interactive prompts cannot be used. Here is an overview of all available options (you can view this help menu by running npx foundry init --help):
-o, --openSource Whether the project is open-source [boolean]
-c, --configDir The directory to write configs to [string] [default: "."]
--overwrite Whether to overwrite existing config files
[boolean] [default: false]
--version Show version number [boolean]
--help Show this help menu [boolean]
All config files that are generated by Foundry follow the same format. They import a configuration function, optionally call it with overrides, and export the result. Here's an example:
module.exports = require('@sumup/foundry/<tool>')(overrides);
// Example for .eslintrc.js:
module.exports = require('@sumup/foundry/eslint')({
rules: {
'@emotion/jsx-import': 'error',
},
});
The overrides are merged with Foundry's default configuration. The overrides follow each tool's configuration schema, please refer to their official documentation.
Foundry analyzes your project's dependencies to tailor the configurations to your project. It detects which ESLint plugins are installed and enables & configures them automatically. Foundry will warn you if a framework is installed but not its corresponding ESLint plugin or if a version of a plugin is installed hasn't been tested with Foundry. Use the debug command to inspect the detected configuration:
npx foundry debug
If the automatic detection is inaccurate, please open an issue so we can improve it for everyone. Alternatively, you can explicitly set the options under the foundry property in your package.json file:
// package.json
{
"foundry": {
"environments": ["Browser"]
}
}
The supported options are:
| Name | Type | Options |
|---|---|---|
| language | string | 'TypeScript', 'JavaScript' |
| environments | array | 'Browser', 'Node' |
| plugins | array | 'Circuit UI', 'Cypress', 'Emotion', 'Jest', 'Next.js', 'Playwright', 'Storybook', 'Testing Library' |
| frameworks | array | 'Next.js', 'React' |
| openSource | boolean | true, false |
Check code for syntax errors and format it automatically. The preset adds the following scripts to your package.json:
lint: check files for problematic patterns and report themlint:fix: same as lint, but also try to fix the issuesThe preset includes the following tools:
postinstall script.Foundry manages all supported tools for you and exposes them via the run command. As an example, to run ESLint through Foundry, execute:
npx foundry run eslint src
Here, src is the folder you want ESLint to check. Note that you can use any of the command-line flags and arguments supported by ESLint and other tools. Foundry forwards them so they get handled by the tool. For example, to have ESLint fix your linting errors, run npx foundry run eslint --fix src.
TL;DR
Creating and maintaining a JavaScript project can be very tedious. There are tools, configurations, dependency management, and boilerplate. With Foundry, you can fix all of that with a single dependency. It lints, creates files, and keeps the tools up to date. And the best part? You can still get down and dirty with your configurations. But only if you want.
Setting up and maintaining a complex JavaScript project can be very tedious. There are many different dependencies to install (linters, testing frameworks, bundlers) and configurations to set up. Once you have a running project, you end up writing a lot of boilerplate code when creating commonly used files. For example, a React component might come with a spec file (test), a Storybook file (isolated component development), and a service for handling business logic.
It gets much, much worse when you have several (many?) projects. What happens when there is a breaking change in a tooling dependency? What if a team decides you need to add a new linting rule? Nobody wants to go through every project and update those files all the time. And who knows, if they are even the same? Syncing configurations is terrible. Or think about that new engineer you are onboarding. How are they supposed to know how you structure your project, how your components are supposed to look, which files they need to create?
You might think you could solve these issues with a boilerplate repository and some snippets or templates. But you cannot. At least the maintenance problem will not go away.
Toolkits are a way to mitigate these kinds of problems. They encapsulate as much as possible of the toolchain into a single dependency and expose it through a CLI. Doing so gets you the following, probably more!
package.json shorter. :spider_web:We were inspired by many toolkit projects, such as create-react-app and kcd-scripts. These projects are opinionated, and so is Foundry. But Foundry is different, in our opinion, because:
So please, go ahead and try it.
We want to foster an inclusive and friendly community around our Open Source efforts. Like all SumUp Open Source projects, this project follows the Contributor Covenant Code of Conduct. Please, read it and follow it.
If you feel another member of the community violated our CoC or you are experiencing problems participating in our community because of another individual's behavior, please get in touch with our maintainers. We will enforce the CoC.
It is our mission to make easy and fast card payments a reality across the entire world. You can pay with SumUp in more than 30 countries already. Our engineers work in Berlin, Cologne, Sofia, and Sฤo Paulo. They write code in TypeScript, Swift, Ruby, Go, Java, Erlang, Elixir, and more. Want to come work with us? Head to our careers page to find out more.
7.2.0
[!WARNING] >
@sumup/foundrywill be renamed to@sumup-oss/foundryin the next major release. v7.2 has been published under both names, so you can already migrate by updating the package name in yourpackage.jsonfile.
07cd253 Thanks @connor-baer! - Extended the supported version range for eslint-plugin-jest to include v28.x.FAQs
A toolkit for JavaScript + TypeScript applications by SumUp.
The npm package @sumup/foundry receives a total of 513 weekly downloads. As such, @sumup/foundry popularity was classified as not popular.
We found that @sumup/foundry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.ย It has 6 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.

Product
Bringing supply chain security to the next generation of JavaScript package managers

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies