Skip to content

Commit

Permalink
perf: Initial Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Dulajdeshan committed Nov 5, 2024
0 parents commit 91403dc
Show file tree
Hide file tree
Showing 51 changed files with 16,158 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{package.json,*.yml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
github: [dulajdeshan]
patreon: dulajdeshan
buy_me_a_coffee: dulajdeshan
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: daily
commit-message:
prefix: fix
prefix-development: chore
include: scope
24 changes: 24 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Tests
on:
push:
branches: ['*']
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: yarn install
- name: Building package
run: yarn build
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish Package to npmjs
on:
push:
branches:
- release
jobs:
release:
name: Release and Publish
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/release' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- name: node
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Install dependencies
run: yarn install
- name: Building package
run: yarn build
- name: Install semantic-release
run: yarn global add semantic-release-cli semantic-release
- run: semantic-release --branches release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138 changes: 138 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

############################
# OS X
############################

.DS_Store
.AppleDouble
.LSOverride
Icon
.Spotlight-V100
.Trashes
._*


############################
# Linux
############################

*~


############################
# Windows
############################

Thumbs.db
ehthumbs.db
Desktop.ini
$RECYCLE.BIN/
*.cab
*.msi
*.msm
*.msp


############################
# Packages
############################

*.7z
*.csv
*.dat
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
*.com
*.class
*.dll
*.exe
*.o
*.seed
*.so
*.swo
*.swp
*.swn
*.swm
*.out
*.pid


############################
# Logs and databases
############################

.tmp
*.log
*.sql
*.sqlite
*.sqlite3


############################
# Misc.
############################

*#
ssl
.idea
nbproject
.tsbuildinfo
.eslintcache
.env


############################
# Strapi
############################

public/uploads/*
!public/uploads/.gitkeep


############################
# Build
############################

dist
build


############################
# Node.js
############################

lib-cov
lcov.info
pids
logs
results
node_modules
.node_history


############################
# Package managers
############################

.yarn/*
!.yarn/cache
!.yarn/unplugged
!.yarn/patches
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.pnp.*
yarn-error.log


############################
# Tests
############################

coverage
5 changes: 5 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/docs/
*.iml
*ignore
__tests__
.github
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.12.0
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
coverage
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"endOfLine": "lf",
"tabWidth": 2,
"printWidth": 100,
"singleQuote": true,
"trailingComma": "es5"
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Dulaj Deshan Ariyaratne

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<p align="center">
<img src="./docs/screenshots/strapi-country-select.png" alt="Bootstrap Icons" width="100">
</p>

<h1 align="center">
Strapi Country Select
</h1>

<p align="center">Custom Field plugin for Strapi to select countries in `ISO 3166-1 alpha-2` format</p>

<p align="center">
<a href="https://www.npmjs.com/package/strapi-country-select">
<img src="https://img.shields.io/npm/v/strapi-country-select" alt="Version">
<img src="https://img.shields.io/npm/l/sstrapi-country-select" alt="License">
</a>
</p>

The Strapi Country Select Plugin is a custom plugin for Strapi that allows you to to select countries in `ISO 3166-1 alpha-2` format.

## ⚙️ Installation

To install the Strapi Advanced UUID Plugin, simply run one of the following command:

```
npm install strapi-country-select
```

```
yarn add strapi-country-select
```

## ⚡️ Usage

### How to Setup Country Select Field

After installation you will find the `Country Select` at the custom fields section of the content-type builder.

![strapi country select](./docs/screenshots/screenshot-1.png)

Now You can create new records via the Admin panel, API or GraphQL.

![strapi country select](./docs/screenshots/screenshot-2.png)

## 👍 Contribute

If you want to say **Thank You** and/or support the active development of `Strapi Country Select`:

1. Add a [GitHub Star](https://github.com/Dulajdeshan/strapi-country-select/stargazers) to the project.
2. Support the project by donating a [cup of coffee](https://buymeacoff.ee/dulajdeshan).

## 🧾 License

This plugin is licensed under the MIT License. See the [LICENSE](./LICENSE.md) file for more information.
Empty file added admin/custom.d.ts
Empty file.
16 changes: 16 additions & 0 deletions admin/src/components/CountryIcon/CountryIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import getUnicodeFlagIcon from "country-flag-icons/unicode";

import { Typography } from "@strapi/design-system";
import { Globe } from "@strapi/icons";

type TProps = {
code: string;
};

export default function CountryIcon({ code }: TProps) {
if (!Boolean(code)) return <Globe />

const icon = getUnicodeFlagIcon(code);

return <Typography>{icon}</Typography>;
}
3 changes: 3 additions & 0 deletions admin/src/components/CountryIcon/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import CountryIcon from "./CountryIcon";

export { CountryIcon };
19 changes: 19 additions & 0 deletions admin/src/components/Initializer/Initializer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { useEffect, useRef } from "react";

import { PLUGIN_ID } from "../../pluginId";

type InitializerProps = {
setPlugin: (id: string) => void;
};

const Initializer = ({ setPlugin }: InitializerProps) => {
const ref = useRef(setPlugin);

useEffect(() => {
ref.current(PLUGIN_ID);
}, []);

return null;
};

export default Initializer;
3 changes: 3 additions & 0 deletions admin/src/components/Initializer/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Initializer from "./Initializer";

export { Initializer };
Loading

0 comments on commit 91403dc

Please sign in to comment.