aiplang 2.0.0 → 2.0.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.
package/bin/aiplang.js
CHANGED
|
@@ -5,7 +5,7 @@ const fs = require('fs')
|
|
|
5
5
|
const path = require('path')
|
|
6
6
|
const http = require('http')
|
|
7
7
|
|
|
8
|
-
const VERSION = '2.0.
|
|
8
|
+
const VERSION = '2.0.1'
|
|
9
9
|
const RUNTIME_DIR = path.join(__dirname, '..', 'runtime')
|
|
10
10
|
const cmd = process.argv[2]
|
|
11
11
|
const args = process.argv.slice(3)
|
|
@@ -101,7 +101,7 @@ foot{© ${y} ${n}}`,
|
|
|
101
101
|
if (cmd==='init') {
|
|
102
102
|
const tplIdx = args.indexOf('--template')
|
|
103
103
|
const tplName = tplIdx!==-1 ? args[tplIdx+1] : 'default'
|
|
104
|
-
const name = args.find(a=>!a.startsWith('--')&&a!==tplName)||'
|
|
104
|
+
const name = args.find(a=>!a.startsWith('--')&&a!==tplName)||'aiplang-app'
|
|
105
105
|
const dir = path.resolve(name), year = new Date().getFullYear()
|
|
106
106
|
if (fs.existsSync(dir)) { console.error(`\n ✗ Directory "${name}" already exists.\n`); process.exit(1) }
|
|
107
107
|
fs.mkdirSync(path.join(dir,'pages'), {recursive:true})
|
|
@@ -184,7 +184,7 @@ if (cmd==='serve'||cmd==='dev') {
|
|
|
184
184
|
})
|
|
185
185
|
},500)
|
|
186
186
|
require('http').createServer((req,res)=>{
|
|
187
|
-
if(req.url.split('?')[0]==='/
|
|
187
|
+
if(req.url.split('?')[0]==='/__aiplang_reload'){
|
|
188
188
|
res.writeHead(200,{'Content-Type':'text/event-stream','Cache-Control':'no-cache','Access-Control-Allow-Origin':'*'})
|
|
189
189
|
res.write('data: connected\n\n');clients.push(res)
|
|
190
190
|
req.on('close',()=>{clients=clients.filter(c=>c!==res)});return
|
|
@@ -196,7 +196,7 @@ if (cmd==='serve'||cmd==='dev') {
|
|
|
196
196
|
if(!fp){res.writeHead(404);res.end('Not found');return}
|
|
197
197
|
let content=fs.readFileSync(fp)
|
|
198
198
|
if(path.extname(fp)==='.html'){
|
|
199
|
-
const inject=`\n<script>const __es=new EventSource('/
|
|
199
|
+
const inject=`\n<script>const __es=new EventSource('/__aiplang_reload');__es.onmessage=e=>{if(e.data==='reload')location.reload()}</script>`
|
|
200
200
|
content=content.toString().replace('</body>',inject+'</body>')
|
|
201
201
|
}
|
|
202
202
|
res.writeHead(200,{'Content-Type':MIME[path.extname(fp)]||'application/octet-stream','Access-Control-Allow-Origin':'*'})
|
|
@@ -207,8 +207,8 @@ if (cmd==='serve'||cmd==='dev') {
|
|
|
207
207
|
|
|
208
208
|
// ── Dev server (full-stack) ──────────────────────────────────────
|
|
209
209
|
if (cmd === 'start' || cmd === 'run') {
|
|
210
|
-
const
|
|
211
|
-
if (!
|
|
210
|
+
const aipFile = args[0]
|
|
211
|
+
if (!aipFile || !fs.existsSync(fluxFile)) {
|
|
212
212
|
console.error(`\n ✗ Usage: aiplang start <app.flux>\n`)
|
|
213
213
|
process.exit(1)
|
|
214
214
|
}
|
|
@@ -220,7 +220,7 @@ if (cmd === 'start' || cmd === 'run') {
|
|
|
220
220
|
process.exit(1)
|
|
221
221
|
}
|
|
222
222
|
console.log(`\n aiplang full-stack server\n`)
|
|
223
|
-
require('child_process').spawn(process.execPath, [serverPath,
|
|
223
|
+
require('child_process').spawn(process.execPath, [serverPath, aipFile, port], {
|
|
224
224
|
stdio: 'inherit', env: { ...process.env, PORT: port }
|
|
225
225
|
})
|
|
226
226
|
return
|
package/package.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aiplang",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "AI-first full-stack language. Frontend + Backend + DB + Auth in one file. Competes with Laravel.",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"
|
|
6
|
+
"aiplang",
|
|
7
7
|
"ai",
|
|
8
8
|
"web",
|
|
9
9
|
"language",
|
|
10
10
|
"compiler",
|
|
11
11
|
"ssg",
|
|
12
12
|
"reactive",
|
|
13
|
-
"claude"
|
|
13
|
+
"claude",
|
|
14
|
+
"full-stack"
|
|
14
15
|
],
|
|
15
16
|
"author": "isacamartin",
|
|
16
17
|
"license": "MIT",
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
"runtime/",
|
|
32
33
|
"server/",
|
|
33
34
|
"README.md",
|
|
34
|
-
"
|
|
35
|
+
"aiplang-knowledge.md"
|
|
35
36
|
],
|
|
36
37
|
"engines": {
|
|
37
38
|
"node": ">=16"
|
|
File without changes
|