@pinegrow/astro-module 3.0.0-beta.84 → 3.0.0-beta.86

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.
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/tsup/assets/cjs_shims.js
2
+ var getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
3
+ var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
4
+
5
+
6
+
7
+ exports.importMetaUrl = importMetaUrl;
@@ -0,0 +1,53 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined")
11
+ return require.apply(this, arguments);
12
+ throw new Error('Dynamic require of "' + x + '" is not supported');
13
+ });
14
+ var __esm = (fn, res) => function __init() {
15
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
16
+ };
17
+ var __commonJS = (cb, mod) => function __require2() {
18
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+
33
+ // ../../node_modules/tsup/assets/esm_shims.js
34
+ import { fileURLToPath } from "url";
35
+ import path from "path";
36
+ var getFilename, getDirname, __dirname, __filename;
37
+ var init_esm_shims = __esm({
38
+ "../../node_modules/tsup/assets/esm_shims.js"() {
39
+ getFilename = () => fileURLToPath(import.meta.url);
40
+ getDirname = () => path.dirname(getFilename());
41
+ __dirname = /* @__PURE__ */ getDirname();
42
+ __filename = /* @__PURE__ */ getFilename();
43
+ }
44
+ });
45
+
46
+ export {
47
+ __require,
48
+ __commonJS,
49
+ __toESM,
50
+ __dirname,
51
+ __filename,
52
+ init_esm_shims
53
+ };
@@ -0,0 +1,44 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined")
11
+ return require.apply(this, arguments);
12
+ throw new Error('Dynamic require of "' + x + '" is not supported');
13
+ });
14
+ var __esm = (fn, res) => function __init() {
15
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
16
+ };
17
+ var __commonJS = (cb, mod) => function __require2() {
18
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+
33
+ // ../../node_modules/tsup/assets/cjs_shims.js
34
+ var init_cjs_shims = __esm({
35
+ "../../node_modules/tsup/assets/cjs_shims.js"() {
36
+ }
37
+ });
38
+
39
+
40
+
41
+
42
+
43
+
44
+ exports.__require = __require; exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.init_cjs_shims = init_cjs_shims;
package/dist/index.cjs CHANGED
@@ -1,16 +1,41 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/index.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// src/index.ts
2
+ var _vite = require('vite');
3
+ var _vite3 = require('unplugin-vue-components/vite'); var _vite4 = _interopRequireDefault(_vite3);
4
+ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
2
5
  async function getViteConfiguration(moduleOptions) {
6
+ var _a, _b, _c, _d;
3
7
  let vitePlugin;
4
8
  try {
5
9
  const { liveDesigner } = await Promise.resolve().then(() => require("./live-designer-ZFVVYPVH.cjs"));
6
- vitePlugin = liveDesigner(moduleOptions == null ? void 0 : moduleOptions.liveDesigner);
10
+ vitePlugin = liveDesigner({ ...(moduleOptions == null ? void 0 : moduleOptions.liveDesigner) || {}, mappingType: "type3" });
7
11
  } catch (err) {
8
12
  console.log(err);
9
13
  console.log("Pinegrow: @pinegrow/astro-module was unable to load @pinegrow/vite-plugin live-designer!");
10
14
  }
11
- const config = {
15
+ let config = {
12
16
  plugins: vitePlugin ? [vitePlugin] : []
13
17
  };
18
+ (_a = config.plugins) == null ? void 0 : _a.push(_vite4.default.call(void 0, { ...(moduleOptions == null ? void 0 : moduleOptions.autoImportComponents) || {} }));
19
+ const ignoreList = [
20
+ .../* @__PURE__ */ new Set([...((_c = (_b = config == null ? void 0 : config.server) == null ? void 0 : _b.watch) == null ? void 0 : _c.ignored) || [], "**/_pgbackup/**", "**/_pginfo/**", "**/pinegrow.json"])
21
+ ];
22
+ config = _vite.mergeConfig.call(void 0, config, {
23
+ server: {
24
+ watch: {
25
+ ignored: ignoreList
26
+ }
27
+ }
28
+ });
29
+ const alias = (_d = config == null ? void 0 : config.resolve) == null ? void 0 : _d.alias;
30
+ if (!alias) {
31
+ config = _vite.mergeConfig.call(void 0, config, {
32
+ resolve: {
33
+ alias: {
34
+ "@": _path2.default.resolve(config.root || process.cwd(), "./src")
35
+ }
36
+ }
37
+ });
38
+ }
14
39
  return config;
15
40
  }
16
41
  function createIntegration(moduleOptions) {
@@ -22,6 +47,21 @@ function createIntegration(moduleOptions) {
22
47
  vite: await getViteConfiguration(moduleOptions)
23
48
  });
24
49
  },
50
+ "astro:server:setup": ({ server }) => {
51
+ const liveDesignerPluginIndex = server.config.plugins.findIndex(
52
+ (plugin) => plugin.name === "pinegrow:live-designer"
53
+ );
54
+ const liveDesignerPlugin = server.config.plugins[liveDesignerPluginIndex];
55
+ server.config.plugins.splice(liveDesignerPluginIndex, 1);
56
+ const astroBuildIndex = server.config.plugins.findIndex((plugin) => plugin.name === "astro:build");
57
+ server.config.plugins.splice(astroBuildIndex, 0, liveDesignerPlugin);
58
+ const alias = server.config.resolve.alias.find((alias2) => alias2.find === "@");
59
+ const aliases = server.config.resolve.alias.filter((alias2) => alias2.find !== "@");
60
+ server.config.resolve.alias = [...aliases];
61
+ if (alias) {
62
+ server.config.resolve.alias.push(alias);
63
+ }
64
+ },
25
65
  "astro:build:setup": ({ vite, pages, target }) => {
26
66
  },
27
67
  "astro:build:done": ({ dir, routes }) => {
package/dist/index.js CHANGED
@@ -1,16 +1,41 @@
1
1
  // src/index.ts
2
+ import { mergeConfig } from "vite";
3
+ import Components from "unplugin-vue-components/vite";
4
+ import path from "path";
2
5
  async function getViteConfiguration(moduleOptions) {
6
+ var _a, _b, _c, _d;
3
7
  let vitePlugin;
4
8
  try {
5
9
  const { liveDesigner } = await import("./live-designer-LATOGT4K.js");
6
- vitePlugin = liveDesigner(moduleOptions == null ? void 0 : moduleOptions.liveDesigner);
10
+ vitePlugin = liveDesigner({ ...(moduleOptions == null ? void 0 : moduleOptions.liveDesigner) || {}, mappingType: "type3" });
7
11
  } catch (err) {
8
12
  console.log(err);
9
13
  console.log("Pinegrow: @pinegrow/astro-module was unable to load @pinegrow/vite-plugin live-designer!");
10
14
  }
11
- const config = {
15
+ let config = {
12
16
  plugins: vitePlugin ? [vitePlugin] : []
13
17
  };
18
+ (_a = config.plugins) == null ? void 0 : _a.push(Components({ ...(moduleOptions == null ? void 0 : moduleOptions.autoImportComponents) || {} }));
19
+ const ignoreList = [
20
+ .../* @__PURE__ */ new Set([...((_c = (_b = config == null ? void 0 : config.server) == null ? void 0 : _b.watch) == null ? void 0 : _c.ignored) || [], "**/_pgbackup/**", "**/_pginfo/**", "**/pinegrow.json"])
21
+ ];
22
+ config = mergeConfig(config, {
23
+ server: {
24
+ watch: {
25
+ ignored: ignoreList
26
+ }
27
+ }
28
+ });
29
+ const alias = (_d = config == null ? void 0 : config.resolve) == null ? void 0 : _d.alias;
30
+ if (!alias) {
31
+ config = mergeConfig(config, {
32
+ resolve: {
33
+ alias: {
34
+ "@": path.resolve(config.root || process.cwd(), "./src")
35
+ }
36
+ }
37
+ });
38
+ }
14
39
  return config;
15
40
  }
16
41
  function createIntegration(moduleOptions) {
@@ -22,6 +47,21 @@ function createIntegration(moduleOptions) {
22
47
  vite: await getViteConfiguration(moduleOptions)
23
48
  });
24
49
  },
50
+ "astro:server:setup": ({ server }) => {
51
+ const liveDesignerPluginIndex = server.config.plugins.findIndex(
52
+ (plugin) => plugin.name === "pinegrow:live-designer"
53
+ );
54
+ const liveDesignerPlugin = server.config.plugins[liveDesignerPluginIndex];
55
+ server.config.plugins.splice(liveDesignerPluginIndex, 1);
56
+ const astroBuildIndex = server.config.plugins.findIndex((plugin) => plugin.name === "astro:build");
57
+ server.config.plugins.splice(astroBuildIndex, 0, liveDesignerPlugin);
58
+ const alias = server.config.resolve.alias.find((alias2) => alias2.find === "@");
59
+ const aliases = server.config.resolve.alias.filter((alias2) => alias2.find !== "@");
60
+ server.config.resolve.alias = [...aliases];
61
+ if (alias) {
62
+ server.config.resolve.alias.push(alias);
63
+ }
64
+ },
25
65
  "astro:build:setup": ({ vite, pages, target }) => {
26
66
  },
27
67
  "astro:build:done": ({ dir, routes }) => {
@@ -0,0 +1,8 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }require('./chunk-4NKIVEY7.cjs');
2
+
3
+ // src/live-designer.mjs
4
+ var _viteplugin = require('@pinegrow/vite-plugin'); var _viteplugin2 = _interopRequireDefault(_viteplugin);
5
+ var liveDesigner = _viteplugin2.default.liveDesigner;
6
+
7
+
8
+ exports.liveDesigner = liveDesigner;
@@ -0,0 +1,11 @@
1
+ import {
2
+ init_esm_shims
3
+ } from "./chunk-FOBIONE4.js";
4
+
5
+ // src/live-designer.mjs
6
+ init_esm_shims();
7
+ import pkg from "@pinegrow/vite-plugin";
8
+ var liveDesigner = pkg.liveDesigner;
9
+ export {
10
+ liveDesigner
11
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
+
3
+ var _chunkXPHVRMSYcjs = require('./chunk-XPHVRMSY.cjs');
4
+
5
+ // src/live-designer.mjs
6
+ _chunkXPHVRMSYcjs.init_cjs_shims.call(void 0, );
7
+ var _viteplugin = require('@pinegrow/vite-plugin'); var _viteplugin2 = _interopRequireDefault(_viteplugin);
8
+ var liveDesigner = _viteplugin2.default.liveDesigner;
9
+
10
+
11
+ exports.liveDesigner = liveDesigner;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinegrow/astro-module",
3
- "version": "3.0.0-beta.84",
3
+ "version": "3.0.0-beta.86",
4
4
  "description": "Pinegrow Astro Module",
5
5
  "author": "Pinegrow (http://pinegrow.com/)",
6
6
  "license": "MIT",
@@ -28,7 +28,8 @@
28
28
  "increment-beta-version": "npm version prerelease --preid=beta"
29
29
  },
30
30
  "dependencies": {
31
- "@pinegrow/vite-plugin": "3.0.0-beta.84"
31
+ "@pinegrow/vite-plugin": "3.0.0-beta.86",
32
+ "unplugin-vue-components": "^0.24.1"
32
33
  },
33
34
  "devDependencies": {
34
35
  "astro": "^2.1.5",
@@ -36,7 +37,7 @@
36
37
  "typescript": "^4.4.4"
37
38
  },
38
39
  "peerDependencies": {
39
- "astro": "^2.1.5",
40
- "@astrojs/vue": "^2.1.0"
40
+ "@astrojs/vue": "^2.1.0",
41
+ "astro": "^2.1.5"
41
42
  }
42
43
  }