Giter Club home page Giter Club logo

svgmoji's Introduction

svg logo from undraw.co

Consume popular open-source emoji libraries as SVG's.


Why? · Getting Started · Future · Docs · Contributing


Continuous integration badge for github actions Continuous integration badge for docs deployment


Why?

Consume open source emoji libraries as vector graphics (.svg). The bundle size is smaller and the image scales better with high resolution devices.

This library tracks the most popular emoji projects that I'm aware of and makes their SVG available as sprites which can be consumed.


thumbs up   grinning   red heart   face with tears of joy   grinning face with sweat   pleading face   pile of poo   loudly crying face   smiling face with sunglasses   face screaming in fear

<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/gh/svgmoji/svgmoji/packages/svgmoji__noto/svg/1F44D.svg"
  alt="thumbs up"
  title="thumbs up"
/>

<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/gh/svgmoji/svgmoji/packages/svgmoji__noto/sprites/subgroups/face-affection.svg#1F385"
/>

<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/gh/svgmoji/svgmoji/packages/svgmoji__noto/sprites/group/smileys-emotion.svg#1F441-FE0F-200D-1F5E8-FE0F"
/>

<!-- GZIP 3.8MB -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/gh/svgmoji/svgmoji/packages/svgmoji__noto/sprites/all.svg#1F441-FE0F-200D-1F5E8-FE0F"
/>

thumbs up   grinning   red heart   face with tears of joy   grinning face with sweat   pleading face   pile of poo   loudly crying face   smiling face with sunglasses   face screaming in fear

<!-- Individual -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/npm/@svgmoji/[email protected]/svg/1F44D.svg"
  alt="thumbs up"
  title="thumbs up"
/>

<!-- Subgroup Bundle -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/npm/@svgmoji/[email protected]/sprites/subgroups/face-affection.svg#1F385"
/>

<!-- Grouped Bundle -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/npm/@svgmoji/[email protected]/sprites/group/smileys-emotion.svg#1F441-FE0F-200D-1F5E8-FE0F"
/>

<!-- Full Sprite Bundle -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/npm/@svgmoji/[email protected]/sprites/all.svg#1F441-FE0F-200D-1F5E8-FE0F"
/>

Attributes requirements are outlined here.


thumbs up   grinning   red heart   face with tears of joy   grinning face with sweat   pleading face   pile of poo   loudly crying face   smiling face with sunglasses   face screaming in fear

<!-- Individual -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/npm/@svgmoji/[email protected]/svg/1F44D.svg"
  alt="thumbs up"
  title="thumbs up"
/>

<!-- Subgroup Bundle -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/npm/@svgmoji/[email protected]/sprites/subgroups/face-affection.svg#1F385"
/>

<!-- Grouped Bundle -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/npm/@svgmoji/[email protected]/sprites/group/smileys-emotion.svg#1F441-FE0F-200D-1F5E8-FE0F"
/>

<!-- Full Sprite Bundle -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/npm/@svgmoji/[email protected]/sprites/all.svg#1F441-FE0F-200D-1F5E8-FE0F"
/>

All emojis designed by OpenMoji – the open-source emoji and icon project. License: CC BY-SA 4.0. Requirements for attribution are outlined here.

thumbs up   grinning   red heart   face with tears of joy   grinning face with sweat   pleading face   pile of poo   loudly crying face   smiling face with sunglasses   face screaming in fear

<!-- Individual -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/npm/@svgmoji/[email protected]/svg/1F44D.svg"
  alt="thumbs up"
  title="thumbs up"
/>

<!-- Subgroup Bundle -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/npm/@svgmoji/[email protected]/sprites/subgroups/face-affection.svg#1F385"
/>

<!-- Grouped Bundle -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/npm/@svgmoji/[email protected]/sprites/group/smileys-emotion.svg#1F441-FE0F-200D-1F5E8-FE0F"
/>

<!-- Full Sprite Bundle -->
<img
  width="40px"
  height="40px"
  src="https://cdn.jsdelivr.net/npm/@svgmoji/[email protected]/sprites/all.svg#1F441-FE0F-200D-1F5E8-FE0F"
/>

Getting Started

Install the emoji library of your choice.

pnpm add @svgmoji/noto

You can consume the library in the following way.

import { Notomoji } from '@svgmoji/notomoji';
import data from 'svgmoji/emoji.json';

const notomoji = new Notomoji({ data, type: 'all' });
const image = document.createElement('img');
image.src = notomoji.url('❤️');

document.body.append(image);

The above code will reference the svg sprite image from the cdn. This is a huge file (3000+ emoji) and although it's a one off download cost, you may prefer to be more incremental.

The type parameter can be updated to reflect how you want to reference the emoji.

// Will load the cdn sprite for the emoji groups.
// There are 10 groups in total some of which rarely get used.
const groupNotomoji = new Notomoji({ data, type: 'group' });

// Will load the cdn sprite for the subgroup. Smaller download size,
// but if you are using a large variety of emoji, it could lead to
// delayed load times.
const subGroupNotomoji = new Notomoji({ data, type: 'subgroup' });

// Loads each emoji as a direct url. This is useful if emoji are
// rarely used in your codebase.
const individualNotomoji = new Notomoji({ data, type: 'individual' });

Documentation is still very much a work in progress and more is to come.


Future

  • Optimize the individual SVG's with svgo.

  • Add React support to all libraries.

    import { SvgMoji } from `@svgmoji/noto/react`;
    
    const MyMoji = () => {
      return <SvgMoji unicode='💋' />;
    };
  • Add React Native components.

  • Add Vue components.

  • Add Svelte components.

  • Add SVG CSS support.

  • Add metrics for sizes of the group, subgroup, and other sizes for metric.

  • Add new package @svgmoji/openmoji-black for openmoji black and white emoji support.

  • Add support for css backgrounds.

  • Add font consumption support.

Contributing

Please read our contribution guide for details on our code of conduct, and the process for submitting pull requests. It also outlines the project structure so you can find help when navigating your way around the codebase.

In addition each folder in this codebase a readme describing why it exists.

You might also notice there are surprisingly few files in the root directory of this project. All the configuration files have been moved to the support/root directory and are symlinked to the root directory in a preinstall hook. For more information take a look at folder and readme.


Versioning

This project uses SemVer for versioning. For the versions available, see the tags on this repository.


License

This project is licensed under the MIT License - see the LICENSE file for details

svgmoji's People

Contributors

github-actions[bot] avatar ifiokjr avatar laem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

svgmoji's Issues

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Unable to import svgmoji in Node.js

Summary

I can't import svgmoji in Node.js with ESM import syntax.

Steps to reproduce

bash-3.2$ pnpm install @svgmoji/core
Packages: +10
++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: /Users/ocavue/.pnpm-store/v3
  Virtual store is at:             node_modules/.pnpm
Progress: resolved 10, reused 10, downloaded 0, added 10, done

dependencies:
+ @svgmoji/core 3.2.0
bash-3.2$ echo 'import {stripHexcode} from "@svgmoji/core"' > file.mjs
bash-3.2$ node file.mjs
file:///private/tmp/svgmoji_playground/file.mjs:1
import {stripHexcode} from "@svgmoji/core"
        ^^^^^^^^^^^^
SyntaxError: Named export 'stripHexcode' not found. The requested module '@svgmoji/core' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@svgmoji/core';
const {stripHexcode} = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:128:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:194:5)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:385:24)
    at async loadESM (node:internal/process/esm_loader:88:5)
    at async handleMainPromise (node:internal/modules/run_main:61:12)
bash-3.2$

Expected results

I can import svgmoji in a Node.js .mjs file.

Actual results

SyntaxError: Named export 'stripHexcode' not found. The requested module '@svgmoji/core' is a CommonJS module, which may not support all module.exports as named exports.

Additional context

The export file for module in package.json is not valid.

  "main": "dist/svgmoji-core.cjs.js",
  "module": "dist/svgmoji-core.esm.js",

Here is an explanation of these kinds of errors: https://github.com/sheremet-va/dual-packaging

Possible Solution

Two simplest solutions are:

  • Rename all ESM files from .js to .mjs, or
  • Rename all CJS files from .js to .cjs and add "type": "module" in package.json.

Multiple Requests sent for SVG sprite in Firefox

Summary

SVG sprite rendering blinking on multiple reloads of the page in Firefox

Steps to reproduce

  • A App Requesting for the same SVG sprite 10 times (each with different #ids)
  • Now try to access that app in Firefox

Expected results

  • Only one request for the SVG Sprite should be sent

Actual results

  • Request for SVG Sprite is sent 10 times

Additional context

Possible Solution

It seems to be a Bug in Firefox itself, links here:

They suggested a workaround, until the issue is fixed on their side. Please go through the bug report for the workaround

Cannot find module '@svgmoji/notomoji'

Summary

The package @svgmoji/notomoji does not exist, but it is used in examples on the documentation, leading to errors.

Steps to reproduce

This code:

import { Notomoji } from '@svgmoji/notomoji';
import data from 'svgmoji/emoji.json';

const notomoji = new Notomoji({ data, type: 'individual' })

Produces this is the error:

Cannot find module '@svgmoji/notomoji' or its corresponding type declarations.ts(2307)

Expected results

No errors in examples on the documentation.

Possible Solution

Rename references to @svgmoji/noto instead. But there's a type error that rises then (#26)...

Emoji 13.1 in Twemoji

Summary

Twemoji Released 13.1 Emoji Version. I've used your library for my personal project. Is it possible to add these new emojis in twemoji svg sprites?

Note: I've tried to create a "Ask a question" or "Suggest an Idea" template, but keep getting redirected to 404 page.

Svg link returns 503

Summary

import { Blobmoji } from '@svgmoji/blob';
import svgmojiData from 'svgmoji/emoji.json';

const emojiCode = "💡"
const emoji = document.createElement('img');
const blobmoji = new Blobmoji({ data: svgmojiData, type: 'individual' });
emoji.src = blobmoji.url(emojiCode);

src will become https://cdn.jsdelivr.net/gh/svgmoji/[email protected]/packages/svgmoji__blob/svg/1F4A1.svg, which returns 503 No healthy backends.

Steps to reproduce

N/A

Expected results

N/A

Actual results

N/A

Additional context

N/A

Possible Solution

Seems like the link misses a v behind the version.

Type error in 'svgmoji/emoji.json': Type 'number' is not assignable to type 'Presentation'.ts(2322)

Summary

The type definitions of the library are wrong, because the example code gives errors.

Steps to reproduce

import { Notomoji } from '@svgmoji/noto'
import data from 'svgmoji/emoji.json'

const notomoji = new Notomoji({ data, type: 'individual' })

Expected results

No type errors.

Actual results

This error:

Type '({ annotation: string; hexcode: string; emoji: string; text: string; type: number; version: number; shortcodes: string[]; tags?: undefined; order?: undefined; group?: undefined; subgroup?: undefined; emoticon?: undefined; skins?: undefined; tone?: undefined; gender?: undefined; } | ... 8 more ... | { ...; })[]' is not assignable to type 'FlatEmoji[] | MinifiedEmoji[]'.
 Type '({ annotation: string; hexcode: string; emoji: string; text: string; type: number; version: number; shortcodes: string[]; tags?: undefined; order?: undefined; group?: undefined; subgroup?: undefined; emoticon?: undefined; skins?: undefined; tone?: undefined; gender?: undefined; } | ... 8 more ... | { ...; })[]' is not assignable to type 'FlatEmoji[]'.
   Type '{ annotation: string; hexcode: string; emoji: string; text: string; type: number; version: number; shortcodes: string[]; tags?: undefined; order?: undefined; group?: undefined; subgroup?: undefined; emoticon?: undefined; skins?: undefined; tone?: undefined; gender?: undefined; } | ... 8 more ... | { ...; }' is not assignable to type 'FlatEmoji'.
     Type '{ annotation: string; hexcode: string; emoji: string; text: string; type: number; version: number; shortcodes: string[]; tags?: undefined; order?: undefined; group?: undefined; subgroup?: undefined; emoticon?: undefined; skins?: undefined; tone?: undefined; gender?: undefined; }' is not assignable to type 'FlatEmoji'.
       Types of property 'type' are incompatible.
         Type 'number' is not assignable to type 'Presentation'.ts(2322)
base-moji.d.ts(7, 5): The expected type comes from property 'data' which is declared here on type 'MojiProps'

Possible Solution

Fix the types.

Either change the union type of Presentation from 1 | 2 to number, or update the type of svgmoji/emoji.json to make sure that type is of type 1 | 2. I think that the second option is the best one, maybe you can import the json file in a ts file, then perform some checks to narrow the types or just use a type cast, and then export the data variable.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm @babel/plugin-proposal-class-properties Unavailable
npm @babel/plugin-proposal-nullish-coalescing-operator Unavailable
npm @babel/plugin-proposal-numeric-separator Unavailable
npm @babel/plugin-proposal-object-rest-spread Unavailable
npm @babel/plugin-proposal-optional-chaining Unavailable
npm @babel/plugin-proposal-private-methods Unavailable
npm @types/classnames Unavailable
npm @types/markdown-table Unavailable
npm @types/rimraf Unavailable
npm @types/svgo Unavailable
npm @types/testing-library__jest-dom Unavailable
npm npm-run-all Available

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): replace dependency npm-run-all with npm-run-all2 ^5.0.0
  • chore(deps): update dependency @changesets/pre to ^1.0.14
  • chore(deps): update dependency @manypkg/get-packages to ^1.1.3
  • chore(deps): update dependency @remirror/core-helpers to v1.0.6
  • chore(deps): update dependency @types/jest-axe to ^3.5.9
  • chore(deps): update dependency @types/lodash.isequal to ^4.5.8
  • chore(deps): update dependency @types/minimist to ^1.2.5
  • chore(deps): update dependency @types/ms to ^0.7.34
  • chore(deps): update dependency @types/rimraf to ^3.0.2
  • chore(deps): update dependency @types/svg-sprite to ^0.0.39
  • chore(deps): update dependency @types/tar to ^4.0.5
  • chore(deps): update dependency @types/testing-library__jest-dom to ^5.14.9
  • chore(deps): update dependency babel-plugin-dev-expression to ^0.2.3
  • chore(deps): update dependency babel-plugin-macros to ^3.1.0
  • chore(deps): update dependency chalk to ^4.1.2
  • chore(deps): update dependency country-code-emoji to ^2.3.0
  • chore(deps): update dependency cpy to ^8.1.2
  • chore(deps): update dependency husky to ^5.2.0
  • chore(deps): update dependency jest-watch-typeahead to ^0.6.5
  • chore(deps): update dependency markdown-table to ^3.0.3
  • chore(deps): update dependency match-sorter to ^6.3.4
  • chore(deps): update dependency pirates to ^4.0.6
  • chore(deps): update dependency size-limit to ^4.12.0
  • chore(deps): update dependency source-map to ^0.7.4
  • chore(deps): update dependency source-map-support to ^0.5.21 (source-map-support, @types/source-map-support)
  • chore(deps): update dependency svg-sprite to ^1.5.4
  • chore(deps): update emojibase monorepo (emojibase, emojibase-data, emojibase-regex)
  • chore(deps): update react monorepo (@types/react, @types/react-dom, react, react-dom)
  • chore(deps): update babel monorepo (@babel/core, @babel/parser, @babel/plugin-proposal-class-properties, @babel/plugin-proposal-decorators, @babel/plugin-proposal-nullish-coalescing-operator, @babel/plugin-proposal-numeric-separator, @babel/plugin-proposal-object-rest-spread, @babel/plugin-proposal-optional-chaining, @babel/plugin-proposal-private-methods, @babel/plugin-transform-runtime, @babel/plugin-transform-template-literals, @babel/plugin-transform-typescript, @babel/preset-env, @babel/preset-react, @babel/register, @babel/runtime)
  • chore(deps): update dependency @changesets/cli to ^2.27.5
  • chore(deps): update dependency @changesets/get-dependents-graph to ^1.3.6
  • chore(deps): update dependency @changesets/read to ^0.6.0
  • chore(deps): update dependency @changesets/types to ^4.1.0
  • chore(deps): update dependency @manypkg/cli to ^0.21.4
  • chore(deps): update dependency @preconstruct/cli to ^2.8.4
  • chore(deps): update dependency @size-limit/preset-big-lib to ^4.12.0
  • chore(deps): update dependency @testing-library/jest-dom to ^5.17.0
  • chore(deps): update dependency @types/babel__core to ^7.20.5
  • chore(deps): update dependency @types/eslint to ^7.29.0
  • chore(deps): update dependency @types/node to ^15.14.9
  • chore(deps): update dependency classnames to ^2.5.1
  • chore(deps): update dependency diffable-html to ^4.1.0
  • chore(deps): update dependency esbuild to ^0.21.5
  • chore(deps): update dependency eslint to ^7.32.0
  • chore(deps): update dependency eslint-config-prettier to ^8.10.0
  • chore(deps): update dependency eslint-plugin-import to ^2.29.1
  • chore(deps): update dependency eslint-plugin-jest to ^24.7.0
  • chore(deps): update dependency eslint-plugin-jest-formatting to ^3.1.0
  • chore(deps): update dependency eslint-plugin-jsx-a11y to ^6.9.0
  • chore(deps): update dependency eslint-plugin-promise to ^5.2.0
  • chore(deps): update dependency globby to ^11.1.0
  • chore(deps): update dependency idb-keyval to ^5.1.5
  • chore(deps): update dependency lint-staged to ^11.2.6
  • chore(deps): update dependency prettier to ^2.8.8
  • chore(deps): update dependency prettier-plugin-packagejson to ^2.5.0
  • chore(deps): update dependency snapshot-diff to ^0.10.0
  • chore(deps): update dependency svgo to ^2.8.0 (svgo, @types/svgo)
  • chore(deps): update dependency tslog to ^3.3.4
  • chore(deps): update dependency type-fest to ^1.4.0
  • chore(deps): update dependency typescript to ^4.9.5
  • chore(deps): update docusaurus monorepo to v2.4.3 (@docusaurus/core, @docusaurus/module-type-aliases, @docusaurus/preset-classic, @docusaurus/types)
  • chore(deps): update jest monorepo (@jest/types, @types/jest, babel-jest, jest, jest-circus, jest-diff)
  • chore(deps): update node.js to >=14.21.3
  • chore(deps): update pnpm to >=6.35.1
  • chore(deps): update typescript-eslint monorepo to ^4.33.0 (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • chore(deps): update actions/cache action to v4
  • chore(deps): update actions/checkout action to v4
  • chore(deps): update dependency @changesets/get-dependents-graph to v2
  • chore(deps): update dependency @changesets/pre to v2
  • chore(deps): update dependency @changesets/types to v6
  • chore(deps): update dependency @manypkg/get-packages to v2
  • chore(deps): update dependency @mdx-js/react to v3
  • chore(deps): update dependency @remirror/core-helpers to v3
  • chore(deps): update dependency @size-limit/preset-big-lib to v11
  • chore(deps): update dependency @testing-library/jest-dom to v6
  • chore(deps): update dependency @types/eslint to v8
  • chore(deps): update dependency @types/rimraf to v4
  • chore(deps): update dependency @types/tar to v6
  • chore(deps): update dependency @types/testing-library__jest-dom to v6
  • chore(deps): update dependency camelcase-keys to v9
  • chore(deps): update dependency chalk to v5
  • chore(deps): update dependency cpy to v11
  • chore(deps): update dependency cpy-cli to v5
  • chore(deps): update dependency diffable-html to v5
  • chore(deps): update dependency eslint to v9
  • chore(deps): update dependency eslint-config-prettier to v9
  • chore(deps): update dependency eslint-plugin-jest to v28
  • chore(deps): update dependency eslint-plugin-markdown to v5
  • chore(deps): update dependency eslint-plugin-promise to v6
  • chore(deps): update dependency eslint-plugin-simple-import-sort to v12
  • chore(deps): update dependency eslint-plugin-unicorn to v54
  • chore(deps): update dependency globby to v14
  • chore(deps): update dependency gzip-size to v7
  • chore(deps): update dependency husky to v9
  • chore(deps): update dependency idb-keyval to v6
  • chore(deps): update dependency jest-axe to v9
  • chore(deps): update dependency jest-extended to v4
  • chore(deps): update dependency jest-watch-typeahead to v2
  • chore(deps): update dependency lint-staged to v15
  • chore(deps): update dependency p-limit to v5
  • chore(deps): update dependency prettier to v3
  • chore(deps): update dependency rimraf to v5
  • chore(deps): update dependency size-limit to v11
  • chore(deps): update dependency sort-keys to v5
  • chore(deps): update dependency svg-sprite to v2
  • chore(deps): update dependency svgo to v3 (svgo, @types/svgo)
  • chore(deps): update dependency tslog to v4
  • chore(deps): update dependency type-fest to v4
  • chore(deps): update dependency typescript to v5
  • chore(deps): update dependency write-json-file to v5
  • chore(deps): update docusaurus monorepo to v3 (major) (@docusaurus/core, @docusaurus/module-type-aliases, @docusaurus/preset-classic, @docusaurus/types)
  • chore(deps): update emojibase monorepo to v15 (major) (emojibase, emojibase-data, emojibase-regex)
  • chore(deps): update jamesives/github-pages-deploy-action action to v4
  • chore(deps): update jest monorepo to v29 (major) (@jest/types, @types/jest, babel-jest, jest, jest-circus, jest-diff)
  • chore(deps): update node.js to v20 (node, @types/node)
  • chore(deps): update pnpm to v9
  • chore(deps): update react monorepo to v18 (major) (@types/react, @types/react-dom, react, react-dom)
  • chore(deps): update typescript-eslint monorepo to v7 (major) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • chore(deps): lock file maintenance
  • 🔐 Create all rate-limited PRs at once 🔐

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
.devcontainer/Dockerfile
  • mcr.microsoft.com/vscode/devcontainers/javascript-node 0-14
github-actions
.github/workflows/ci.yml
  • actions/checkout v2
  • actions/cache v2
  • actions/setup-node v2-beta
  • actions/checkout v2
  • actions/cache v2
  • actions/setup-node v2-beta
  • actions/checkout v2
  • actions/cache v2
  • actions/setup-node v2-beta
  • actions/checkout v2
  • actions/cache v2
  • actions/setup-node v2-beta
  • actions/checkout v2
  • actions/cache v2
  • actions/setup-node v2-beta
.github/workflows/docs.yml
  • actions/checkout v2
  • actions/cache v2
  • actions/setup-node v2-beta
  • JamesIves/github-pages-deploy-action 3.7.1
.github/workflows/publish.yml
  • actions/checkout v2
  • actions/cache v2
  • actions/setup-node v2-beta
.github/workflows/version.yml
  • actions/checkout v2
  • actions/cache v2
  • actions/setup-node v2-beta
npm
package.json
  • @babel/core ^7.12.16
  • @babel/parser ^7.12.16
  • @babel/plugin-proposal-class-properties ^7.12.13
  • @babel/plugin-proposal-decorators ^7.12.13
  • @babel/plugin-proposal-nullish-coalescing-operator ^7.12.13
  • @babel/plugin-proposal-numeric-separator ^7.12.13
  • @babel/plugin-proposal-object-rest-spread ^7.12.13
  • @babel/plugin-proposal-optional-chaining ^7.12.16
  • @babel/plugin-proposal-private-methods ^7.12.13
  • @babel/plugin-syntax-dynamic-import ^7.8.3
  • @babel/plugin-transform-runtime ^7.12.15
  • @babel/plugin-transform-template-literals ^7.12.13
  • @babel/plugin-transform-typescript ^7.12.16
  • @babel/preset-env ^7.12.16
  • @babel/preset-react ^7.12.13
  • @babel/runtime ^7.12.5
  • @changesets/cli ^2.14.1
  • @jest/types ^27.0.2
  • @manypkg/cli ^0.18.0
  • @manypkg/get-packages ^1.1.1
  • @preconstruct/cli ^2.0.4
  • @size-limit/preset-big-lib ^4.9.2
  • @testing-library/jest-dom ^5.11.9
  • @types/eslint ^7.2.6
  • @types/jest ^26.0.20
  • @types/jest-axe ^3.5.1
  • @types/node ^15.12.2
  • @types/testing-library__jest-dom ^5.9.5
  • @typescript-eslint/eslint-plugin ^4.15.0
  • @typescript-eslint/parser ^4.15.0
  • babel-jest ^27.0.2
  • babel-plugin-annotate-pure-calls ^0.4.0
  • babel-plugin-dev-expression ^0.2.2
  • babel-plugin-macros ^3.0.1
  • cpy-cli ^3.1.1
  • cross-env ^7.0.3
  • esbuild ^0.12.8
  • eslint ^7.20.0
  • eslint-config-prettier ^8.3.0
  • eslint-plugin-eslint-comments ^3.2.0
  • eslint-plugin-graphql ^4.0.0
  • eslint-plugin-import ^2.22.1
  • eslint-plugin-jest ^24.1.3
  • eslint-plugin-jest-formatting ^3.0.0
  • eslint-plugin-jsx-a11y ^6.4.1
  • eslint-plugin-markdown ^2.0.0-rc.0
  • eslint-plugin-promise ^5.1.0
  • eslint-plugin-simple-import-sort ^7.0.0
  • eslint-plugin-unicorn ^33.0.1
  • esm ^3.2.25
  • husky ^5.0.9
  • isomorphic-fetch ^3.0.0
  • jest ^27.0.4
  • jest-circus ^27.0.4
  • jest-extended ^0.11.5
  • jest-watch-typeahead ^0.6.1
  • json.macro ^1.3.0
  • lint-staged ^11.0.0
  • npm-run-all ^4.1.5
  • prettier ^2.2.1
  • prettier-plugin-packagejson ^2.2.9
  • rimraf ^3.0.2
  • size-limit ^4.9.2
  • snapshot-diff ^0.8.1
  • svgmoji ^3.2.0
  • typescript ^4.1.5
  • typescript-snapshots-plugin ^1.7.0
  • node >=14
  • pnpm >=6
packages/svgmoji/package.json
  • @babel/runtime ^7.12.5
  • @svgmoji/blob ^3.2.0
  • @svgmoji/core ^3.2.0
  • @svgmoji/noto ^3.2.0
  • @svgmoji/openmoji ^3.2.0
  • @svgmoji/twemoji ^3.2.0
packages/svgmoji__blob/package.json
  • @babel/runtime ^7.12.5
  • @svgmoji/core ^3.2.0
packages/svgmoji__core/package.json
  • @babel/runtime ^7.12.5
  • emojibase ^5.1.0
  • emojibase-regex ^5.1.1
  • idb-keyval ^5.0.2
  • match-sorter ^6.2.0
  • type-fest ^1.2.0
  • emojibase-data ^6.1.1
packages/svgmoji__noto/package.json
  • @babel/runtime ^7.12.5
  • @svgmoji/core ^3.2.0
packages/svgmoji__openmoji/package.json
  • @babel/runtime ^7.12.5
  • @svgmoji/core ^3.2.0
packages/svgmoji__twemoji/package.json
  • @babel/runtime ^7.12.5
  • @svgmoji/core ^3.2.0
support/package.json
  • @babel/register ^7.12.13
  • @changesets/get-dependents-graph ^1.2.0
  • @changesets/pre ^1.0.5
  • @changesets/read ^0.4.6
  • @changesets/types ^4.0.0
  • @remirror/core-helpers 1.0.0-next.60
  • @svgmoji/core 3.2.0
  • @types/babel__core ^7.1.12
  • @types/lodash.isequal ^4.5.5
  • @types/markdown-table ^3.0.0
  • @types/minimist ^1.2.1
  • @types/ms ^0.7.31
  • @types/rimraf ^3.0.0
  • @types/source-map-support ^0.5.3
  • @types/svg-sprite ^0.0.32
  • @types/svgo ^2.3.0
  • @types/tar ^4.0.4
  • camelcase-keys ^6.2.2
  • chalk ^4.1.0
  • country-code-emoji ^2.2.0
  • cpy ^8.1.1
  • diffable-html ^4.0.0
  • emojibase-data ^6.1.1
  • globby ^11.0.2
  • got ^11.8.1
  • gzip-size ^6.0.0
  • jest-axe ^5.0.1
  • jest-diff ^27.0.2
  • localstorage-polyfill ^1.0.1
  • lodash.isequal ^4.5.0
  • markdown-table ^3.0.0
  • minimist ^1.2.5
  • ms ^2.1.3
  • openmoji f6af300a94a29ab6ae1014d8e56fffb8b006d368
  • p-limit ^3.1.0
  • pirates ^4.0.1
  • rimraf ^3.0.2
  • sort-keys ^4.2.0
  • source-map ^0.7.3
  • source-map-support ^0.5.19
  • svg-sprite ^1.5.0
  • svgo ^2.3.0
  • tar ^6.1.0
  • tslog ^3.1.1
  • type-fest ^1.2.0
  • write-json-file ^4.3.0
support/website/package.json
  • @docusaurus/core 2.0.0-alpha.70
  • @docusaurus/module-type-aliases ^2.0.0-alpha.70
  • @docusaurus/preset-classic 2.0.0-alpha.70
  • @docusaurus/types ^2.0.0-alpha.70
  • @mdx-js/react ^1.5.8
  • @types/classnames ^2.3.1
  • @types/react ^17.0.2
  • @types/react-dom ^17.0.1
  • classnames ^2.2.6
  • react ^17.0.1
  • react-dom ^17.0.1

  • Check this box to trigger a request for Renovate to run again on this repository

Add emoji.json to exports

Summary

Currently svgmoji can't be used as a dependency through webpack.

Error

Module not found: Package path ./emoji.json is not exported from package /Users/alex/repos/reflect-mobile-web/node_modules/svgmoji (see exports field in /Users/alex/repos/reflect-mobile-web/node_modules/svgmoji/package.json)
null
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './emoji.json' is not defined by "exports" in /Users/alex/repos/reflect-mobile-web/node_modules/svgmoji/package.json
    at throwExportsNotFound (internal/modules/esm/resolve.js:290:9)
    at packageExportsResolve (internal/modules/esm/resolve.js:513:3)
    at resolveExports (internal/modules/cjs/loader.js:432:36)
    at Function.Module._findPath (internal/modules/cjs/loader.js:472:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
    at Function.mod._resolveFilename (/Users/alex/repos/reflect-mobile-web/node_modules/next/dist/build/webpack/require-hook.js:4:1784)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/alex/repos/reflect-mobile-web/node_modules/@team-reflect/reflect-editor/dist/extensions.js:18:38)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

Solution

Add emoji.json to exports:

package.json:

  "exports": {
    ".": {
      "import": "./dist/svgmoji.esm.js",
      "require": "./dist/svgmoji.cjs.js",
      "browser": "./dist/svgmoji.browser.esm.js",
      "types": "./dist/svgmoji.cjs.d.ts",
      "default": "./dist/svgmoji.esm.js"
    },
    "./emoji.json": "./emoji.json",
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.