
Product
Announcing Socket Certified Patches: One-Click Fixes for Vulnerable Dependencies
A safer, faster way to eliminate vulnerabilities without updating dependencies
@aivenio/aquarium
Advanced tools
Implementation of Aiven Aquarium design system, released as an npm package. Quick tour:
To install Aquarium to your app:
npm install --save @aivenio/aquarium
Make sure to add the correct fonts in your app. Inter for Aiven theme.
Import the CSS to your app
import '@aivenio/aquarium/dist/styles.css'THEME=X npm run build for building, use import '@aivenio/aquarium/dist/styles_X.css'Add React context component to the root of your React app
import MyApp from './MyApp';
+ import { Context } from '@aivenio/aquarium';
const Root = () => (
return (
+ <Context>
<MyApp />
+ </Context>
)
)
If you encounter problems resolving EcmaScript modules disable "fullySpecified" mode using this Webpack config:
webpack: {
configure: {
module: {
rules: [
{
test: /\.m?js/,
resolve: {
fullySpecified: false,
},
},
]
},
}
},
};
Use npm 7! With older npm versions, install peerDependencies manually. If you encounter "Cannot find module..." errors, try rm -rf node_modules && npm i. This seems to be a bug introduced in npm@7.
This project requires certain environment variables to be set before commands such as npm run build will work. Most can be copy/pasted with the help of your teammates, but you will need to generate a NPM token yourself in order.
Create an npm account here if you don't already have one.
Generate a token for your account. You can read about how to do so here. For the purposes of building the project, read-only access will suffice.
Copy the sample environment file: cp .env.sample .env
Add the necessary data into the newly-created .env file.
Source the .env file for the environment variables to be set: source .env
Note that any time a new shell instance is created (for example, when you restart your computer), you need to run source .env again, or the variables won't be set. Consider using a solution such as autoenv to automatically apply the .env file.
npm ci to install dependenciesnpm run build to build the production build of the librarynpm start to start StorybookTo develop Aquarium components in the context of an application, it is easier to run a locally modified version of Aquarium in your application. There are two ways to do this: npm link, or copying the module into your app. This allows you to make changes to components and instantly see the change in the context of the app.
npm link❌ TODO: This doesn't currently work out of the box. Revise the instructions
npm linknpm link <path to your app>/node_modules/react to avoid running into conflict of having two react instances. This will otherwise break the rules of hooks and crash the app. More info on the issue here. If the command fails with errors about peer dependencies, re-run the command, adding --force at the end.npm link @aivenio/aquarium<path to your app>/node_modules/@aivenio/aquarium is a symlink to your local Aquarium directory.npm run watch@aivenio/aquariumnpm unlink --no-save @aivenio/aquarium, then npm i to reinstall the dependency.⚠️ If you've installed new dependencies on the DS side, this doesn't work. See instructions for npm pack instead.
npm link can be tricky to get working. A simpler approach is to build a production build of the DS and copy it into your application's node-modules directory. Remember to restart the build process of your app once DS has been built and copied over. Here's a snippet to do all that:
cd <path to ds> \
&& npm run build \
&& cd <path to your app> \
&& rm -rf ./node_modules/@aivenio/aquarium/dist \
&& cp -R <path to ds>/dist ./node_modules/@aivenio/aquarium # && <the dev/build command of your app>
npm packCopy module is a hack which doesn't work when the dependencies have changed on the DS side since the last install in your app side.
You can use pack-and-install.sh utility script to create local release package and install it to your local application.
APP_PATH=<path to your app> ./pack-and-install.sh && <run dev/build command for your app>
Or if you want, you can also run npm pack command manually and then install that to your app.
cd <path to ds> \
&& npm run build \
&& jq --arg file_name $(npm pack 2>&1 | tail -1) '.dependencies["@aivenio/aquarium"] = "file:<path to ds>/\($file_name)"' <path to your app>/package.json > <path to your app>/package-json-new.tmp \
&& cd <path to your app> \
&& mv package-json-new.tmp package.json \
&& npm install # && <the dev/build command of your app>
Make sure you replace all <path to ds> and <path to your app> strings with the exact absolute paths.
Remember that source .env is needed before NPM commands.
npm test to run all tests oncenpm test -- Button to run only tests matching Buttonnpm run test:watch to run tests in watch modenpm run test:coverage to run all tests and see the coverageNote! It's good idea to run tests in watch mode when developing. If for example snapshot tests fail due to some code changes it's easy to update those with the jest commandline tool. If you want to just update the snapshots that can be done with jest --updateSnapshot. More information here
THEME=<brand> npm start to start local storybook with a themeTHEME=<brand> npm run build to build DS module with a themenpm run figma -- sync -i .figma-file.json to generate ./tokens.json but using previously fetched local file instead of fetching the huge Figma file from API.npm run figma -- sync --debug to enable more verbose outputnpm run figma -- sync --foundation-page-name 'my foundations' to override options.jq '.document.children[] | select(.id == "8916:120229")' .cache/figma-file.json to slice Foundations page from whole Figma file JSON.There is more documentation for the Figma sync tool.
Run npm run build:storybook.
Storybook is deployed to Cloudflare Pages everytime new code is merged to main.
npm run builddist for the built codeRun npm run release -- --bump <bump> (all the dashes are needed) where bump is one of major, minor or patch.
This command will automatically checkout a release branch, commit the version bump, and open your browser to submit a PR.
Review the PR created, and merge it to main. GH actions will handle the rest.
Any API breaking change should be a major version bump and should be mentioned in release notes!
Breaking change examples:
These are not breaking changes:
A lot of research was done into existing design systems, and if we could reuse parts of them. The conclusion was that we take mostly inspiration of the good ideas, and maybe use individual components by copy pasting code to our system.
Some of the projects are huge, the link most commonly points directly to the part of the code base which defines the components. For tests, I checked that tests for a few components look OK, no coverage or deeper analysis done.
Next things to consider:
| Link | Commits* | JS/TS | Styling | License | Tests | Other |
|---|---|---|---|---|---|---|
| Ant Design | 18.6k | TS | Less. example | MIT | ☑️ | |
| Aragon UI | 0.8k | JS | styled-components | MIT | Not much | |
| Baseweb by Uber | 2.3k | JS (Flow) | style-tron | MIT | ☑️ | |
| Basis | 0.3k | JS | emotion | MIT | ☑️ | |
| Blueprint | 1.8k | TS | Sass | Apache 2.0 | ☑️ | |
| Carbon | 6.8k | JS | CSS classnames linking to Sass | Apache 2.0 | ☑️ | ☑️ Storybook |
| Fluent UI by Microsoft | 8.6k | TS | CSS in JS, seems to be a custom one | MIT | ☑️ | |
| Grommet | 5.2k | JS | styled-components | Apache 2.0 | ☑️ | ☑️ Storybook |
| Material UI | 11.9k | JS | CLSX, CSS in JS. Example | MIT | ☑️ | |
| MongoDB design | 0.4k | JS | CSS | package.json says MIT, no LICENSE file | No | |
| Pivotal UI | 4.0k | JS | Sass | MIT | ☑️ | |
| Polaris by Shopify | 6.1k | TS | Sass | Modified MIT, see more | ☑️ | |
| Primer by GitHub | 4.5k | JS | styled-components | MIT | ☑️ | |
| React Bootstrap | 3.8k | JS | Bootstrap CSS classes | MIT (also Bootstrap is MIT) | ☑️ | |
| Reactstrap | 0.8k | JS | Bootstrap CSS classes | MIT | ☑️ | |
| RMWC | 1.9k | JS | CSS classnames using material-components-web by Google (source is Sass) | MIT (also material-components-web is MIT) | ☑️ | |
| Salesforce Design System | 9.5k | JS | Sass | Code BSD 3-Clause, see: https://github.com/salesforce-ux/design-system#licenses | ☑️ | |
| Thumbprint | 0.7k | TS | Sass | Apache 2.0 | ☑️ | |
| VTEX Styleguide | 4.3k | JS | Custom Tachyons classes + CSS. Example implementation and CSS | Unlicensed | Not much | |
| Zendesk Garden | 0.8k | TS | styled-components | Apache 2.0 | ☑️ | ☑️ Storybook |
For further investigation, you can find plenty of components in GitHub: https://github.com/search?l=&p=99&q=created%3A%3E2015-01-01+extension%3Ajs+extension%3Ajsx+extension%3Ats+extension%3Atsx+size%3A%3E100+filename%3AButton.js+filename%3AButton.ts+filename%3AButton.jsx+filename%3AButton.tsx+filename%3Abutton.js+filename%3Abutton.ts+filename%3Abutton.jsx+filename%3Abutton.tsx&ref=advsearch&type=Code
You can find more design systems here: https://github.com/alexpate/awesome-design-systems. Not all of them have open source code.
FAQs
Aiven Aquarium design system
The npm package @aivenio/aquarium receives a total of 5,657 weekly downloads. As such, @aivenio/aquarium popularity was classified as popular.
We found that @aivenio/aquarium demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 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
A safer, faster way to eliminate vulnerabilities without updating dependencies

Product
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.

Research
/Security News
Malicious npm packages use Adspect cloaking and fake CAPTCHAs to fingerprint visitors and redirect victims to crypto-themed scam sites.