Skip to content

Commit

Permalink
Merge pull request #316 from nuejs/dev
Browse files Browse the repository at this point in the history
Nue 1.0 (beta)
  • Loading branch information
tipiirai authored Aug 15, 2024
2 parents 043ce76 + 5ae4920 commit d591370
Show file tree
Hide file tree
Showing 511 changed files with 14,365 additions and 1,048 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true
charset = utf-8
end_of_line = lf
indent_size = 2
tab_width = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.lockb binary diff=lockb
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: 🐞 Bug Report
about: Create a bug report to help us improve Nue
labels: bug
---

<!-- Please search to see if an issue or discussion already exists for the bug you encountered -->

### Describe the Bug
<!-- Describe current and expected behavior -->

### Environment
<!--
Example:
- OS: Windows X / Mac Y / Linux Z
- Package Manager: bun -v / npm -v
- JS Runtime: bun -v / node -v
- Nuekit Version: nue -v (if applicable)
-->

### Minimal Reproduction
<!-- Please provide a minimal reproduction (e.g. GitHub repo, code snippets, ...) or simple steps to reproduce the bug -->

### Logs & Additional Context
<!-- Add additional information like logs or other related information -->
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: 💬 Discussions
url: https://github.com/nuejs/nue/discussions
about: Use discussions if you have an idea for improvement and asking questions
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: 💡 Feature Request or Improvement
about: Suggest an idea or improvement
labels: new feature, improvement
---

### Is your feature request or improvement related to a problem?
<!-- Describe what the problem is -->

### Solution you'd like
<!-- A clear and concise description of what you want to happen -->

### Alternatives you've considered
<!-- Alternative solutions or features you have thought of -->

### Additional context
<!-- Add any other context or screenshots about the feature request or improvement here -->
18 changes: 7 additions & 11 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: Test
on:
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:

jobs:
Expand All @@ -15,23 +13,22 @@ jobs:
env:
- { os: 'ubuntu-22.04', tool: 'bun' }
- { os: 'macos-12', tool: 'bun' }
# Windows support for bun install is not implemented yet
# - { os: 'windows-2022', tool: 'bun' }
- { os: 'windows-2022', tool: 'bun' }
# - { os: 'ubuntu-22.04', tool: 'node+jest' }
# - { os: 'macos-12', tool: 'node+jest' }
- { os: 'windows-2022', tool: 'node+jest' }
runs-on: ${{ matrix.env.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Testing `bun`
- uses: oven-sh/setup-bun@v1
- uses: oven-sh/setup-bun@v2
if: ${{ matrix.env.tool == 'bun' }}
- name: Install and test with Bun
run: |
bun -v
bun install
bun install --no-save esbuild@^0.19.11
bun install --no-save esbuild
bun test --coverage
if: ${{ matrix.env.tool == 'bun' }}

Expand All @@ -40,7 +37,6 @@ jobs:
run: |
node -v && npm -v
npm install
npm install --no-save jest jest-extended esbuild@^0.19.11
# https://jestjs.io/docs/ecmascript-modules
node --experimental-vm-modules node_modules/jest/bin/jest --runInBand --coverage
npm install --no-save jest jest-extended esbuild
npm test -- --coverage
if: ${{ matrix.env.tool == 'node+jest' }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.DS_Store
node_modules
dist
.dist
.env
.idea
.vscode
_test
_test
coverage
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Contributing to Nue

First and foremost: thank you for helping with Nue! ❤️❤️
First and foremost: Thank you for helping with Nue! ❤️❤️


### Guidelines
Expand All @@ -12,9 +12,9 @@ First and foremost: thank you for helping with Nue! ❤️❤️

3. Please create only one thing per pull request. Easier to validate and merge. And less potential for conflicts.

3. Please add a test case for every bug fix
4. Please add a test case for every bug fix.

3. Please write JavaScript. No TypeScript here, because Nue aims to work as close to web standards as possible.
5. Please write JavaScript. No TypeScript here, because Nue aims to work as close to web standards as possible.


### Formatting
Expand Down Expand Up @@ -42,7 +42,7 @@ bun test
# if using node
npm install
npm install --no-save jest jest-extended esbuild
node --experimental-vm-modules node_modules/jest/bin/jest --runInBand
npm test
```


Expand Down
Binary file modified bun.lockb
Binary file not shown.
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
{
"name": "nue",
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"private": true,
"workspaces": [
"packages/*"
],
"engines": {
"bun": ">=1",
"node": ">=18"
},
"scripts": {
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --runInBand"
},
"jest": {
"setupFilesAfterEnv": ["jest-extended/all"]
"setupFilesAfterEnv": [
"jest-extended/all",
"<rootDir>/setup-jest.js"
]
}
}
2 changes: 2 additions & 0 deletions packages/examples/simple-blog/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.zip
*.gz
23 changes: 23 additions & 0 deletions packages/examples/simple-blog/@global/colors.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
:root {

/* slate gray */
--gray-100: #f3f4f6;
--gray-200: #e5e7eb;
--gray-300: #d1d5db;
--gray-500: #6b7280;
--gray-800: #1f2937;
--gray-900: #111827;

/* main color */
--main-500: #3b82f6;
--main-600: #2563eb;

/* gradients */
--pink-gradient: linear-gradient(#e879f9, #ec4899);
--blue-gradient: linear-gradient(#0ea5e9, #67e8f9);

/* special colors */
--marker: #ffff7a;
}


67 changes: 67 additions & 0 deletions packages/examples/simple-blog/@global/layout.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

/* all reset/normalization you need */
*, *::before, *::after {
box-sizing: border-box;
}

/* consistent whitespace */
ul, ol ,figure, pre {
margin: 2em 0;
}

/* page layout */
body {
max-width: 1000px;
margin: 0 auto;
padding: 2% 5%;

> header nav {
justify-content: space-between;
margin-bottom: 4rem;
display: flex;

/* avatar image */
> a:first-child {
background: url(/img/avatar-rounded.jpg) 0 50% no-repeat;
background-size: 2em;
padding-left: 2.5em;
}

a { padding: 1em 0 }
}

/* content area: hero and sections */
article {
> header { margin-bottom: 2rem }

> section {
max-width: 650px;
margin: 0 auto;
}
}

/* global footer */
> footer {
border-top: 1px solid var(--gray-200);
justify-content: space-between;
margin-top: 6rem;
padding: 1rem 0;
display: flex;

/* social icons */
> :last-child {
display: flex;
gap: .5em;
a:hover {
transform: scale(1.1)
}
}
}
}







46 changes: 46 additions & 0 deletions packages/examples/simple-blog/@global/typography.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

body {
font-family: -apple-system, BlinkMacSystemFont, Avenir Next, Segoe UI, Roboto;
}

/* heading and subtitle */
h1 {
letter-spacing: -0.03em;
font-size: 2.6rem;

&, + p {
text-align: center;
text-wrap: balance;
max-width: 40rem;
margin: 0 auto .2em;
}

+ p {
font-size: 1.15em;
font-weight: 300;
margin-bottom: 2em;
}
}

/* links */
a {
text-decoration: none;

/* navigational links */
nav & {
font-weight: 500;
color: var(--gray-900);

&[aria-selected] {
text-decoration: 2px underline var(--main-500);
text-underline-offset: 8px;
}
}
}

/* bulk content */
p, li {
color: var(--gray-500);
line-height: 1.65;
strong { color: var(--gray-800) }
}
21 changes: 21 additions & 0 deletions packages/examples/simple-blog/@library/cards.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

.pink, .blue {
background-image: var(--pink-gradient);
padding: 3em 0 0 3em;
border-radius: .8em;
overflow: hidden;
margin: 1.5em 0 2em;

pre {
padding: 2em;
margin: 0;
}

> * {
border-radius: .6em 0 0 0;
}
}

.blue {
background-image: var(--blue-gradient);
}
Loading

0 comments on commit d591370

Please sign in to comment.