eser 2.1.8 → 3.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/deno.json +6 -0
  2. package/deno.lock +41 -0
  3. package/hizli-api.js +90 -0
  4. package/main.js +5 -0
  5. package/mod.js +3 -0
  6. package/mod_test.js +5 -0
  7. package/package.json +8 -37
  8. package/.editorconfig +0 -14
  9. package/.gitattributes +0 -11
  10. package/.github/FUNDING.yml +0 -5
  11. package/LICENSE +0 -22
  12. package/README.md +0 -3794
  13. package/css-in-javascript/README.md +0 -432
  14. package/linters/.eslintrc +0 -6
  15. package/linters/.markdownlint.json +0 -154
  16. package/packages/eslint-config-eser/.editorconfig +0 -14
  17. package/packages/eslint-config-eser/.eslintrc +0 -3
  18. package/packages/eslint-config-eser/README.md +0 -19
  19. package/packages/eslint-config-eser/index.js +0 -20
  20. package/packages/eslint-config-eser/package.json +0 -49
  21. package/packages/eslint-config-eser/rules/best-practices.js +0 -381
  22. package/packages/eslint-config-eser/rules/errors.js +0 -146
  23. package/packages/eslint-config-eser/rules/es6.js +0 -203
  24. package/packages/eslint-config-eser/rules/imports.js +0 -291
  25. package/packages/eslint-config-eser/rules/node.js +0 -43
  26. package/packages/eslint-config-eser/rules/strict.js +0 -5
  27. package/packages/eslint-config-eser/rules/style.js +0 -597
  28. package/packages/eslint-config-eser/rules/variables.js +0 -53
  29. package/packages/eslint-config-eser-react/.editorconfig +0 -14
  30. package/packages/eslint-config-eser-react/.eslintrc +0 -3
  31. package/packages/eslint-config-eser-react/README.md +0 -19
  32. package/packages/eslint-config-eser-react/index.js +0 -11
  33. package/packages/eslint-config-eser-react/package.json +0 -59
  34. package/packages/eslint-config-eser-react/rules/react-a11y.js +0 -275
  35. package/packages/eslint-config-eser-react/rules/react-hooks.js +0 -21
  36. package/packages/eslint-config-eser-react/rules/react.js +0 -600
  37. package/react/README.md +0 -717
package/deno.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "tasks": {
3
+ "dev": "deno run --unstable-kv --allow-net --watch main.js",
4
+ "start": "deno run --unstable-kv --allow-net main.js"
5
+ }
6
+ }
package/deno.lock ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "version": "3",
3
+ "redirects": {
4
+ "https://deno.land/x/hono/mod.ts": "https://deno.land/x/hono@v3.10.1/mod.ts"
5
+ },
6
+ "remote": {
7
+ "https://deno.land/x/hono@v3.10.1/client/client.ts": "ff340f58041203879972dd368b011ed130c66914f789826610869a90603406bf",
8
+ "https://deno.land/x/hono@v3.10.1/client/index.ts": "3ff4cf246f3543f827a85a2c84d66a025ac350ee927613629bda47e854bfb7ba",
9
+ "https://deno.land/x/hono@v3.10.1/client/utils.ts": "053273c002963b549d38268a1b423ac8ca211a8028bdab1ed0b781a62aa5e661",
10
+ "https://deno.land/x/hono@v3.10.1/compose.ts": "e8ab4b345aa367f2dd65f221c9fe829dd885326a613f4215b654f93a4066bb5c",
11
+ "https://deno.land/x/hono@v3.10.1/context.ts": "261cc8b8b1e8f04b98beab1cca6692f317b7dc6d2b75b4f84c982e54cf1db730",
12
+ "https://deno.land/x/hono@v3.10.1/helper/cookie/index.ts": "55ccd20bbd8d9a8bb2ecd998e90845c1d306c19027f54b3d1b89a5be35968b80",
13
+ "https://deno.land/x/hono@v3.10.1/hono-base.ts": "cc55e0a4c63a7bdf44df3e804ea4737d5399eeb6606b45d102f8e48c3ff1e925",
14
+ "https://deno.land/x/hono@v3.10.1/hono.ts": "2cc4c292e541463a4d6f83edbcea58048d203e9564ae62ec430a3d466b49a865",
15
+ "https://deno.land/x/hono@v3.10.1/http-exception.ts": "6071df078b5f76d279684d52fe82a590f447a64ffe1b75eb5064d0c8a8d2d676",
16
+ "https://deno.land/x/hono@v3.10.1/mod.ts": "90114a97be9111b348129ad0143e764a64921f60dd03b8f3da529db98a0d3a82",
17
+ "https://deno.land/x/hono@v3.10.1/request.ts": "52330303dd7a3bf4f580fde0463ba608bc4c88a8b7b5edd7c1327064c7cf65ce",
18
+ "https://deno.land/x/hono@v3.10.1/router.ts": "39d573f48baee429810cd583c931dd44274273c30804d538c86967d310ea4ab5",
19
+ "https://deno.land/x/hono@v3.10.1/router/linear-router/index.ts": "8a2a7144c50b1f4a92d9ee99c2c396716af144c868e10608255f969695efccd0",
20
+ "https://deno.land/x/hono@v3.10.1/router/linear-router/router.ts": "bc63e8b5bc1dabc815306d50bebd1bb5877ffa3936ba2ad7550d093c95ee6bd1",
21
+ "https://deno.land/x/hono@v3.10.1/router/pattern-router/index.ts": "304a66c50e243872037ed41c7dd79ed0c89d815e17e172e7ad7cdc4bc07d3383",
22
+ "https://deno.land/x/hono@v3.10.1/router/pattern-router/router.ts": "a9a5a2a182cce8c3ae82139892cc0502be7dd8f579f31e76d0302b19b338e548",
23
+ "https://deno.land/x/hono@v3.10.1/router/reg-exp-router/index.ts": "52755829213941756159b7a963097bafde5cc4fc22b13b1c7c9184dc0512d1db",
24
+ "https://deno.land/x/hono@v3.10.1/router/reg-exp-router/node.ts": "5b3fb80411db04c65df066e69fedb2c8c0844753c2633d703336de84d569252c",
25
+ "https://deno.land/x/hono@v3.10.1/router/reg-exp-router/router.ts": "fbe8917aa24fe25d0208bfa82ce7f49ba0507f9ae158d4d0c177f6a061b0a561",
26
+ "https://deno.land/x/hono@v3.10.1/router/reg-exp-router/trie.ts": "852ce7207e6701e47fa30889a0d2b8bfcd56d8862c97e7bc9831e0a64bd8835f",
27
+ "https://deno.land/x/hono@v3.10.1/router/smart-router/index.ts": "74f9b4fe15ea535900f2b9b048581915f12fe94e531dd2b0032f5610e61c3bef",
28
+ "https://deno.land/x/hono@v3.10.1/router/smart-router/router.ts": "71979c06b32b093960a6e8efc4c185e558f280bff18846b8b1cdc757ade6ff99",
29
+ "https://deno.land/x/hono@v3.10.1/router/trie-router/index.ts": "3eb75e7f71ba81801631b30de6b1f5cefb2c7239c03797e2b2cbab5085911b41",
30
+ "https://deno.land/x/hono@v3.10.1/router/trie-router/node.ts": "3af15fa9c9994a8664a2b7a7c11233504b5bb9d4fcf7bb34cf30d7199052c39f",
31
+ "https://deno.land/x/hono@v3.10.1/router/trie-router/router.ts": "54ced78d35676302c8fcdda4204f7bdf5a7cc907fbf9967c75674b1e394f830d",
32
+ "https://deno.land/x/hono@v3.10.1/utils/body.ts": "7a16a6656331a96bcae57642f8d5e3912bd361cbbcc2c0d2157ecc3f218f7a92",
33
+ "https://deno.land/x/hono@v3.10.1/utils/buffer.ts": "9066a973e64498cb262c7e932f47eed525a51677b17f90893862b7279dc0773e",
34
+ "https://deno.land/x/hono@v3.10.1/utils/cookie.ts": "19920ba6756944aae1ad8585c3ddeaa9df479733f59d05359db096f7361e5e4b",
35
+ "https://deno.land/x/hono@v3.10.1/utils/crypto.ts": "bda0e141bbe46d3a4a20f8fbcb6380d473b617123d9fdfa93e4499410b537acc",
36
+ "https://deno.land/x/hono@v3.10.1/utils/stream.ts": "1789dcc73c5b0ede28f83d7d34e47ae432c20e680907cb3275a9c9187f293983",
37
+ "https://deno.land/x/hono@v3.10.1/utils/url.ts": "5fc3307ef3cb2e6f34ec2a03e3d7f2126c6a9f5f0eab677222df3f0e40bd7567",
38
+ "https://deno.land/x/hono@v3.10.1/validator/index.ts": "6c986e8b91dcf857ecc8164a506ae8eea8665792a4ff7215471df669c632ae7c",
39
+ "https://deno.land/x/hono@v3.10.1/validator/validator.ts": "afa5e52495e0996fbba61996736fab5c486590d72d376f809e9f9ff4e0c463e9"
40
+ }
41
+ }
package/hizli-api.js ADDED
@@ -0,0 +1,90 @@
1
+ import { Hono } from "https://deno.land/x/hono@v3.10.1/mod.ts";
2
+
3
+ const kv = await Deno.openKv();
4
+
5
+ export function routeHome(config, ctx) {
6
+ return ctx.json({
7
+ system: config.options.name,
8
+ motd: config.options.messages.welcome,
9
+ items: config.options.items,
10
+ commands: [
11
+ "add",
12
+ "clear",
13
+ ],
14
+ });
15
+ }
16
+
17
+ export async function routeItem(item, config, ctx) {
18
+ const itemKey = ["items", item];
19
+
20
+ const getResult = await kv.get(itemKey);
21
+ const records = getResult?.value ?? [];
22
+
23
+ return ctx.json(records);
24
+ }
25
+
26
+ export async function routeItemsAdd(item, config, ctx) {
27
+ const itemKey = ["items", item];
28
+
29
+ const getResult = await kv.get(itemKey);
30
+ const records = getResult?.value ?? [];
31
+
32
+ const value = ctx.req.param("value");
33
+ records.push(value);
34
+
35
+ await kv.set(itemKey, records);
36
+
37
+ return ctx.redirect(`/${item}`);
38
+ }
39
+
40
+ export async function routeItemsClear(item, config, ctx) {
41
+ const itemKey = ["items", item];
42
+
43
+ await kv.set(itemKey, []);
44
+
45
+ return ctx.redirect(`/${item}`);
46
+ }
47
+
48
+ export function validateConfig(options) {
49
+ return {
50
+ options: {
51
+ name: options.isim ?? "hizli-api",
52
+ messages: {
53
+ welcome: options.mesajlar.hosgeldin ?? "Hoş geldin!",
54
+ success: options.mesajlar.basarili ?? "Başarılı",
55
+ fail: options.mesajlar.basarisiz ?? "Başarısız",
56
+ },
57
+
58
+ items: options.nesneler ?? [],
59
+ },
60
+ };
61
+ }
62
+
63
+ export function hizliApi(options) {
64
+ const config = validateConfig(options);
65
+
66
+ const app = new Hono();
67
+
68
+ app.get("/", (ctx) => routeHome(config, ctx));
69
+ for (const item of config.options.items) {
70
+ app.get(`/${item}`, (ctx) => routeItem(item, config, ctx));
71
+ app.get(`/${item}/add/:value`, (ctx) => routeItemsAdd(item, config, ctx));
72
+ app.get(`/${item}/clear`, (ctx) => routeItemsClear(item, config, ctx));
73
+ }
74
+
75
+ Deno.serve(app.fetch);
76
+ }
77
+
78
+ export { hizliApi as default };
79
+
80
+ hizliApi({
81
+ isim: "defterdar",
82
+
83
+ mesajlar: {
84
+ hosgeldin: "Selam!",
85
+ basarili: "Oldu",
86
+ basarisiz: "Olmadı",
87
+ },
88
+
89
+ nesneler: [ "dil", "runtime", "browser" ],
90
+ });
package/main.js ADDED
@@ -0,0 +1,5 @@
1
+ import { add } from "./mod.js";
2
+
3
+ if (import.meta.main === undefined || import.meta.main) {
4
+ console.log("Add 2 + 3 =", add(2, 3));
5
+ }
package/mod.js ADDED
@@ -0,0 +1,3 @@
1
+ export function add(a, b) {
2
+ return a + b;
3
+ }
package/mod_test.js ADDED
@@ -0,0 +1,5 @@
1
+ import { add } from "./mod.js";
2
+
3
+ Deno.test(function addTest() {
4
+ assertEquals(add(2, 3), 5);
5
+ });
package/package.json CHANGED
@@ -1,42 +1,13 @@
1
1
  {
2
2
  "name": "eser",
3
- "version": "2.1.8",
4
- "description": "A mostly reasonable approach to JavaScript.",
3
+ "version": "3.0.0-rc.1",
4
+ "description": "",
5
+ "type": "module",
6
+ "main": "main.js",
7
+ "module": "mod.js",
5
8
  "scripts": {
6
- "cleanup": "rm -rf yarn.lock node_modules/",
7
- "lint": "markdownlint --config linters/.markdownlint.json README.md */README.md",
8
- "lint:fix": "markdownlint --config linters/.markdownlint.json --fix README.md */README.md",
9
- "test": "",
10
- "test:coverage": ""
9
+ "start": "node main.js"
11
10
  },
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/eserozvataf/eser.git"
15
- },
16
- "keywords": [
17
- "style guide",
18
- "lint",
19
- "eser",
20
- "airbnb",
21
- "es6",
22
- "es2015",
23
- "es2016",
24
- "es2017",
25
- "es2018",
26
- "react",
27
- "hooks",
28
- "jsx",
29
- "a11y"
30
- ],
31
- "author": "Eser Ozvataf <eser@ozvataf.com> (https://twitter.com/eser)",
32
- "license": "MIT",
33
- "bugs": {
34
- "url": "https://github.com/eserozvataf/eser/issues"
35
- },
36
- "homepage": "https://github.com/eserozvataf/eser",
37
- "devDependencies": {
38
- "markdownlint-cli": "^0.19.0"
39
- },
40
- "private": false,
41
- "workspaces": [ "packages/*" ]
11
+ "author": "Eser Ozvataf",
12
+ "license": "Apache-2.0"
42
13
  }
package/.editorconfig DELETED
@@ -1,14 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- indent_style = space
5
- indent_size = 4
6
- charset = utf-8
7
- trim_trailing_whitespace = true
8
- insert_final_newline = true
9
- end_of_line = lf
10
- # editorconfig-tools is unable to ignore longs strings or urls
11
- max_line_length = off
12
-
13
- [*.md]
14
- trim_trailing_whitespace = false
package/.gitattributes DELETED
@@ -1,11 +0,0 @@
1
- # Set the default behavior, in case people don't have core.autocrlf set.
2
- * text eol=lf
3
-
4
- *.png binary
5
- *.jpg binary
6
- *.ico binary
7
- *.jpg binary
8
- *.eot binary
9
- *.ttf binary
10
- *.woff binary
11
- *.woff2 binary
@@ -1,5 +0,0 @@
1
- # These are supported funding model platforms
2
-
3
- github: [eserozvataf]
4
- patreon: eserozvataf
5
- open_collective: eser
package/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2019 Eser Ozvataf <eser@ozvataf.com>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-