nextia 8.0.5 → 9.0.0

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.
package/README.md CHANGED
@@ -6,7 +6,7 @@ Create fast web applications
6
6
 
7
7
  ```sh
8
8
  npm install
9
- cd templates/web
9
+ cd examples/vitejs
10
10
  npm install
11
11
  node --run dev
12
12
  ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nextia",
3
3
  "description": "Create fast web applications",
4
- "version": "8.0.5",
4
+ "version": "9.0.0",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "engines": {
@@ -20,29 +20,12 @@
20
20
  "keywords": [
21
21
  "react"
22
22
  ],
23
- "bin": {
24
- "nextia": "src/bin.js"
25
- },
26
23
  "exports": {
27
- ".": "./src/lib/index.js"
28
- },
29
- "scripts": {
30
- "clean": "rm -fr node_modules .coverage out package-lock.json",
31
- "format": "biome format",
32
- "lint": "biome lint src",
33
- "check": "biome check --reporter=summary src",
34
- "test": "vitest run",
35
- "test:name": "vitest run --testNamePattern",
36
- "test:silent": "vitest run --silent",
37
- "test:coverage": "vitest run --silent --coverage"
24
+ ".": "./src/index.js"
38
25
  },
26
+ "scripts": {},
39
27
  "peerDependencies": {
40
28
  "react": "^19.0.0"
41
29
  },
42
- "devDependencies": {
43
- "@vitejs/plugin-react": "6.0.2",
44
- "@vitest/coverage-v8": "4.1.6",
45
- "jsdom": "29.1.1",
46
- "vitest": "4.1.6"
47
- }
30
+ "devDependencies": {}
48
31
  }
package/src/bin.js DELETED
@@ -1,122 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Copyright (c) 2025 Sinuhe Maceda https://sinuhe.dev
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- *
9
- * https://github.com/sinuhedev/nextia
10
- */
11
-
12
- import { mkdir, writeFile } from 'node:fs/promises'
13
-
14
- function toPascalCase(str) {
15
- return str
16
- .toLowerCase()
17
- .replace(/[^a-zA-Z0-9 ]/g, ' ') // replace special characters
18
- .split(/\s+/) // split by spaces
19
- .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
20
- .join('')
21
- }
22
-
23
- async function createPage(name) {
24
- const dirName = `./src/app/${name}`
25
- const pageName = `${toPascalCase(name)}Page`
26
-
27
- try {
28
- await mkdir(dirName)
29
-
30
- // index.jsx
31
- writeFile(
32
- `${dirName}/index.jsx`,
33
- `import useFunctions from './functions'
34
-
35
- export default function ${pageName}() {
36
- const { state, fx } = useFunctions()
37
-
38
- return (
39
- <section>
40
- ${pageName}
41
- </section>
42
- )
43
- }
44
- `
45
- )
46
-
47
- // function.js
48
- writeFile(
49
- `${dirName}/functions.js`,
50
- `import { useFx } from 'nextia'
51
-
52
- export default () => {
53
- const initialState = {}
54
-
55
- return useFx({
56
- initialState
57
- })
58
- }
59
- `
60
- )
61
- console.info(`✔ Page "${pageName}" created at ${dirName}`)
62
- } catch (err) {
63
- console.error(`Failed to create page: ${err.message}`)
64
- }
65
- }
66
-
67
- async function createComponent(name) {
68
- const dirName = `./src/components/${name}`
69
- const componentName = toPascalCase(name)
70
-
71
- try {
72
- await mkdir(dirName)
73
-
74
- // index.jsx
75
- writeFile(
76
- `${dirName}/index.jsx`,
77
- `import { css } from 'nextia'
78
- import './style.css'
79
-
80
- export default function ${componentName}({ className, style }) {
81
- return (
82
- <article className={css('${componentName}', className)} style={style}>
83
- ${componentName}
84
- </article>
85
- )
86
- }
87
- `
88
- )
89
-
90
- // style.css
91
- writeFile(
92
- `${dirName}/style.css`,
93
- `.${componentName} {
94
- }
95
- `
96
- )
97
- console.info(`✔ Component "${name}" created at ${dirName}`)
98
- } catch (err) {
99
- console.error(`Failed to create component: ${err.message}`)
100
- }
101
- }
102
-
103
- async function main() {
104
- const ARG1 = process.argv[2]
105
- const ARG2 = process.argv[3]
106
-
107
- switch (ARG1) {
108
- case 'page':
109
- if (ARG2) await createPage(ARG2)
110
- else console.warn('node --run page -- <page-name>')
111
- break
112
-
113
- case 'component':
114
- if (ARG2) await createComponent(ARG2)
115
- else console.warn('node --run component -- <ComponentName>')
116
- break
117
- }
118
- }
119
-
120
- main().catch((e) => {
121
- console.error(e)
122
- })
File without changes
File without changes
File without changes
File without changes
File without changes