@dative-gpi/foundation-shared-loader 0.0.174 → 0.0.175

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.
@@ -1,4 +1,4 @@
1
- export declare function generateImports(source: string, skipShared: boolean, skipCore: boolean, skipAdmin: boolean, skipExtension: boolean): {
1
+ export declare function generateImports(source: string, skipShared: boolean, skipCore: boolean, skipAdmin: boolean): {
2
2
  code: string;
3
3
  source: string;
4
4
  };
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generateImports = void 0;
4
4
  const getImports_1 = require("./getImports");
5
- function generateImports(source, skipShared, skipCore, skipAdmin, skipExtension) {
6
- const { imports, components, directives } = (0, getImports_1.getImports)(source, skipShared, skipCore, skipAdmin, skipExtension);
5
+ function generateImports(source, skipShared, skipCore, skipAdmin) {
6
+ const { imports, components, directives } = (0, getImports_1.getImports)(source, skipShared, skipCore, skipAdmin);
7
7
  let code = '';
8
8
  if (components.length || directives.length) {
9
9
  code += '\n\n/* Foundation */\n';
@@ -1,5 +1,5 @@
1
1
  import { type TemplateMatch } from './parseTemplate';
2
- export declare function getImports(source: string, skipShared: boolean, skipCore: boolean, skipAdmin: boolean, skipExtension: boolean): {
2
+ export declare function getImports(source: string, skipShared: boolean, skipCore: boolean, skipAdmin: boolean): {
3
3
  imports: Map<string, string[]>;
4
4
  components: TemplateMatch[];
5
5
  directives: TemplateMatch[];
@@ -28,7 +28,7 @@ const parseTemplate_1 = require("./parseTemplate");
28
28
  const sharedImportMap = __importStar(require("./mapping/foundation-shared-components-imports-map.json"));
29
29
  const coreImportMap = __importStar(require("./mapping/foundation-core-components-imports-map.json"));
30
30
  const adminImportMap = __importStar(require("./mapping/foundation-admin-components-imports-map.json"));
31
- function getImports(source, skipShared, skipCore, skipAdmin, skipExtension) {
31
+ function getImports(source, skipShared, skipCore, skipAdmin) {
32
32
  const { components, directives } = (0, parseTemplate_1.parseTemplate)(source);
33
33
  const resolvedComponents = [];
34
34
  const resolvedDirectives = [];
@@ -1,2 +1,2 @@
1
1
  import type { Plugin } from 'vite';
2
- export declare function importPlugin(skipShared: boolean, skipCore: boolean, skipAdmin: boolean, skipExtension: boolean): Plugin;
2
+ export declare function importPlugin(skipShared: boolean, skipCore: boolean, skipAdmin: boolean): Plugin;
@@ -11,7 +11,7 @@ function parseId(id) {
11
11
  path: pathname ?? id
12
12
  };
13
13
  }
14
- function importPlugin(skipShared, skipCore, skipAdmin, skipExtension) {
14
+ function importPlugin(skipShared, skipCore, skipAdmin) {
15
15
  return {
16
16
  name: 'foundation:import',
17
17
  configResolved(config) {
@@ -23,7 +23,7 @@ function importPlugin(skipShared, skipCore, skipAdmin, skipExtension) {
23
23
  const { query, path } = parseId(id);
24
24
  if (((!query || !('vue' in query)) && (0, path_1.extname)(path) === '.vue' && !/^import { render as _sfc_render } from ".*"$/m.test(code)) ||
25
25
  (query && 'vue' in query && (query.type === 'template' || (query.type === 'script' && query.setup === 'true')))) {
26
- const { code: imports, source } = (0, generateImports_1.generateImports)(code, skipShared, skipCore, skipAdmin, skipExtension);
26
+ const { code: imports, source } = (0, generateImports_1.generateImports)(code, skipShared, skipCore, skipAdmin);
27
27
  return {
28
28
  code: source + imports,
29
29
  map: null,
package/dist/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- import { Plugin } from 'vite';
2
- declare function FoundationSharedAutoImport({ skipShared, skipCore, skipAdmin, skipExtension }?: {
1
+ import type { Plugin } from 'vite';
2
+ declare function FoundationSharedAutoImport({ skipShared, skipCore, skipAdmin }?: {
3
3
  skipShared?: boolean;
4
4
  skipCore?: boolean;
5
5
  skipAdmin?: boolean;
6
- skipExtension?: boolean;
7
6
  }): Plugin[];
8
7
  export default FoundationSharedAutoImport;
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const importPlugin_1 = require("./importPlugin");
4
- function FoundationSharedAutoImport({ skipShared = false, skipCore = false, skipAdmin = false, skipExtension = false } = {}) {
4
+ function FoundationSharedAutoImport({ skipShared = false, skipCore = false, skipAdmin = false } = {}) {
5
5
  const plugins = [];
6
- plugins.push((0, importPlugin_1.importPlugin)(skipShared, skipCore, skipAdmin, skipExtension));
6
+ plugins.push((0, importPlugin_1.importPlugin)(skipShared, skipCore, skipAdmin));
7
7
  return plugins;
8
8
  }
9
9
  module.exports = FoundationSharedAutoImport;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-loader",
3
- "version": "0.0.174",
3
+ "version": "0.0.175",
4
4
  "main": "dist/index.js",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -23,5 +23,5 @@
23
23
  "vite": "5.1.4",
24
24
  "vue": "3.4.29"
25
25
  },
26
- "gitHead": "11d324c6ab6a15383e6a10672917f769e35a541f"
26
+ "gitHead": "6936d9e48fd85e5a17322b8d9e0b2f59cca28d70"
27
27
  }
@@ -1,7 +1,7 @@
1
1
  import { getImports } from './getImports'
2
2
 
3
- export function generateImports (source: string, skipShared: boolean, skipCore: boolean, skipAdmin: boolean, skipExtension: boolean) {
4
- const { imports, components, directives } = getImports(source, skipShared, skipCore, skipAdmin, skipExtension)
3
+ export function generateImports (source: string, skipShared: boolean, skipCore: boolean, skipAdmin: boolean) {
4
+ const { imports, components, directives } = getImports(source, skipShared, skipCore, skipAdmin)
5
5
 
6
6
  let code = ''
7
7
 
@@ -3,7 +3,7 @@ import * as sharedImportMap from './mapping/foundation-shared-components-imports
3
3
  import * as coreImportMap from './mapping/foundation-core-components-imports-map.json'
4
4
  import * as adminImportMap from './mapping/foundation-admin-components-imports-map.json'
5
5
 
6
- export function getImports (source: string, skipShared: boolean, skipCore: boolean, skipAdmin: boolean, skipExtension: boolean) {
6
+ export function getImports (source: string, skipShared: boolean, skipCore: boolean, skipAdmin: boolean) {
7
7
  const { components, directives } = parseTemplate(source)
8
8
  const resolvedComponents: TemplateMatch[] = []
9
9
  const resolvedDirectives: TemplateMatch[] = []
@@ -12,7 +12,7 @@ function parseId(id: string) {
12
12
  }
13
13
  }
14
14
 
15
- export function importPlugin(skipShared: boolean, skipCore: boolean, skipAdmin: boolean, skipExtension: boolean): Plugin {
15
+ export function importPlugin(skipShared: boolean, skipCore: boolean, skipAdmin: boolean): Plugin {
16
16
  return {
17
17
  name: 'foundation:import',
18
18
  configResolved(config) {
@@ -27,7 +27,7 @@ export function importPlugin(skipShared: boolean, skipCore: boolean, skipAdmin:
27
27
  ((!query || !('vue' in query)) && extname(path) === '.vue' && !/^import { render as _sfc_render } from ".*"$/m.test(code)) ||
28
28
  (query && 'vue' in query && (query.type === 'template' || (query.type === 'script' && query.setup === 'true')))
29
29
  ) {
30
- const { code: imports, source } = generateImports(code, skipShared, skipCore, skipAdmin, skipExtension)
30
+ const { code: imports, source } = generateImports(code, skipShared, skipCore, skipAdmin)
31
31
  return {
32
32
  code: source + imports,
33
33
  map: null,
package/plugin/index.ts CHANGED
@@ -1,15 +1,14 @@
1
- import { Plugin } from 'vite'
1
+ import type { Plugin } from 'vite'
2
2
 
3
3
  import { importPlugin } from './importPlugin'
4
4
 
5
5
  function FoundationSharedAutoImport ({
6
6
  skipShared = false,
7
7
  skipCore = false,
8
- skipAdmin = false,
9
- skipExtension = false
8
+ skipAdmin = false
10
9
  } = {}): Plugin[] {
11
10
  const plugins: Plugin[] = []
12
- plugins.push(importPlugin(skipShared, skipCore, skipAdmin, skipExtension))
11
+ plugins.push(importPlugin(skipShared, skipCore, skipAdmin))
13
12
 
14
13
  return plugins
15
14
  }