@vtj/local 0.11.15 → 0.12.0-alpha.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/dist/index.cjs CHANGED
@@ -583,6 +583,9 @@ async function init(_body, opts) {
583
583
  repository.save(id, dsl);
584
584
  }
585
585
  dsl.__BASE_PATH__ = opts.staticBase;
586
+ if (!dsl.__UID__) {
587
+ dsl.__UID__ = node.uuid(true);
588
+ }
586
589
  return success(dsl);
587
590
  } else {
588
591
  const model = new core.ProjectModel({
@@ -758,6 +761,14 @@ async function genVueContent(project, dsl) {
758
761
  });
759
762
  return success(content);
760
763
  }
764
+ async function parseVue(options) {
765
+ let errors = null;
766
+ const dsl = await parser.parseVue(options).catch((e) => {
767
+ errors = e;
768
+ return null;
769
+ });
770
+ return success(errors ? errors : dsl);
771
+ }
761
772
  async function createRawPage(file) {
762
773
  const repository = new VueRepository(_platform);
763
774
  const page = await coder.createEmptyPage(file);
@@ -858,6 +869,15 @@ const controller = {
858
869
  const { project, dsl } = req.data || {};
859
870
  return genVueContent(project, dsl);
860
871
  },
872
+ parseVue: async (req) => {
873
+ const { id, name, source, project } = req.data || {};
874
+ return parseVue({
875
+ id,
876
+ name,
877
+ source,
878
+ project
879
+ });
880
+ },
861
881
  createRawPage: async (req) => {
862
882
  const file = req.data;
863
883
  return createRawPage(file);
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import { copyPlugin, staticPlugin } from '@vtj/cli';
2
- import { pathExistsSync, ensureFileSync, writeJsonSync, readJsonSync, removeSync, outputFileSync, readdirSync, moveSync, upperFirstCamelCase, camelCase, fs, timestamp } from '@vtj/node';
2
+ import { pathExistsSync, ensureFileSync, writeJsonSync, readJsonSync, removeSync, outputFileSync, readdirSync, moveSync, upperFirstCamelCase, camelCase, fs, timestamp, uuid } from '@vtj/node';
3
3
  import { resolve, join } from 'path';
4
4
  import bodyParser from 'body-parser';
5
5
  import formidable from 'formidable';
6
6
  import { ProjectModel } from '@vtj/core';
7
7
  import { tsFormatter, cssFormatter, vueFormatter, generator, createEmptyPage } from '@vtj/coder';
8
- import { parseUniApp } from '@vtj/parser';
8
+ import { parseUniApp, parseVue as parseVue$1 } from '@vtj/parser';
9
9
 
10
10
  const success = (data) => {
11
11
  return {
@@ -576,6 +576,9 @@ async function init(_body, opts) {
576
576
  repository.save(id, dsl);
577
577
  }
578
578
  dsl.__BASE_PATH__ = opts.staticBase;
579
+ if (!dsl.__UID__) {
580
+ dsl.__UID__ = uuid(true);
581
+ }
579
582
  return success(dsl);
580
583
  } else {
581
584
  const model = new ProjectModel({
@@ -751,6 +754,14 @@ async function genVueContent(project, dsl) {
751
754
  });
752
755
  return success(content);
753
756
  }
757
+ async function parseVue(options) {
758
+ let errors = null;
759
+ const dsl = await parseVue$1(options).catch((e) => {
760
+ errors = e;
761
+ return null;
762
+ });
763
+ return success(errors ? errors : dsl);
764
+ }
754
765
  async function createRawPage(file) {
755
766
  const repository = new VueRepository(_platform);
756
767
  const page = await createEmptyPage(file);
@@ -851,6 +862,15 @@ const controller = {
851
862
  const { project, dsl } = req.data || {};
852
863
  return genVueContent(project, dsl);
853
864
  },
865
+ parseVue: async (req) => {
866
+ const { id, name, source, project } = req.data || {};
867
+ return parseVue({
868
+ id,
869
+ name,
870
+ source,
871
+ project
872
+ });
873
+ },
854
874
  createRawPage: async (req) => {
855
875
  const file = req.data;
856
876
  return createRawPage(file);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vtj/local",
3
3
  "private": false,
4
- "version": "0.11.15",
4
+ "version": "0.12.0-alpha.0",
5
5
  "type": "module",
6
6
  "keywords": [
7
7
  "低代码引擎",
@@ -22,16 +22,16 @@
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
24
  "formidable": "~3.5.1",
25
- "@vtj/coder": "~0.11.15",
26
- "@vtj/core": "~0.11.15",
27
- "@vtj/node": "~0.11.2",
28
- "@vtj/parser": "~0.11.15"
25
+ "@vtj/core": "~0.12.0-alpha.0",
26
+ "@vtj/node": "~0.12.0-alpha.0",
27
+ "@vtj/coder": "~0.12.0-alpha.0",
28
+ "@vtj/parser": "~0.12.0-alpha.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/formidable": "~3.4.5",
32
32
  "unbuild": "~2.0.0",
33
- "vite": "~6.2.0",
34
- "@vtj/cli": "~0.11.2"
33
+ "vite": "~6.3.0",
34
+ "@vtj/cli": "~0.12.0-alpha.0"
35
35
  },
36
36
  "exports": {
37
37
  ".": {