Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add browser support #132

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/publish-to-github-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: publish demo

on:
push:
branches: [ main, add-browser ]
workflow_dispatch:
inputs:
reason:
description: 'The reason for running the workflow'
required: true
default: 'Manual run'

permissions:
contents: write

jobs:
deploy-to-github-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: 'Print manual run reason'
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo 'Reason: ${{ github.event.inputs.reason }}'
- name: Setup .NET SDK
uses: actions/setup-dotnet@main
with:
dotnet-version: 8.0.x
- name: Publish .NET Project
run: dotnet publish browse/src/client/Fluent.Emoji/Fluent.Emoji.csproj -c Release -o release

# Changes the base-tag in index.html from '/' to '/fluentui-emoji' to match GitHub Pages repository subdirectory
- name: Change base-tag in index.html from / to /fluentui-emoji
run: sed -i 's/<base href="\/" \/>/<base href="\/fluentui-emoji\/" \/>/g' release/wwwroot/index.html

# Copy index.html to 404.html to serve the same file when a file is not found
- name: copy index.html to 404.html
run: cp release/wwwroot/index.html release/wwwroot/404.html

# Add .nojekyll file to tell GitHub pages to not treat this as a Jekyll project.
# Allow files and folders starting with an underscore
- name: Add .nojekyll file
run: touch release/wwwroot/.nojekyll

- name: Commit wwwroot to GitHub Pages
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: release/wwwroot
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,6 @@ __pycache__
# project
svgs/
build/

# Visual Studio 2015/2017 cache/options directory
.vs/
11 changes: 0 additions & 11 deletions assets/Boy/Default/High Contrast/boy_high contrast_default.svg

This file was deleted.

2 changes: 1 addition & 1 deletion assets/Information/metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"cldr": "information",
"fromVersion": "️0.6",
"fromVersion": "0.6",
"glyph": "ℹ️",
"glyphAsUtfInEmoticons": [
"2139_informationsource"
Expand Down
86 changes: 86 additions & 0 deletions browse/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
###############################
# Core EditorConfig Options #
###############################
root = true

# All files
[*]
indent_style = space
indent_size = 2
tab_width = 2
file_header_template = Copyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the MIT License.

# Code files
[*.cs]
indent_size = 4
tab_width = 4
trim_trailing_whitespace = true

###############################
# .NET Coding Conventions #
###############################
[*.cs]
# Organize usings
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = true

# namespace style
csharp_style_namespace_declarations=file_scoped:suggestion

# this. preferences
dotnet_style_qualification_for_field = false:error
dotnet_style_qualification_for_property = false:error
dotnet_style_qualification_for_method = false:error
dotnet_style_qualification_for_event = false:error

# New line preferences
csharp_new_line_before_open_brace = all

# Indentation preferences
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left

# Space preferences
csharp_space_after_keywords_in_control_flow_statements = true

# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:error
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:error
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:error
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:error

# Expression-level preferences
dotnet_style_prefer_auto_properties = true:error
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error

# CSharp code style settings:
csharp_style_var_for_built_in_types = true:error
csharp_style_var_when_type_is_apparent = true:error
csharp_style_var_elsewhere = true:error

# Patern matching
csharp_style_pattern_matching_over_is_with_cast_check = true:error
csharp_style_pattern_matching_over_as_with_null_check = true:error

## Naming Conventions
# Async methods should have [Async] suffix
[*.cs]
dotnet_naming_rule.async_method_must_end_with_async.symbols = async_methods
dotnet_naming_symbols.async_methods.applicable_kinds = method
dotnet_naming_symbols.async_methods.applicable_accessibilities = *
dotnet_naming_symbols.async_methods.required_modifiers= async

dotnet_naming_rule.async_method_must_end_with_async.style = async_suffix
dotnet_naming_style.async_suffix.required_suffix = Async

dotnet_naming_rule.async_method_must_end_with_async.severity = error

# const fields use pascal casing
dotnet_naming_rule.const_fields_use_pascal_casing.symbols = const_fields
dotnet_naming_symbols.const_fields.applicable_kinds = field
dotnet_naming_symbols.const_fields.applicable_accessibilities = *
dotnet_naming_symbols.const_fields.required_modifiers = const

dotnet_naming_rule.const_fields_use_pascal_casing.severity = error
Loading