Skip to content

Commit

Permalink
Merge pull request #25 from ulkajs/rewrite
Browse files Browse the repository at this point in the history
0.5.0
  • Loading branch information
coderosh-zz authored Sep 23, 2020
2 parents 8171640 + 6670c66 commit 9f486a8
Show file tree
Hide file tree
Showing 82 changed files with 1,749 additions and 1,664 deletions.
46 changes: 23 additions & 23 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"env": {
"browser": true,
"commonjs": true,
"es2020": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 11
},
"plugins": ["@typescript-eslint", "prettier"],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/ban-ts-comment": "off"
}
"env": {
"browser": true,
"commonjs": true,
"es2021": true,
"jest": true
},
"extends": [
"google",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12
},
"plugins": [
"@typescript-eslint",
"prettier"
],
"rules": {
"require-jsdoc":"off",
"valid-jsdoc": "off"
}
}
12 changes: 11 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# Describe
## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] I have read the **CONTRIBUTING** document.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] I need help writing tests.
- [ ] All new and existing tests passed.
3 changes: 3 additions & 0 deletions @types/better-opn.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare module "better-opn" {
export default (url: string) => any
}
118 changes: 118 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Changelog

## v0.5.0

- Added class for source.
- UlkaSource
- MdSource
- Removed `$importUlka`
- Added new function `$import`
- Returns base64 from images.
- Returns parsed html from ulka and markdown
- [name].ulka.[ext] files are ignored and aren't copied to build directory.
- Complete build on file change (live-server)
- Plugins can modify the arguements provided.
- pagesPath is made optional.
- Jest codecoverage setup and added more tests.
- Refactored code.

## v0.4.2

- Removed remarkable from project. Now ulka uses unifiedjs ecosystem to parse markdown to html.
- Refactored code.
- Support for remark and rehype plugins.

## v0.4.1

- Made plugin more flexible. Plugins now accepts
- string (package name)
- function
- Object with key of resolve and options.
- Build speed increased
- Added mimeTypes for `xml`
- Migrated to typescript
- Upgraded ulka-parser

## v0.4.0

- Implemented plugin system.
- Preparse, postParse, parseFrontMatter supoprt removed.
- Contents folder now accepts both object and array
- Refactored code.

## v0.3.9

- Option to provide default port
- Create command to generate ulka project (deprecated `npx create-ulka-app`)
```
npx ulka create project_name
```
- Content files data made available to templates.

## v0.3.8

- Open browser on serving.
- Better logs.

## v0.3.7

- Whole project isn't built when static files changes.
- Error logging improved

## v0.3.6

- Set default base for ulka-parser to cwd.
- Better logs.

## v0.3.3 - v0.3.5

- Generate available port to serve files if asked is already in use
- Update ulka-parse (promises support)
- Relative path supported (Removed absolute path support) in `$importUlka`, `$assets` and in `url` (css).

## v0.2.7 - v0.3.2

- `url(path)` in css transformed to the path in `__assets__` folder.
- Change `.ucss` to `.css`
- Write `ulka` syntax inside `.ucss` file
- Fix `link` value in `contentFiles`

## v0.2.3 - v0.2.6

- Don't reload whole browser for css change. Reload css only.
- Use buildPath from configs intead of static path
- Use `fs.promises` instead of `fs/promises`
- Serving before building fixed.

## v0.2.2

- Server created from scratch to serve build files
- Live reload on change

## v0.2.1

- Import ulka from another file using `$importUlka`
- List of contents generated available in pages `.ulka` files.

## v0.2.0

- Image support in markdown
- Ulka syntax support in markdown

## v0.1.1

- import assets from ulka files

```html
<link rel="stylesheet" href="{% assets('/src/.../style.css') %}" />
```

- Assets are placed in one folder `__assets__` and name is generated using crypto module.

## v0.1.0

### First release

```
npx ulka build
```
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
84 changes: 84 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Contributing to Ulka

Ulka is an open source project, and contributions of any kind are welcome and appreciated. We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:

- Reporting a issue
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer

Please note we have a code of conduct, please follow it in all your interactions with the project.

## Issues

If you encounter a bug, please file a bug report. If you have a feature to request, please open a feature request. If you would like to work on an issue or feature, there is no need to request permission. Please add tests to any new features.

## Pull Requests

In order to create a pull request for `ulka`, follow the GitHub instructions for [Creating a pull request from a fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork). Please link your pull request to an existing issue.

## Folder Structure

Description of the project files and directories.

```
📦ulka
┣ 📂@types
┃ ┗ 📜better-opn.d.ts
┣ 📂src
┃ ┣ 📂bin
┃ ┃ ┣ 📜build.ts
┃ ┃ ┣ 📜index.ts
┃ ┃ ┗ 📜serve.ts
┃ ┣ 📂data
┃ ┃ ┣ 📜configs.ts
┃ ┃ ┣ 📜mime-types.ts
┃ ┃ ┗ 📜plugins.ts
┃ ┣ 📂fs
┃ ┃ ┣ 📜all-files.ts
┃ ┃ ┣ 📜copy-assets.ts
┃ ┃ ┣ 📜index.ts
┃ ┃ ┣ 📜mkdir.ts
┃ ┃ ┗ 📜rmdir.ts
┃ ┣ 📂generate
┃ ┃ ┗ 📜index.ts
┃ ┣ 📂source
┃ ┃ ┣ 📜index.ts
┃ ┃ ┣ 📜md-source.ts
┃ ┃ ┗ 📜ulka-source.ts
┃ ┣ 📂utils
┃ ┃ ┣ 📂cli-utils
┃ ┃ ┃ ┣ 📜create-project.ts
┃ ┃ ┃ ┣ 📜create-server.ts
┃ ┃ ┃ ┗ 📜line-print.ts
┃ ┃ ┣ 📂ulka-source-utils
┃ ┃ ┃ ┣ 📜$assets.ts
┃ ┃ ┃ ┗ 📜$import.ts
┃ ┃ ┣ 📜absolute-path.ts
┃ ┃ ┣ 📜generate-file-name.ts
┃ ┃ ┗ 📜unified-processor.ts
┃ ┣ 📜globalInfo.ts
┃ ┗ 📜index.ts
┣ 📂tests
┃ ┗ (...tests)
┣ 📜.eslintignore
┣ 📜.eslintrc.json
┣ 📜.gitignore
┣ 📜.npmignore
┣ 📜.prettierignore
┣ 📜.prettierrc
┣ 📜CHANGELOG.md
┣ 📜CONTRIBUTING.md
┣ 📜CODE_OF_CONDUCT.md
┣ 📜LICENSE
┣ 📜README.md
┣ 📜jest.config.js
┣ 📜package-lock.json
┣ 📜package.json
┗ 📜tsconfig.json
```

## License

By contributing, you agree that your contributions will be licensed under its [MIT License](./LICENSE).
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<a href="https://www.npmjs.com/package/ulka">
<img alt="NPM" src="https://img.shields.io/npm/v/ulka?&labelColor=black&color=darkred&logo=npm&label=npm" />
</a>&nbsp;<a href="https://github.com/acharyaroshanji/ulka"><img alt="MIT" src="https://img.shields.io/npm/l/ulka?color=darkgreen&labelColor=black&&logo=github" /></a>&nbsp;
<a href="#"><img alt="CI" src="https://github.com/ulkajs/ulka/workflows/CI/badge.svg"></a>&nbsp;<a href="https://twitter.com/acharyaroshanji"><img alt="TWITTER" src="https://img.shields.io/twitter/follow/acharyaroshanji?label=Follow&logo=twitter&labelColor=black&color=darkblue" /></a>&nbsp;
</p>

<p align="center">
Expand Down
9 changes: 9 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
module.exports = {
collectCoverage: true,
coverageThreshold: {
global: {
functions: 90,
lines: 80,
statements: 80,
branches: 50
}
},
transform: {
"^.+\\.tsx?$": "ts-jest"
}
Expand Down
Loading

0 comments on commit 9f486a8

Please sign in to comment.