Skip to content

Commit

Permalink
Merge pull request #38 from pheasantframework/development
Browse files Browse the repository at this point in the history
Move development into main
  • Loading branch information
pheasant-framework authored May 13, 2024
2 parents 85466bb + 11d54af commit fe72670
Show file tree
Hide file tree
Showing 160 changed files with 2,038 additions and 146 deletions.
8 changes: 8 additions & 0 deletions PACKAGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
| Package | Description | Version |
|---|---|---|
| [pheasant](pheasant/) | The Pheasant Framework is a progressive, fast-reload, modern frontend web framework that allows you to make powerful web applications in Dart. | [![pub package](https://img.shields.io/pub/v/pheasant.svg)](https://pub.dev/packages/pheasant) |
| [pheasant_assets](pheasant_assets/) | Package for rendering styles and other external assets from the Pheasant Framework for Component Files. | [![pub package](https://img.shields.io/pub/v/pheasant_assets.svg)](https://pub.dev/packages/pheasant_assets) |
| [pheasant_build](pheasant_build/) | The build package for all pheasant related compilation, as well as pheasant project configuration. | [![pub package](https://img.shields.io/pub/v/pheasant_build.svg)](https://pub.dev/packages/pheasant_build) |
| [pheasant_cli](pheasant_cli/) | The official cli for running, creating and working with Pheasant projects and applications. | [![pub package](https://img.shields.io/pub/v/pheasant_cli.svg)](https://pub.dev/packages/pheasant_cli) |
| [pheasant_meta](pheasant_meta/) | Metadata to use in The Pheasant Framework. This also enlists base objects such as exceptions, errors and more for use in sibling packages. | [![pub package](https://img.shields.io/pub/v/pheasant_meta.svg)](https://pub.dev/packages/pheasant_meta) |
| [pheasant_temp](pheasant_temp/) | The Pheasant Framework Templating Engine to Create Renderable Dart Code for Pheasant Code. | [![pub package](https://img.shields.io/pub/v/pheasant_temp.svg)](https://pub.dev/packages/pheasant_temp) |
4 changes: 2 additions & 2 deletions pheasant/lib/build.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.
// https://mit-license.org

Expand Down
4 changes: 2 additions & 2 deletions pheasant/lib/custom.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.
// https://mit-license.org

Expand Down
4 changes: 2 additions & 2 deletions pheasant/lib/pheasant.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.
// https://mit-license.org

Expand Down
4 changes: 2 additions & 2 deletions pheasant/lib/router.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.
// https://mit-license.org

Expand Down
4 changes: 2 additions & 2 deletions pheasant/test/pheasant_test.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.
// https://mit-license.org

Expand Down
4 changes: 4 additions & 0 deletions pheasant_assets/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.0-tested
- Incorporated Tests


## 0.1.0-beta
- Added `sassEnabled` parameter to functions to allow configs from sibling packages

Expand Down
10 changes: 10 additions & 0 deletions pheasant_assets/example/lib/css.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.
// https://mit-license.org


import 'package:pheasant_assets/pheasant_assets.dart';

void main() {
Expand Down
10 changes: 10 additions & 0 deletions pheasant_assets/example/lib/scss.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.
// https://mit-license.org


// ignore: unused_import
import 'package:pheasant_assets/pheasant_assets.dart';

Expand Down
9 changes: 9 additions & 0 deletions pheasant_assets/lib/pheasant_assets.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.


/// The major and general library containing all functionality to parse, scope and process css/sass in a Pheasant Component
///
/// This library helps with the parsing, analyzing, rendering and scoping of styles located in the `styles` part of a pheasant file.
Expand Down
9 changes: 9 additions & 0 deletions pheasant_assets/lib/pheasant_build.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.


/// Minified version of the general `pheasant_assets` library for use during build.
///
/// This library is usually used in the `pheasant_build` package, but you can use it for simple and quick encapsulation of asset processing code.
Expand Down
9 changes: 9 additions & 0 deletions pheasant_assets/lib/src/assets.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.


import 'css/id_scope.dart';

/// A basic enum to denote scope levels in a pheasant style component.
Expand Down
12 changes: 11 additions & 1 deletion pheasant_assets/lib/src/compile/compile.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.


import 'dart:io' show Directory;

import 'package:csslib/parser.dart' as css show Message, compile;
Expand Down Expand Up @@ -46,9 +55,10 @@ String compileCss(PheasantStyle pheasantStyle, String cssString,
return cssString;
}
} else {
if (!sassEnabled)
if (!sassEnabled) {
throw PheasantStyleException(
'Sass is not enabled on this project. Set sass to true in your pheasant.yaml or pheasant.json file in your project to use sass');
}
try {
final cssData = sass.compileStringToResult(cssString,
syntax: pheasantStyle.syntax == 'scss'
Expand Down
19 changes: 19 additions & 0 deletions pheasant_assets/lib/src/compile/parse.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.


import '../assets.dart' hide PheasantStyleScoped;
import '../exceptions/exceptions.dart';

/// Code to extract a [PheasantStyle] from a `style` component in a pheasant file.
///
Expand All @@ -15,6 +25,15 @@ PheasantStyle getStyleInput(String style, {bool sassEnabled = true}) {
r'(?:(local|global))?' // Optional local attribute
r'>', // Match the closing angle bracket '>'
);
if (!style.contains(regex)) {
throw PheasantStyleException(
"There seems to be an error in the source parsed. There's no <style> opening tag");
}
if (!style.contains("</style>")) {
throw PheasantStyleException(
"There seems to be an error in the source parsed. There's no <style> closing tag");
}

Match mainMatch = regex.allMatches(style).first;
String data =
style.replaceFirst(regex, '').replaceFirst('</style>', '').trim();
Expand Down
9 changes: 9 additions & 0 deletions pheasant_assets/lib/src/compile/scope.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.


import '../exceptions/exceptions.dart';

import '../css/extract.dart';
Expand Down
9 changes: 9 additions & 0 deletions pheasant_assets/lib/src/constants/syntax.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.


/// List of valid css syntaxes to use. Can be modified in the case that Pheasant is running on npm.
List<String> syntax = ['css', 'sass', 'scss'];
9 changes: 9 additions & 0 deletions pheasant_assets/lib/src/css/extract.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.


import '../assets.dart' show PheasantStyle;
import '../compile/compile.dart';
import '../exceptions/exceptions.dart';
Expand Down
9 changes: 9 additions & 0 deletions pheasant_assets/lib/src/css/id_scope.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.


import '../assets.dart' hide StyleScope;

/// Small function to help in the creation of ids used to identify and scope component styles in a pheasant component.
Expand Down
9 changes: 9 additions & 0 deletions pheasant_assets/lib/src/exceptions/errors.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.


import 'package:pheasant_meta/pheasant_meta.dart' show PheasantError;

/// Pheasant Style Implementation of [PheasantError]
Expand Down
9 changes: 9 additions & 0 deletions pheasant_assets/lib/src/exceptions/exceptions.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.


import 'package:pheasant_meta/pheasant_meta.dart' show PheasantException;

/// Pheasant Style Implementation of [PheasantException] for use in this package
Expand Down
9 changes: 9 additions & 0 deletions pheasant_assets/lib/src/sass/logger.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
// Copyright (c) 2024 The Pheasant Group. All Rights Reserved.
// Please see the AUTHORS files for more information.
// Intellectual property of third-party.
//
// This file, as well as use of the code in it, is governed by an MIT License
// that can be found in the LICENSE file.
// You may use this file only in accordance with the license.


import 'package:sass/sass.dart' as sass show Logger;

/// Generic logger
Expand Down
10 changes: 9 additions & 1 deletion pheasant_assets/mono_pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,12 @@ stages:
- analyze
- format
- unit_test:
- test
- test
- cron:
- test:
os:
- linux
- windows
=======
- test
>>>>>>> main
10 changes: 10 additions & 0 deletions pheasant_assets/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
name: pheasant_assets
description: >-
Package for rendering styles and other external assets from the Pheasant Framework for Component Files.
version: 0.1.0-tested
repository: https://github.com/pheasantframework/pheasant/tree/main/pheasant_assets

environment:
sdk: '>=3.0.0 <4.0.0'
=======
version: 0.1.0-beta
repository: https://github.com/pheasantframework/pheasant_assets

environment:
sdk: ^3.2.3
>>>>>>> main

# Add regular dependencies here.
dependencies:
Expand All @@ -15,6 +22,9 @@ dependencies:
path: ^1.8.0

dev_dependencies:
lints: ^3.0.0
=======
lints: ^2.1.0
>>>>>>> main
test: ^1.24.0

Loading

0 comments on commit fe72670

Please sign in to comment.