Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit ac28fb2

Browse files
authored
Merge pull request #184 from agile-ts/develop
New Release 🎉
2 parents 29f3d9d + f0968b7 commit ac28fb2

File tree

172 files changed

+45241
-2043
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+45241
-2043
lines changed

.changeset/modern-paws-turn.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@agile-ts/core': patch
3+
'cra-template-agile': patch
4+
'cra-template-agile-typescript': patch
5+
---
6+
7+
#### :nail_care: Polish
8+
* `cra-template-agile`, `cra-template-agile-typescript`
9+
* Optimized create-react-app templates ([@bennodev19](https://github.com/bennodev19))
10+
* Optimized examples ([@bennodev19](https://github.com/bennodev19))
11+
12+
#### Committers: 1
13+
- BennoDev ([@bennodev19](https://github.com/bennodev19))
14+

.eslintignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ node_modules
44
jest.config.js
55
jest.base.config.js
66
scripts/
7-
examples/
7+
examples/
8+
9+
# Ignore the templates (because otherwise it will try to lint with the eslint config of these packages)
10+
cra-template-agile-typescript/
11+
cra-template-agile/

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ module.exports = {
1515
'plugin:@typescript-eslint/recommended',
1616
'prettier',
1717
],
18+
plugins: ['@typescript-eslint', 'prettier'],
1819
parser: '@typescript-eslint/parser',
1920
parserOptions: {
2021
allowImportExportEverywhere: true,
2122
ecmaVersion: 12,
2223
sourceType: 'module',
2324
},
24-
plugins: ['@typescript-eslint', 'prettier'],
25+
ignorePatterns: ['.eslintrc.js'],
2526
rules: {
2627
'func-names': OFF,
2728
'@typescript-eslint/no-explicit-any': OFF,

.gitignore

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
node_modules/
2-
dist
3-
.yalc
4-
package-lock.json
5-
coverage
6-
.tgz
7-
.changelog
82

93
# Differs on each engine
104
yalc.lock
@@ -18,6 +12,8 @@ npm-debug.log*
1812
yarn-debug.log*
1913
yarn-error.log*
2014
.eslintcache
15+
package-lock.json
16+
yarn.lock
2117

2218
# Editor directories and files
2319
.idea
@@ -33,3 +29,9 @@ sync.js
3329
# Generated files from build
3430
src/*.js
3531
src/*.js.map
32+
*.tgz
33+
cache
34+
coverage
35+
.yalc
36+
dist
37+
.changelog

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<img src="https://raw.githubusercontent.com/agile-ts/agile/master/static/header_background.png" alt="AgileTs">
22

3-
> Global State and Logic Framework
3+
> Global State and Logic Library
44
55
<br />
66

@@ -29,7 +29,7 @@
2929
</p>
3030

3131
<p align="left">
32-
<a href="https://twitter.com/intent/tweet?text=I%20just%20discovered%20AgileTs%3B%20a%20global%2C%20spacy%20and%20overall%20easy%20to%20use%20State%20Manager.%0A%60%60%60ts%0Aconst%20MY_STATE%20%3D%20App.createState(%22Hello%20stranger%22)%3B%0AMY_STATE.set(%22Hello%20friend%22)%3B%0A%60%60%60%0Ahttps%3A%2F%2Fgithub.com%2Fagile-ts%2Fagile%2F%20%0A%0A%40AgileFramework%20%0A%23agilets%20%23statemanagement%20%23webdev%20"><img src="http://randojs.com/images/tweetShield.svg" alt="Tweet" height="20"/>
32+
<a href="https://twitter.com/intent/tweet?text=I%20just%20discovered%20AgileTs%3B%20a%20global%2C%20spacy%20and%20overall%20easy%20to%20use%20State%20Manager.%0A%60%60%60ts%0Aconst%20MY_STATE%20%3D%20App.createState(%22Hello%20stranger%22)%3B%0AMY_STATE.set(%22Hello%20friend%22)%3B%0A%60%60%60%0Ahttps%3A%2F%2Fgithub.com%2Fagile-ts%2Fagile%2F%20%0A%0A%40AgileTypescript%20%0A%23agilets%20%23statemanagement%20%23webdev%20"><img src="http://randojs.com/images/tweetShield.svg" alt="Tweet" height="20"/>
3333
</a>
3434
<a href="https://discord.gg/T9GzreAwPH">
3535
<img src="https://img.shields.io/discord/795291052897992724.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2" alt="Join Discord"/>
@@ -64,7 +64,7 @@ It's only one click away. Just select your preferred Framework below.
6464
- [React](https://codesandbox.io/s/agilets-first-state-f12cz)
6565
- [React-Native](https://snack.expo.io/@bennodev/agilets-first-state)
6666
- [Vue](https://codesandbox.io/s/agilets-first-state-i5xxs)
67-
- Angular (coming soon)
67+
- Svelte (coming soon)
6868

6969
More examples can be found in the [Example section](https://agile-ts.org/docs/examples).
7070

@@ -75,7 +75,7 @@ More examples can be found in the [Example section](https://agile-ts.org/docs/ex
7575
<br />
7676
<img src="https://raw.githubusercontent.com/agile-ts/agile/master/static/why_should_i_use_agile.png" alt="Why should I use AgileTs?"/>
7777

78-
AgileTs is a global State and Logic Framework implemented in Typescript.
78+
AgileTs is a global State and Logic Library implemented in Typescript.
7979
It offers a reimagined API that focuses on **developer experience**
8080
and allows you to **easily** and **flexible** manage your application States.
8181
Besides [States](https://agile-ts.org/docs/core/state),
@@ -175,7 +175,6 @@ We will be happy to help you.
175175
- Quick Start
176176
- [React](https://agile-ts.org/docs/quick-start/react)
177177
- [Vue](https://agile-ts.org/docs/quick-start/vue)
178-
- [Angular](https://agile-ts.org/docs/quick-start/angular)
179178
- Packages
180179
- [core](https://agile-ts.org/docs/core)
181180
- [Agile Instance](https://agile-ts.org/docs/core/agile-instance)
@@ -232,5 +231,5 @@ To find out more about contributing, check out the [CONTRIBUTING.md](https://git
232231
<br />
233232
<img src="https://raw.githubusercontent.com/agile-ts/agile/master/static/credits_header.png" alt="Credits"/>
234233

235-
AgileTs is inspired by [MVVM Frameworks](https://de.wikipedia.org/wiki/Model_View_ViewModel)
234+
AgileTs is inspired by [MVVM Libraries](https://de.wikipedia.org/wiki/Model_View_ViewModel)
236235
like [MobX](https://mobx.js.org/README.html) and [PulseJs](https://github.com/pulse-framework/pulse).
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["next", "next/core-web-vitals"]
3+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# vercel
34+
.vercel
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
> Inspired by https://github.com/vercel/next.js/tree/canary/examples/with-redux
2+
3+
4+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
5+
6+
## Getting Started
7+
8+
First, run the development server:
9+
10+
```bash
11+
npm run dev
12+
# or
13+
yarn dev
14+
```
15+
16+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
17+
18+
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
19+
20+
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.tsx`.
21+
22+
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
23+
24+
## Learn More
25+
26+
To learn more about Next.js, take a look at the following resources:
27+
28+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
29+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
30+
31+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
32+
33+
## Deploy on Vercel
34+
35+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
36+
37+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React from 'react';
2+
import { useAgile } from '@agile-ts/react';
3+
import { LAST_UPDATED_TIMESTAMP, LIGHT } from '../src/core';
4+
5+
const formatTime = (timestamp: number) => {
6+
// cut off except hh:mm:ss
7+
return new Date(timestamp).toJSON().slice(11, 19);
8+
};
9+
10+
const Clock = () => {
11+
const [lastUpdatedTimestamp, light] = useAgile([
12+
LAST_UPDATED_TIMESTAMP,
13+
LIGHT,
14+
]);
15+
16+
return (
17+
<div className={light ? 'light' : ''}>
18+
{formatTime(lastUpdatedTimestamp)}
19+
<style jsx>{`
20+
div {
21+
padding: 15px;
22+
display: inline-block;
23+
color: #82fa58;
24+
font: 50px menlo, monaco, monospace;
25+
background-color: #000;
26+
}
27+
.light {
28+
background-color: #999;
29+
}
30+
`}</style>
31+
</div>
32+
);
33+
};
34+
35+
export default Clock;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React from 'react';
2+
import { useAgile } from '@agile-ts/react';
3+
import {
4+
COUNTER,
5+
decrementCount,
6+
incrementCount,
7+
resetCount,
8+
} from '../src/core';
9+
10+
const Counter = () => {
11+
const count = useAgile(COUNTER);
12+
13+
return (
14+
<div>
15+
<h1>
16+
Count: <span>{count}</span>
17+
</h1>
18+
<button onClick={incrementCount}>+1</button>
19+
<button onClick={decrementCount}>-1</button>
20+
<button onClick={resetCount}>Reset</button>
21+
</div>
22+
);
23+
};
24+
25+
export default Counter;

0 commit comments

Comments
 (0)