Skip to content

Commit

Permalink
Merge pull request #28 from pheasantframework/submodule-removal
Browse files Browse the repository at this point in the history
Submodule removal
  • Loading branch information
pheasant-framework authored Apr 29, 2024
2 parents 390294f + 3dfe4ab commit 85466bb
Show file tree
Hide file tree
Showing 147 changed files with 6,327 additions and 148 deletions.
400 changes: 272 additions & 128 deletions .github/workflows/dart.yml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ pubspec.lock
doc_files.sh
**/pubspec.lock

private/
.env
private/
internal/
12 changes: 0 additions & 12 deletions .gitmodules

This file was deleted.

3 changes: 0 additions & 3 deletions pheasant/mono_pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@ sdk:
- pubspec

stages:
- analyze:
- analyze
- format
- unit_test:
- test
1 change: 0 additions & 1 deletion pheasant_assets
Submodule pheasant_assets deleted from cb5230
70 changes: 70 additions & 0 deletions pheasant_assets/.github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Dart

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug

jobs:
log-the-inputs:
runs-on: ubuntu-latest
steps:
- run: |
echo "Log level: $LEVEL"
env:
LEVEL: ${{ inputs.logLevel }}
build:
runs-on: ubuntu-latest

steps:
- name: First interaction
uses: actions/[email protected]
with:
# Token for the repository. Can be passed in using {{ secrets.GITHUB_TOKEN }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Comment to post on an individual's first issue
issue-message: Welcome to the Pheasant Metadata Package. This is ${{ github.actor }}'s first issue.
# Comment to post on an individual's first pull request
pr-message: Welcome to the Pheasant Metadata Package. This is ${{ github.actor }}'s first pull request.

- uses: actions/checkout@v3

# Note: This workflow uses the latest stable version of the Dart SDK.
# You can specify other versions if desired, see documentation here:
# https://github.com/dart-lang/setup-dart/blob/main/README.md
# - uses: dart-lang/setup-dart@v1
- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603

- name: Install dependencies
run: dart pub get

# Uncomment this step to verify the use of 'dart format' on each commit.
- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .

# Consider passing '--fatal-infos' for slightly stricter analysis.
- name: Analyze project source
run: dart analyze

# Your project will need to have tests in test/ and a dependency on
# package:test for this step to succeed. Note that Flutter projects will
# want to change this to 'flutter test'.
# - name: Run tests
# run: dart test
14 changes: 14 additions & 0 deletions pheasant_assets/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/

# Avoid committing pubspec.lock for library packages; see
# https://dart.dev/guides/libraries/private-files#pubspeclock.
pubspec.lock

# Mac
.DS_Store

# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/
16 changes: 16 additions & 0 deletions pheasant_assets/.pubignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# https://dart.dev/guides/libraries/private-files
# Created by `dart pub`
.dart_tool/

# Avoid committing pubspec.lock for library packages; see
# https://dart.dev/guides/libraries/private-files#pubspeclock.
pubspec.lock

# Mac
.DS_Store

# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/

pubspec_overrides.yaml
5 changes: 5 additions & 0 deletions pheasant_assets/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 0.1.0-beta
- Added `sassEnabled` parameter to functions to allow configs from sibling packages

## 0.1.0-alpha
- Initial version.
44 changes: 44 additions & 0 deletions pheasant_assets/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Code of Conduct

## Overview

As contributors and maintainers of The Pheasant Framework Metadata Package project, we pledge to create a respectful and inclusive environment for everyone involved. We value the participation of each member and want to ensure a positive experience for all.

## Expected Behavior

All contributors are expected to exhibit the following behaviors:

- Be respectful and considerate towards others.
- Avoid any form of harassment, discrimination, or offensive language.
- Be open to constructive criticism and willing to learn from others.
- Focus on the technical aspects of discussions and contributions.

## Unacceptable Behavior

The following behaviors are considered unacceptable and will not be tolerated:

- Harassment, discrimination, or any form of offensive behavior.
- Intimidation or unwelcome attention.
- Any form of trolling, insulting, or derogatory comments.
- Advocating for or encouraging any of the above behaviors.

## Reporting Violations

If you witness or experience any behavior that violates this code of conduct, please report it to the project maintainers at [maintainer's email]. All reports will be kept confidential.

## Enforcement

Violations of the code of conduct may result in appropriate actions, including but not limited to:

- Warning the individual responsible for the violation.
- Temporary or permanent exclusion from the project.

Project maintainers have the right and responsibility to remove, edit, or reject comments, code, issues, and other contributions that do not align with this code of conduct.

## Attribution

This code of conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

For any questions or clarifications regarding this code of conduct, please contact [this email]([email protected]).

Thank you for your cooperation and commitment to fostering a positive and inclusive community for The Pheasant Framework Metadata Package.
65 changes: 65 additions & 0 deletions pheasant_assets/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Contributing to Pheasant Assets Package

Thank you for considering contributing to The Pheasant Framework Assets Package! We welcome contributions from the community to improve and enhance this Dart package.

Before you get started, please take a moment to review our contribution guidelines to ensure a smooth collaboration process.

## Code of Conduct

This project and everyone participating in it are governed by our [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you agree to uphold this code. Please report any unacceptable behavior to [this email]([email protected]).

## How to Contribute

We welcome contributions in the form of bug reports, feature requests, code improvements, and documentation enhancements. To contribute, follow these steps:

1. Fork the repository to your GitHub account.
2. Clone the forked repository to your local machine.
```bash
git clone https://github.com/pheasantframework/pheasant_assets.git
```
3. Create a new branch for your changes.
```bash
git checkout -b feature/your-feature
```
4. Make your changes and commit them with a clear and concise commit message.
```bash
git commit -am 'Add a new feature'
```
5. Push your changes to your fork on GitHub.
```bash
git push origin feature/your-feature
```
6. Open a pull request (PR) against the `main` branch of the original repository.

## Code Guidelines

Please follow these guidelines when contributing to the project:

- Adhere to the Dart [style guide](https://dart.dev/guides/language/effective-dart/style).
- Write clear and concise code with comments where necessary.
- Ensure that your code passes all existing tests.
- Write new tests for new features or bug fixes.

## Bug Reports

If you encounter a bug, please submit an issue on the [issue tracker](https://github.com/pheasantframework/pheasant_assets/issues) with the following information:

- A clear and descriptive title.
- A detailed description of the issue, including steps to reproduce.
- The version of the package you are using.
- Any relevant error messages or logs.
- Any suggested solutions (if any).

## Feature Requests

We welcome suggestions for new features, improvements and optimizations. Please submit a feature request on the [issue tracker](https://github.com/pheasantframework/pheasant_assets/issues) with the following information:

- A clear and descriptive title.
- A detailed description of the proposed feature.
- Any additional context or examples that may be helpful.

## License

By contributing to this project, you agree that your contributions will be licensed under the [MIT License](LICENSE).

Thank you for contributing to The Pheasant Framework Assets Package! Your efforts are greatly appreciated.
21 changes: 21 additions & 0 deletions pheasant_assets/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [2023] [The Pheasant Group]

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.
49 changes: 49 additions & 0 deletions pheasant_assets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# <center>The Pheasant Framework Assets Engine</center>

![Pub Version](https://img.shields.io/pub/v/pheasant_assets?labelColor=rgb(245%2C%20193%2C%2066)&link=https%3A%2F%2Fpub.dev%2Fpackages%2Fpheasant_assets) ![Pub Publisher](https://img.shields.io/pub/publisher/pheasant_assets?labelColor=rgb(245%2C%20193%2C%2066)&link=https%3A%2F%2Fpub.dev%2Fpackages%2Fpheasant_assets)


This is the Pheasant Framework Asset Engine, used to render and process styles and assets. The Pheasant Framework has inbuilt support for css styles through the `styles` component of the pheasant file, as well as support for `sass` and `scss`.

This package deals with the parsing, processing and scoping of these styles defined or imported in the `styles` component of pheasant files.

This package is not intended for direct use by the end-user, but just as a supporting dependency for the Pheasant Framework and its sibling packages - [pheasant_temp](https://github.com/pheasantframework/pheasant_temp) and [pheasant_build](https://github.com/pheasantframework/pheasant_build).

### Some things to note

This package is constantly under development. If you have any issues with this package, or any packages in the Pheasant Framework, please feel free to raise an issue, and we will work on it in due time. Don't forget to [follow the guidelines](./CODE_OF_CONDUCT.md), though.

If you have any contributions to make, feel free, just [follow the contribution guidelines](./CONTRIBUTING.md), and make your contributions as guided. All contributions concerning this package are welcome and are reviewed in order to constantly give performant features.

## Features

There are four main functions exposed by this package, and they represent the three steps denoted in the Pheasant Asset Rendering Process: **parse - compile - scope**.

## Getting started

Note that this package is not intended for direct use by the end user.

In order to get started with this package, you can simply add it as a dev dependency to your project:
```bash
dart pub add dev:pheasant_assets
```

Then you can import it into your project.
There are two libraries: **pheasant_assets** (`package:pheasant_assets/pheasant_assets.dart`), which contains all functionality needed to get the most out of the package, and **pheasant_assets_build** (`package:pheasant_assets/pheasant_build.dart`) which is much smaller, and was originally designed as a safe api for the `pheasant_build` package, and should be used for more web-inclined environment cases.

## Usage

### Parse
In order to parse the css, the package makes use of the `getStyleInput` to parse the stlyesheet, as well as the style configuration declared in the `<style>` tags.

### Compile
The css styles are compiled and alayzed through various functions. All sass/scss stylesheets are compiled to raw css. All file paths are resolved, and the compiler compiles the data located in the files.

### Scope
In order to ensure certain styles do not leak into other components (they are locally scoped to the component by which it is defined to), the engine takes a second step to scope and recompile the css. The `scopeComponets` function takes care of this.

For more info on how these work, check out the API Documentation.

## Additional information

This package uses [the same license](./LICENSE) as the Pheasant Framework.
30 changes: 30 additions & 0 deletions pheasant_assets/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

include: package:lints/recommended.yaml

# Uncomment the following section to specify additional rules.

# linter:
# rules:
# - camel_case_types

# analyzer:
# exclude:
# - path/to/excluded/files/**

# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints

# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options
3 changes: 3 additions & 0 deletions pheasant_assets/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Example

The Examples are located in the `lib` directory of this directory. It consist of two examples: one to represent css compilation - [css.dart](lib/css.dart), and another to represent scss compilation - [scss.dart](lib/scss.dart).
8 changes: 8 additions & 0 deletions pheasant_assets/example/lib/css.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import 'package:pheasant_assets/pheasant_assets.dart';

void main() {
PheasantStyle myStyle = getStyleInput('<style src="styles.css"></style>');
PheasantStyleScoped scopedStyle = scopeComponents(myStyle, isDev: true);
print("CSS Data: ${scopedStyle.css}");
print("CSS Scoping ID: ${scopedStyle.id}");
}
8 changes: 8 additions & 0 deletions pheasant_assets/example/lib/pae_css.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import 'package:pheasant_assets/pheasant_assets.dart';

void main() {
PheasantStyle myStyle = getStyleInput('<style src="styles.css"></style>');
PheasantStyleScoped scopedStyle = scopeComponents(myStyle, isDev: true);
print("CSS Data: ${scopedStyle.css}");
print("CSS Scoping ID: ${scopedStyle.id}");
}
Loading

0 comments on commit 85466bb

Please sign in to comment.