Skip to content

Commit 69f0525

Browse files
committed
♻️ Fully update active-class-name example
1 parent ad0eb33 commit 69f0525

File tree

17 files changed

+120
-70
lines changed

17 files changed

+120
-70
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
extends: 'plugin:nullstack/recommended',
3+
rules: {
4+
'nullstack/prettier': [
5+
'warn',
6+
{
7+
// More options at https://prettier.io/docs/en/options
8+
trailingComma: 'all',
9+
tabWidth: 2,
10+
semi: false,
11+
singleQuote: true,
12+
printWidth: 80,
13+
},
14+
{
15+
usePrettierrc: false,
16+
},
17+
],
18+
},
19+
}

examples/active-class-name/.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
package-lock.json
8+
yarn.lock
9+
pnpm-lock.yaml
10+
11+
# testing
12+
/coverage
13+
14+
# misc
15+
.DS_Store
16+
*.pem
17+
18+
# debug
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*
22+
.pnpm-debug.log*
23+
24+
# local env files
25+
.env
26+
27+
# vercel
28+
.vercel
29+
30+
# bundle folders
31+
.development/
32+
.production/

examples/active-class-name/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Nullstack [Context](https://nullstack.app/context)'s [Router](https://nullstack.
66

77
Deploy it now with [Vercel](https://vercel.com):
88

9-
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/GuiDevloper/nullstack-examples/tree/master/examples/active-class-name&project-name=active-class-name&repo-name=active-class-name&demo-title=Nullstack+activeClassName&demo-description=Nullstack+example+of+active+class+name&demo-url=https://github.com/GuiDevloper/nullstack-examples/tree/master/examples/active-class-name&demo-image=https://nullstack.app/image-1200x630.png)
9+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/GuiDevloper/nullstack-examples/tree/main/examples/active-class-name&project-name=active-class-name&repo-name=active-class-name&demo-title=Nullstack+activeClassName&demo-description=Nullstack+example+of+active+class+name&demo-url=https://github.com/GuiDevloper/nullstack-examples/tree/main/examples/active-class-name&demo-image=https://nullstack.app/image-1200x630.png)
1010

1111
## How to use
1212

@@ -16,4 +16,4 @@ Execute [`nulla create`](https://github.com/GuiDevloper/nulla) with [npm](https:
1616
npx nulla create --example active-class-name active-class-name-app
1717
```
1818

19-
Then deploy it with [Vercel](https://github.com/GuiDevloper/nulla/blob/master/docs/en-US/deploy-vercel.md), [Heroku](https://github.com/GuiDevloper/nulla/blob/master/docs/en-US/deploy-heroku.md) or [Netlify](https://github.com/GuiDevloper/nulla/blob/master/docs/en-US/deploy-netlify.md).
19+
Then deploy it with [Vercel](https://github.com/GuiDevloper/nulla/blob/main/docs/en-US/deploy-vercel.md), [Heroku](https://github.com/GuiDevloper/nulla/blob/main/docs/en-US/deploy-heroku.md) or [Netlify](https://github.com/GuiDevloper/nulla/blob/main/docs/en-US/deploy-netlify.md).
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import application from '../.production/server';
1+
import application from '../.production/server'
22

3-
export default application.server;
3+
export default application.server

examples/active-class-name/client.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/active-class-name/client.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Nullstack from 'nullstack'
2+
3+
import Application from './src/Application'
4+
5+
export default Nullstack.start(Application)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"private": true,
33
"devDependencies": {
4-
"nullstack": "~0.15.0"
4+
"nullstack": "~0.17.5"
55
},
66
"scripts": {
7-
"start": "npx nullstack start --port=3000",
8-
"build": "npx nullstack build --mode=ssr",
7+
"start": "npx nullstack start",
8+
"build": "npx nullstack build",
99
"vercel-build": "npm run build"
1010
}
1111
}

examples/active-class-name/server.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/active-class-name/server.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Nullstack from 'nullstack'
2+
3+
import Application from './src/Application'
4+
5+
export default Nullstack.start(Application)
Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
1-
import Nullstack from 'nullstack';
2-
import './Application.css';
3-
import Nav from './components/Nav';
4-
import Home from './pages/Home';
5-
import About from './pages/About';
6-
import Blog from './pages/Blog';
7-
import Dynamic from './pages/Dynamic';
1+
import Nullstack, { NullstackClientContext } from 'nullstack'
2+
3+
import './Application.css'
4+
import Nav from './components/Nav'
5+
import About from './pages/About'
6+
import Blog from './pages/Blog'
7+
import Dynamic from './pages/Dynamic'
8+
import Home from './pages/Home'
89

910
class Application extends Nullstack {
10-
11-
prepare({ page }) {
12-
page.title = 'Nullstack active-class-name';
11+
12+
prepare({ page }: NullstackClientContext) {
13+
page.title = 'Nullstack active-class-name'
1314
}
1415

1516
render() {
1617
return (
1718
<>
18-
<Nav/>
19-
<Home route="/"/>
20-
<About route="/about"/>
21-
<Blog route="/blog"/>
22-
<Dynamic route="/*"/>
19+
<Nav />
20+
<Home route="/" />
21+
<About route="/about" />
22+
<Blog route="/blog" />
23+
<Dynamic route="/*" />
2324
</>
2425
)
2526
}
2627

2728
}
2829

29-
export default Application;
30+
export default Application

0 commit comments

Comments
 (0)