flagpack-core

授权协议 MIT License
开发语言 JavaScript
所属分类 Web应用开发、 常用JavaScript包
软件类型 开源软件
地区 不详
投 递 者 束研
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Flagpack

Flagpack contains 250+ flag icons to easily use within your code project. Flagpack is an open source project and available for JavaScript frameworks/libraries React, Vue and Svelte.

Flagpack. 250+ easily implementable flag icons to use in your design or code project. Open Source. Available for Sketch, Figma, Angular, Vue, and React. www.flagpack.xyz. Made with love by Yummygum. Graphic showing a list with the flags of Argentina, Croatia, Estonia, Kenia, Netherlands, and Scotland.

View documentation on flagpack.xyz

flagpack-core

Flagpack core has been created to provide and share the flag assets used in Flagpack. It also provides some logic to help with building on top of this package. For example, it can also be used to map over the countryCodeList.json to display all flags.

Installation

Flagpack is available as a ready-to-use package through our framework packages. See the repo for more information about installing those.

Installing flagpack-core

You can setup flagpack-core by cloning the repo through git clone

$ git clone https://github.com/Yummygum/flagpack-core

Example of running a test environment

Normally if you'll use any component the core will be automatically installed as peer dependency. If you want to test the core, you'll need to install one of the components and install the core as local module.

$ git clone https://github.com/Yummygum/flagpack-core
$ cd ./flagpack-core
$ npm link

Then move into your test project and install the local dependency by using npm link

$ npm link flagpack-core

For more information on the use of installing a local package, we'd recommend checking the npm link documentation.

Use

With the release of Flagpack 2.0.0, Flagpack no longer serves all of the images in a single file. This is done to only serve the flags it requires, in other words: to preform 'treeshaking'. You'll have to import each flag separately, using the flags directory in flagpack-core. For an example to how to set this up dynamically, check out our react-flagpack package.

Flag Policy

Which flags should be included is an ongoing point of discussion within a project such as Flagpack. To provide some form of consistency, as of the 2.0 release Flagpack will be using the ISO 3166 standard as our baseline for our flag selection. In other words: Flagpack will provide flags for all ISO 3166 countries.

Exceptions

As ISO 3166 specifies countries, we ran into two exceptions to our rule. Luckily 3166 has different subsets to provide us with alpha-2 codes for these specific exceptions.

BES Islands

The Islands of Saba, Saint Eustasius and Bonaire are their own entity within the ISO standard, but don't have a shared flag. We chose to include them individually under the alpha-2 codes BQ-SA, BQ-BO and BQ-SE respectively. These codes are specified in ISO 3166-2:BQ.

Countries within The United Kingdom

To provide some clear distinction within the different countries within The United Kingdom, we've opted to included the flags of England, Scotland, Wales and Northern Ireland in Flagpack, along side the flag of the UK itself (alpha-2: GB-UKM). They use the alpha-2 codes of GB-ENG, GB-SCT, GB-WLS and GB-NIR respectively. These can be found in the ISO 3166-2:GB.

Future additions

With these changes also comes a bit of a change in suggested additions to Flagpack. If want you to suggest a flag to add to Flagpack, please keep the following things in mind:

  • Flags in Flagpack must represent a country or location.
  • Flags in Flagpack must be represented in the ISO 3166 standard or a subset thereof.

Based on interest and feasibility a suggestion for a flag could be taken into consideration. However, we offer no guarantees of which flags will be added in future versions of Flagpack.

Building

You'll need an .env file with a SPREADSHEET_KEY and API_KEY to be able to build the generateCodeList.js script to make the request to the GoogleAPI to fetch the flags data.

If you just want to make changes to the generateFlags.js, the .env is not needed, just use the current countryCodeList.json.

# install dependencies
npm install

# build for prod
npm run build

# build with watcher for dev
npm run dev

Releasing

To release a new version you'll need to make sure all changes commits are done and pushed. After that you'll need to decide which release type you want to use. The release types are; patch (0.0.1), minor (0.1.0), or major (1.0.0).

npm version <release_type>

This will update the version number in the package.json, and will add a git tag automatically. Next you'll need to push the git tag to the remote.

git push --tags origin master

After that you'll need to publish to npm.

npm publish

When you're confident with the release, make sure the version tag is also released at GitHub.

Support

Frequently Asked Questions

Documentation

Releases

You can find a changelog of Flagpack's releases on the Releases page on GitHub.

Contribute

If you're interested in contributing to this project, great! Please see the contributing document.

License

Flagpack is an open source project published under a MIT license.

 相关资料
  • 问题内容: 这是我的JSP页面的taglib指令: 我收到以下错误: 我已经在 / WEB-INF / lib 文件夹中添加了JAR文件 jstl.jar 和 standard.jar 。 谁能告诉我我在哪里犯错了? __ 问题答案: 看起来您正在使用带有1.1 / 1.2的taglib URI的JSTL 1.0。您有不同版本的JSTL: 1.0 :存在两个JAR文件和。Taglib URI 在路

  • 问题内容: 在线查看职位空缺时,我注意到某些职位需要“核心Java”知识。什么是核心Java,它与Java有何不同? 问题答案: “核心Java”是Sun的术语,用于指 Java SE,标准版 和一组相关技术,例如Java VM,CORBA等。这主要是为了区别于Java ME或Java EE。 还要注意,他们在谈论的是一组库,而不是编程语言。也就是说,无论使用什么库,编写Java的基本方式都不会改

  • 问题内容: 我目前正在将JSF-1.2应用程序迁移到Wildfly 8 Final,并被卡住了:( 首先,我已经阅读了很多有关问题的文章(例如https://community.jboss.org/message/845006或将JSF 1.2 Seam应用程序迁移到WildFly Beta 1 ),但是建议的解决方案(不包括焊接子系统)没有不为我工作。 我做了什么: 我在这里遵循了multi-j

  • 问题内容: 我在GAE中使用支撑架。我正在使用GAE 1.8和struts 2.3.15 jar文件。 在我的应用程序中,我面临这个异常 我做了很多搜索,有人说从sturts.xml文件中删除此属性值 有人说将值从true更改为false。我做到了,但是没用。请给出一个解决方案。我也更改了jar文件并使用2.1.8版本,但是在此过程中我在服务器启动时遇到了异常 我也在struts jar文件中使用

  • 问题内容: 我已经创建了自己的NER模型与斯坦福大学“斯坦福大学NER”软件,并按照这些方向。 我知道CoreNLP按照以下顺序开箱即用地加载了三个NER模型: 我现在想将我的NER模型包括在上面的列表中,并先用NER模型标记文本。 我已经找到了关于该主题的两个以前问题,它们是“使用自定义NER模型的Stanford OpenIE[”和“为什么Stanford CoreNLP NER注释器默认加载

  • 问题内容: 我刚刚在Linux中获得了一个核心转储文件 我该如何附加gdb 我需要给它命令行参数。 示例执行: 帮助我进入gdb 干杯!! 问题答案: 如果您的核心文件刚刚运行 用进行事后分析。 如果您想在没有核心的情况下使用,请考虑 否则运行,然后向发出命令。 如果您的进程仍以pid 1234的身份运行,则可以将gdb附加到正在运行的进程。 您确实应该 阅读 gdb文档 。