@stonecrop/nuxt 0.16.1 → 0.16.3
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 +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +32 -54
- package/package.json +13 -13
- package/templates/Project.json +1 -1
- package/templates/Task.json +1 -1
package/README.md
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,53 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { realpathSync, existsSync } from 'node:fs';
|
|
2
2
|
import { readdir, readFile } from 'node:fs/promises';
|
|
3
3
|
import { dirname, extname } from 'node:path';
|
|
4
|
-
import { createResolver, defineNuxtModule, useLogger,
|
|
5
|
-
|
|
6
|
-
function createSymlinkedPackagesPlugin(options) {
|
|
7
|
-
const { rootDir, packages, logger } = options;
|
|
8
|
-
return {
|
|
9
|
-
name: "stonecrop-symlinked-packages",
|
|
10
|
-
config() {
|
|
11
|
-
const allowPaths = /* @__PURE__ */ new Set();
|
|
12
|
-
const nuxtModulePath = `${rootDir}/node_modules/@stonecrop/nuxt`;
|
|
13
|
-
try {
|
|
14
|
-
if (existsSync(nuxtModulePath)) {
|
|
15
|
-
const realNuxtModulePath = realpathSync(nuxtModulePath);
|
|
16
|
-
if (realNuxtModulePath !== nuxtModulePath) {
|
|
17
|
-
const monorepoRoot = dirname(realNuxtModulePath);
|
|
18
|
-
allowPaths.add(monorepoRoot);
|
|
19
|
-
logger?.(`@stonecrop/nuxt is symlinked, adding monorepo root: ${monorepoRoot}`);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
} catch (e) {
|
|
23
|
-
logger?.(`Error checking @stonecrop/nuxt symlink: ${e instanceof Error ? e.message : String(e)}`);
|
|
24
|
-
}
|
|
25
|
-
for (const pkg of packages) {
|
|
26
|
-
const pkgPath = `${rootDir}/node_modules/${pkg}`;
|
|
27
|
-
try {
|
|
28
|
-
if (existsSync(pkgPath)) {
|
|
29
|
-
const realPath = realpathSync(pkgPath);
|
|
30
|
-
if (realPath !== pkgPath) {
|
|
31
|
-
allowPaths.add(realPath);
|
|
32
|
-
logger?.(`Adding symlinked package to fs.allow: ${realPath}`);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
} catch {
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
if (allowPaths.size > 0) {
|
|
39
|
-
logger?.(`Vite fs.allow updated with ${allowPaths.size} path(s)`);
|
|
40
|
-
return {
|
|
41
|
-
server: {
|
|
42
|
-
fs: {
|
|
43
|
-
allow: [...allowPaths]
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
4
|
+
import { createResolver, defineNuxtModule, useLogger, resolvePath, addLayout, extendPages, addServerHandler, addComponent, addPlugin, addImportsDir } from '@nuxt/kit';
|
|
51
5
|
|
|
52
6
|
const { resolve } = createResolver(import.meta.url);
|
|
53
7
|
const STONECROP_PACKAGES = [
|
|
@@ -79,6 +33,19 @@ const module$1 = defineNuxtModule({
|
|
|
79
33
|
}
|
|
80
34
|
}
|
|
81
35
|
logger.log("Added Stonecrop packages to build.transpile for SSR CSS handling");
|
|
36
|
+
nuxt.options.imports = nuxt.options.imports || {};
|
|
37
|
+
nuxt.options.imports.transform = nuxt.options.imports.transform || {};
|
|
38
|
+
nuxt.options.imports.transform.exclude = nuxt.options.imports.transform.exclude || [];
|
|
39
|
+
const escapeRE = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
40
|
+
for (const pkg of STONECROP_PACKAGES) {
|
|
41
|
+
if (pkg === "@stonecrop/themes") continue;
|
|
42
|
+
try {
|
|
43
|
+
const distDir = dirname(realpathSync(await resolvePath(pkg)));
|
|
44
|
+
nuxt.options.imports.transform.exclude.push(new RegExp(`^${escapeRE(distDir)}`));
|
|
45
|
+
logger.log(`Excluded prebuilt dist from auto-import transform: ${distDir}`);
|
|
46
|
+
} catch {
|
|
47
|
+
}
|
|
48
|
+
}
|
|
82
49
|
if (options.theme && !nuxt.options.css.includes(options.theme)) {
|
|
83
50
|
nuxt.options.css.unshift(options.theme);
|
|
84
51
|
logger.log(`Added Stonecrop theme to app CSS: ${options.theme}`);
|
|
@@ -94,12 +61,23 @@ const module$1 = defineNuxtModule({
|
|
|
94
61
|
logger.log("Added Stonecrop packages to Nitro externals.inline for CSS bundling");
|
|
95
62
|
});
|
|
96
63
|
if (nuxt.options.dev) {
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
64
|
+
const allowPaths = /* @__PURE__ */ new Set();
|
|
65
|
+
for (const pkg of ["@stonecrop/nuxt", ...STONECROP_PACKAGES]) {
|
|
66
|
+
const pkgPath = `${nuxt.options.rootDir}/node_modules/${pkg}`;
|
|
67
|
+
try {
|
|
68
|
+
const realPath = realpathSync(pkgPath);
|
|
69
|
+
if (realPath !== pkgPath) {
|
|
70
|
+
allowPaths.add(pkg === "@stonecrop/nuxt" ? dirname(realPath) : realPath);
|
|
71
|
+
}
|
|
72
|
+
} catch {
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (allowPaths.size > 0) {
|
|
76
|
+
nuxt.options.vite.server = nuxt.options.vite.server || {};
|
|
77
|
+
nuxt.options.vite.server.fs = nuxt.options.vite.server.fs || {};
|
|
78
|
+
nuxt.options.vite.server.fs.allow = [...nuxt.options.vite.server.fs.allow || [], ...allowPaths];
|
|
79
|
+
logger.log(`Vite fs.allow updated with ${allowPaths.size} symlinked package path(s)`);
|
|
80
|
+
}
|
|
103
81
|
}
|
|
104
82
|
const homepage = resolve("runtime/app/layouts/StonecropHome.vue");
|
|
105
83
|
addLayout(homepage, "home");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/nuxt",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.3",
|
|
4
4
|
"description": "Nuxt module for Stonecrop",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -45,18 +45,18 @@
|
|
|
45
45
|
"pathe": "^2.0.3",
|
|
46
46
|
"pinia": "^3.0.4",
|
|
47
47
|
"prompts": "^2.4.2",
|
|
48
|
-
"@stonecrop/aform": "0.16.
|
|
49
|
-
"@stonecrop/
|
|
50
|
-
"@stonecrop/
|
|
51
|
-
"@stonecrop/
|
|
52
|
-
"@stonecrop/
|
|
53
|
-
"@stonecrop/
|
|
54
|
-
"@stonecrop/node-editor": "0.16.
|
|
55
|
-
"@stonecrop/
|
|
56
|
-
"@stonecrop/nuxt-grafserv": "0.16.
|
|
57
|
-
"@stonecrop/
|
|
58
|
-
"@stonecrop/
|
|
59
|
-
"@stonecrop/
|
|
48
|
+
"@stonecrop/aform": "0.16.3",
|
|
49
|
+
"@stonecrop/atable": "0.16.3",
|
|
50
|
+
"@stonecrop/casl-middleware": "0.16.3",
|
|
51
|
+
"@stonecrop/code-editor": "0.16.3",
|
|
52
|
+
"@stonecrop/graphql-client": "0.16.3",
|
|
53
|
+
"@stonecrop/desktop": "0.16.3",
|
|
54
|
+
"@stonecrop/node-editor": "0.16.3",
|
|
55
|
+
"@stonecrop/graphql-middleware": "0.16.3",
|
|
56
|
+
"@stonecrop/nuxt-grafserv": "0.16.3",
|
|
57
|
+
"@stonecrop/schema": "0.16.3",
|
|
58
|
+
"@stonecrop/stonecrop": "0.16.3",
|
|
59
|
+
"@stonecrop/themes": "0.16.3"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@eslint/js": "^10.0.1",
|
package/templates/Project.json
CHANGED