@common-stack/rollup-vite-utils 6.0.8-alpha.25 → 6.0.8-alpha.26

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,20 +1,28 @@
1
- 'use strict';var fs=require('fs-extra'),path=require('path'),url=require('url');var_documentCurrentScript=typeofdocument!=='undefined'?document.currentScript:null;const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('tools/codegen/setupCommonPackage.cjs', document.baseURI).href)));
2
- const __dirname_ = path.dirname(__filename$1);
1
+ 'use strict';var fs=require('fs-extra'),path=require('path'),url=require('url');var_documentCurrentScript=typeofdocument!=='undefined'?document.currentScript:null;const currentFilename = url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('tools/codegen/setupCommonPackage.cjs', document.baseURI).href)));
2
+ const currentDirname = path.dirname(currentFilename);
3
+ /**
4
+ * Strips template extension from filename
5
+ * @param filename Original filename like 'index.ts.template' or 'package.json.tpl'
6
+ * @returns Filename without template extension
7
+ */
8
+ function stripTemplateExtension(filename) {
9
+ return filename.replace(/\.(template|tpl)$/, '');
10
+ }
3
11
  /**
4
12
  * Clears and re-creates the "common" package directory,
5
13
  * then copies the template content there.
6
14
  *
7
- * Provide optional cdecodeConfig.projectPaths to override defaults.
15
+ * Provide optional projectPaths to override defaults.
8
16
  */
9
17
  function setupCommonPackage(projectPaths = {}) {
10
18
  // Default template path, if none provided in projectPaths
11
19
  const templatePath = projectPaths.templateCommonDir
12
20
  ? path.resolve(projectPaths.templateCommonDir)
13
- : path.join(__dirname_, 'templates/common');
21
+ : path.join(currentDirname, 'templates/common');
14
22
  // Default "common" package output, if none provided
15
23
  const commonPackagePath = projectPaths.commonPackageDir
16
24
  ? path.resolve(projectPaths.commonPackageDir)
17
- : path.join(__dirname_, '../../packages/common');
25
+ : path.join(process.cwd(), 'packages/common');
18
26
  console.log('--- Debug Info (setupCommonPackage) ---');
19
27
  console.log('templatePath:', templatePath);
20
28
  console.log('commonPackagePath:', commonPackagePath);
@@ -28,6 +36,38 @@ function setupCommonPackage(projectPaths = {}) {
28
36
  console.error('Check your config or directory layout.');
29
37
  process.exit(1);
30
38
  }
31
- fs.copySync(templatePath, commonPackagePath, { overwrite: true });
39
+ // Copy with specific options to preserve templates
40
+ fs.copySync(templatePath, commonPackagePath, {
41
+ overwrite: true,
42
+ filter: (src) => {
43
+ // Don't ignore any files in templates directory
44
+ if (src.includes('templates')) {
45
+ return true;
46
+ }
47
+ // Default filtering (ignores node_modules, etc)
48
+ return !src.includes('node_modules');
49
+ },
50
+ // transform: (src, dest) => {
51
+ // // Get the base filename
52
+ // const basename = path.basename(dest);
53
+ // // If it's a template file, rename it by removing the template extension
54
+ // if (basename.endsWith('.template') || basename.endsWith('.tpl')) {
55
+ // const newPath = path.join(path.dirname(dest), stripTemplateExtension(basename));
56
+ // // Move to new path without template extension
57
+ // fs.moveSync(dest, newPath, { overwrite: true });
58
+ // }
59
+ // return undefined; // No content transformation needed
60
+ // },
61
+ });
62
+ // Then rename “.template” or “.tpl” files post-copy (pseudo-code):
63
+ const allCopiedFiles = fs.readdirSync(commonPackagePath);
64
+ allCopiedFiles.forEach((file) => {
65
+ if (file.endsWith('.template') || file.endsWith('.tpl')) {
66
+ const oldPath = path.join(commonPackagePath, file);
67
+ const newName = stripTemplateExtension(file);
68
+ const newPath = path.join(commonPackagePath, newName);
69
+ fs.moveSync(oldPath, newPath, { overwrite: true });
70
+ }
71
+ });
32
72
  console.log('Module generated from template!');
33
73
  }exports.setupCommonPackage=setupCommonPackage;//# sourceMappingURL=setupCommonPackage.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"setupCommonPackage.cjs","sources":["../../../src/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CAAiC,CAAC,CAAC;AACnD"}
@@ -1,7 +1,12 @@
1
+ interface ProjectPaths {
2
+ templateCommonDir?: string;
3
+ commonPackageDir?: string;
4
+ }
1
5
  /**
2
6
  * Clears and re-creates the "common" package directory,
3
7
  * then copies the template content there.
4
8
  *
5
- * Provide optional cdecodeConfig.projectPaths to override defaults.
9
+ * Provide optional projectPaths to override defaults.
6
10
  */
7
- export declare function setupCommonPackage(projectPaths?: any): void;
11
+ export declare function setupCommonPackage(projectPaths?: ProjectPaths): void;
12
+ export {};
@@ -1,20 +1,28 @@
1
- import fs from'fs-extra';import path__default from'path';import {fileURLToPath}from'url';const __filename = fileURLToPath(import.meta.url);
2
- const __dirname_ = path__default.dirname(__filename);
1
+ import fs from'fs-extra';import path__default from'path';import {fileURLToPath}from'url';const currentFilename = fileURLToPath(import.meta.url);
2
+ const currentDirname = path__default.dirname(currentFilename);
3
+ /**
4
+ * Strips template extension from filename
5
+ * @param filename Original filename like 'index.ts.template' or 'package.json.tpl'
6
+ * @returns Filename without template extension
7
+ */
8
+ function stripTemplateExtension(filename) {
9
+ return filename.replace(/\.(template|tpl)$/, '');
10
+ }
3
11
  /**
4
12
  * Clears and re-creates the "common" package directory,
5
13
  * then copies the template content there.
6
14
  *
7
- * Provide optional cdecodeConfig.projectPaths to override defaults.
15
+ * Provide optional projectPaths to override defaults.
8
16
  */
9
17
  function setupCommonPackage(projectPaths = {}) {
10
18
  // Default template path, if none provided in projectPaths
11
19
  const templatePath = projectPaths.templateCommonDir
12
20
  ? path__default.resolve(projectPaths.templateCommonDir)
13
- : path__default.join(__dirname_, 'templates/common');
21
+ : path__default.join(currentDirname, 'templates/common');
14
22
  // Default "common" package output, if none provided
15
23
  const commonPackagePath = projectPaths.commonPackageDir
16
24
  ? path__default.resolve(projectPaths.commonPackageDir)
17
- : path__default.join(__dirname_, '../../packages/common');
25
+ : path__default.join(process.cwd(), 'packages/common');
18
26
  console.log('--- Debug Info (setupCommonPackage) ---');
19
27
  console.log('templatePath:', templatePath);
20
28
  console.log('commonPackagePath:', commonPackagePath);
@@ -28,6 +36,38 @@ function setupCommonPackage(projectPaths = {}) {
28
36
  console.error('Check your config or directory layout.');
29
37
  process.exit(1);
30
38
  }
31
- fs.copySync(templatePath, commonPackagePath, { overwrite: true });
39
+ // Copy with specific options to preserve templates
40
+ fs.copySync(templatePath, commonPackagePath, {
41
+ overwrite: true,
42
+ filter: (src) => {
43
+ // Don't ignore any files in templates directory
44
+ if (src.includes('templates')) {
45
+ return true;
46
+ }
47
+ // Default filtering (ignores node_modules, etc)
48
+ return !src.includes('node_modules');
49
+ },
50
+ // transform: (src, dest) => {
51
+ // // Get the base filename
52
+ // const basename = path.basename(dest);
53
+ // // If it's a template file, rename it by removing the template extension
54
+ // if (basename.endsWith('.template') || basename.endsWith('.tpl')) {
55
+ // const newPath = path.join(path.dirname(dest), stripTemplateExtension(basename));
56
+ // // Move to new path without template extension
57
+ // fs.moveSync(dest, newPath, { overwrite: true });
58
+ // }
59
+ // return undefined; // No content transformation needed
60
+ // },
61
+ });
62
+ // Then rename “.template” or “.tpl” files post-copy (pseudo-code):
63
+ const allCopiedFiles = fs.readdirSync(commonPackagePath);
64
+ allCopiedFiles.forEach((file) => {
65
+ if (file.endsWith('.template') || file.endsWith('.tpl')) {
66
+ const oldPath = path__default.join(commonPackagePath, file);
67
+ const newName = stripTemplateExtension(file);
68
+ const newPath = path__default.join(commonPackagePath, newName);
69
+ fs.moveSync(oldPath, newPath, { overwrite: true });
70
+ }
71
+ });
32
72
  console.log('Module generated from template!');
33
73
  }export{setupCommonPackage};//# sourceMappingURL=setupCommonPackage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setupCommonPackage.js","sources":["../../../src/tools/codegen/setupCommonPackage.ts"],"sourcesContent":[null],"names":["path"],"mappings":"yFAIA,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,UAAU,GAAGA,aAAI,CAAC,OA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 "license": "ISC",
7
+ "author": "CDMBase LLC",
8
+ "type": "module",
9
+ "main": "lib/index.js",
10
+ "module": "lib/index.js",
11
+ "typings": "lib/index.d.ts",
12
+ "scripts": {
13
+ "build": "npm run build:clean && npm run build:lib",
14
+ "build:clean": "rimraf lib",
15
+ "build:lib": "rollup -c rollup.config.mjs",
16
+ "build:lib:watch": "npm run build:lib -- -w",
17
+ "watch": "npm run build:lib:watch"
18
+ },
19
+ "devDependencies": {
20
+ "rollup-plugin-multi-input": "1.5.0"
21
+ },
22
+ "typescript": {
23
+ "definition": "lib/index.d.ts"
24
+ }
25
+ }
@@ -0,0 +1,32 @@
1
+ import { createRollupConfig } from '../../rollup.config.base.mjs';
2
+ import multiInput from 'rollup-plugin-multi-input';
3
+
4
+ const additionalPlugins = [multiInput()];
5
+ // Use the createRollupConfig function to merge the base and specific configurations
6
+ export default (commandLineArgs) => {
7
+ const isWatchMode = commandLineArgs.watch;
8
+ return [
9
+ createRollupConfig(
10
+ {
11
+ input: ['src/**/*.{ts,tsx}'],
12
+ plugins: [
13
+ // Spread in additional plugins specific to this config
14
+ ...additionalPlugins,
15
+ ],
16
+ output: [
17
+ {
18
+ dir: 'lib',
19
+ format: 'es',
20
+ name: 'common',
21
+ compact: true,
22
+ exports: 'named',
23
+ sourcemap: true,
24
+ preserveModules: true,
25
+ chunkFileNames: '[name]-[hash].[format].js',
26
+ },
27
+ ],
28
+ },
29
+ isWatchMode,
30
+ ),
31
+ ];
32
+ };
@@ -1,3 +1,4 @@
1
+ //@ts-nocheck
1
2
  import { DataProxy } from '@apollo/client/cache';
2
3
  import { ApolloClient } from '@apollo/client/index.js';
3
4
  import { CdmLogger } from '@cdm-logger/core';
@@ -10,6 +11,7 @@ import { IUserContext, IUserProfile, IIAuth0Token, IAuthStrategyEnum } from './g
10
11
  * @export
11
12
  * @interface MyContext
12
13
  */
14
+
13
15
  export interface ClientContext {
14
16
  /**
15
17
  * Only application on the client side
@@ -18,18 +20,16 @@ export interface ClientContext {
18
20
  /**
19
21
  * Only application on the client side
20
22
  */
21
- getCacheKey: (options: {
22
- __typename: string;
23
- id?: string;
24
- }) => string;
23
+ getCacheKey: (options: { __typename: string; id?: string }) => string;
25
24
  /**
26
25
  * Only applicable on the client side
27
26
  */
28
- apolloClient: ApolloClient<any>;
27
+ apolloClient: ApolloClient<any>; // deprecated use `client` instead
29
28
  client: ApolloClient<any>;
30
29
  }
31
- export interface IDataSources {
32
- }
30
+
31
+ export interface IDataSources {}
32
+
33
33
  export interface IHttpMiddlewareContext {
34
34
  req?: express.Request & {
35
35
  authStrategy: IAuthStrategyEnum | string;
@@ -55,5 +55,4 @@ export interface ServerContext extends IHttpMiddlewareContext {
55
55
  preferences: IPreferncesTransformed[];
56
56
  accountService?: any;
57
57
  }
58
- export interface MyContext extends ClientContext, ServerContext {
59
- }
58
+ export interface MyContext extends ClientContext, ServerContext {}
@@ -1,4 +1,4 @@
1
- export declare const enum ConfigurationTarget {
1
+ export const enum ConfigurationTarget {
2
2
  /**
3
3
  * Targets the user/application configuraton file for writing.
4
4
  */
@@ -6,27 +6,27 @@ export declare const enum ConfigurationTarget {
6
6
  /**
7
7
  * Targets the application configuration file for writing.
8
8
  */
9
- APPLICATION = 2,
9
+ APPLICATION,
10
10
  /**
11
11
  * Targets the machine configuration file for writing. This only works if a machine is opened.
12
12
  */
13
- MACHINE = 3,
13
+ MACHINE,
14
14
  /**
15
15
  * Targets the organization configuration file for writing. This only works if organization is opened.
16
16
  */
17
- ORGANIZATION = 4,
17
+ ORGANIZATION,
18
18
  /**
19
19
  * Targets the resource configuration file for writing. This only works if a organization is opened.
20
20
  */
21
- ORGANIZATION_RESOURCE = 5,
22
- DEFAULT = 6,
23
- MEMORY = 7,
21
+ ORGANIZATION_RESOURCE,
22
+ DEFAULT,
23
+ MEMORY,
24
24
  /**
25
25
  * Resource specific configuration that can be configured
26
26
  */
27
- RESOURCE_OVERRIDABLE = 8,
27
+ RESOURCE_OVERRIDABLE,
28
28
  /**
29
29
  * Machine specific conifugration that can also be configured
30
30
  */
31
- MACHINE_OVERRIDABLE = 9
31
+ MACHINE_OVERRIDABLE,
32
32
  }
@@ -0,0 +1 @@
1
+ export const DUMMY = 'dummy';
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "target": "es2017",
5
+ "lib": ["es2017"],
6
+ "resolveJsonModule": true,
7
+ "allowSyntheticDefaultImports": true,
8
+ "experimentalDecorators": true,
9
+ "rootDir": "src",
10
+ "outDir": "lib",
11
+ "declaration": true,
12
+ "preserveConstEnums": true,
13
+ "declarationDir": "lib",
14
+ "skipLibCheck": true
15
+ },
16
+ "include": ["src"],
17
+ "exclude": ["../../../node_modules", "node_modules", "lib", "lib", "webpack.config.js", "rollup.config.mjs"]
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common-stack/rollup-vite-utils",
3
- "version": "6.0.8-alpha.25",
3
+ "version": "6.0.8-alpha.26",
4
4
  "description": "Client Module for react app",
5
5
  "homepage": "https://github.com/cdmbase/fullstack-pro#readme",
6
6
  "bugs": {
@@ -56,7 +56,7 @@
56
56
  "publishConfig": {
57
57
  "access": "public"
58
58
  },
59
- "gitHead": "85a5fc143ad3ab347a422ea2f2ea1ebff4ac4474",
59
+ "gitHead": "f9b08c8531a2e8e7fb23635840fc65d4feefabe5",
60
60
  "typescript": {
61
61
  "definition": "lib/index.d.ts"
62
62
  }
@@ -1 +0,0 @@
1
- export declare const DUMMY = "dummy";