Skip to content

Commit

Permalink
Merge pull request #27 from ulkajs/ulka-next
Browse files Browse the repository at this point in the history
0.6.0 - ulka-next
  • Loading branch information
coderosh-zz authored Oct 17, 2020
2 parents 040186e + 4d3d85d commit 908e412
Show file tree
Hide file tree
Showing 105 changed files with 2,869 additions and 3,588 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/node_modules
/dist
/.github
39 changes: 16 additions & 23 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
{
"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"
}
"env": {
"commonjs": true,
"es2021": true,
"node": true,
"jest": true
},
"extends": ["google", "prettier"],
"plugins": ["prettier"],
"parserOptions": {
"ecmaVersion": 12
},
"rules": {
"prettier/prettier": ["error"],
"no-console": "off",
"no-undef": "error"
}
}
4 changes: 2 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
github: []
patreon: coderosh
open_collective: # Replace with a single Open Collective username
ko_fi: coderosh
ko_fi:
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
custom: ["https://www.buymeacoffee.com/coderosh"]
2 changes: 2 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
env:
FORCE_COLOR: 1
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,5 @@ dist

# TernJS port file
.tern-port

example/
5 changes: 5 additions & 0 deletions .huskyrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"hooks": {
"pre-commit": "npm run lint-staged && cross-env FORCE_COLOR=1 npm run test"
}
}
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/tests
/src
/.github
/coverage
/example
/examples
.prettierrc
.prettierignore
.eslintignore
.eslintrc.json
jest.config.js
.huskyrc.json
CODE_OF_CONDUCT.md
CONTRIBUTING.md
CHANGELOG.md
Binary file removed .package.json.un~
Binary file not shown.
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/node_modules
/dist
/.github
3 changes: 0 additions & 3 deletions @types/better-opn.d.ts

This file was deleted.

18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## v0.6.0 - v0.6.1

- Used remarkable to parser markdown.
- Build logic changed.
- collect data.
- render to html.
- generate html files.
- copy assets.
- Hash function changed to use sha1.
- Async support removed.
- Build speed increased.
- Plugins logic changed.
- Commands changed.
- serve: serve already built files.
- develop: built, serve and watch.
- create: create new project.
- starter template verification before creating new project.

## v0.5.3

- ulka-parser -> 0.3.1
Expand Down
74 changes: 19 additions & 55 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,62 +22,26 @@ In order to create a pull request for `ulka`, follow the GitHub instructions for

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
```
┣ 📂bin
┃ ┗ 📜server.js
┣ 📂src
┃ ┣ 📂server
┃ ┃ ┣ 📜index.js
┃ ┃ ┗ 📜server.js
┃ ┣ 📂ulka-cli
┃ ┃ ┣ 📜build.js
┃ ┃ ┣ 📜create.js
┃ ┃ ┗ 📜serve.js
┃ ┣ 📂utils
┃ ┃ ┣ 📜build-utils.js
┃ ┃ ┣ 📜helpers.js
┃ ┃ ┣ 📜ulka-fs.js
┃ ┃ ┗ 📜ulka-log.js
┃ ┗ 📜index.js
┣ 📂tests
┃ ┣ 📂e2e
┃ ┗ 📂unit

## License

Expand Down
48 changes: 34 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,52 @@
<p align="center">
<img width="500" src="https://i.imgur.com/coa1q5T.png" alt="logo">
</p>

<p align="center">
<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>
A simpler static site generator written in JavaScript to transform ulka and markdown files to html.
</p>

<p align="center">
Ulka is a free and open source static site generator that helps you create static sites from markdown and ulka files.
<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="https://github.com/prettier/prettier"><img alt="Prettuer" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?color=b3095d&labelColor=black&logo=prettier"></a>&nbsp;
<a href="#"><img alt="CI" src="https://img.shields.io/github/workflow/status/ulkajs/ulka/CI?color=darkgreen&label=CI&logo=github&labelColor=black"></a>&nbsp;
<a href="https://gatsbyjs.org/contributing/how-to-contribute/"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?labelColor=black&logo=github&color=darkgreen" alt="PRs welcome!" /></a>

</p>
<br />

## 🚀 Quick start
## 🚀 Getting Started

1. Create new ulka site

```
npx ulka create <app-name>
```bash
npx ulka create <app-name> <template_url> -i npm

## OR

npm i -g ulka
ulka create <app-name> <template_url> -i npm
```

2. Navigate to app name and start server
2. Navigate to app name and start dev server
```
cd <app-name>
npm start
npm run develop
```

Complete documentation comming soon....
## 📖 Documentation

Coming soon...

## 🤗 Contributing

We welcome you to join the development of Ulka. Please see [Contributing](https://github.com/ulkajs/ulka/blob/master/CONTRIBUTING.md) Guidelines.

## LICENSE

<a href="https://github.com/nuxt/nuxt.js/blob/dev/LICENSE">MIT</a>

---

<a href="https://www.buymeacoffee.com/coderosh" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" width="200" alt="Buy Me A Coffee"></a>
60 changes: 60 additions & 0 deletions bin/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env node

const path = require("path")
const { program } = require("commander")

const build = require("../src/ulka-cli/build")
const serve = require("../src/ulka-cli/serve")
const create = require("../src/ulka-cli/create")
const { createInfo } = require("../src/utils/build-utils")

program.version(require("../package.json").version)

const cwd = process.cwd()

program
.command("build")
.description("Build html from .md and .ulka files")
.action(async () => {
const info = createInfo(cwd, "build")
await build(info)
})

program
.command("develop")
.option("-p --port [port]", "server port", 3000)
.description("Start dev server")
.action(async ({ port }) => {
const info = createInfo(cwd, "develop")
console.clear()
info.configs.buildPath = path.join(cwd, ".debug")

await build(info)

port = +port || 3000

const options = { live: true, base: info.configs.buildPath, port: +port }

serve(options, info)
})

program
.command("serve")
.option("-p --port [port]", "server port", 3000)
.description("Serve built static files")
.action(({ port }) => {
const info = createInfo(cwd, "build")

port = +port || 3000
serve({ live: false, base: info.configs.buildPath, port: +port }, info)
})

program
.command("create [projectName] [template]")
.option("-i --installer [installer]", "Installer to use npm|yarn")
.description("Create new ulka project")
.action((name, template, { installer }) => {
create({ template: template, name, installer })
})

program.parse(process.argv)
13 changes: 1 addition & 12 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
module.exports = {
collectCoverage: true,
coverageThreshold: {
global: {
functions: 90,
lines: 80,
statements: 80,
branches: 50
}
},
transform: {
"^.+\\.tsx?$": "ts-jest"
}
collectCoverage: true
}
6 changes: 6 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"typeAcquisition": {
"include": ["jest"]
},
"exclude": ["node_modules"]
}
Loading

0 comments on commit 908e412

Please sign in to comment.