@interopio/iocd-cli 0.0.32 โ 0.0.34
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 +758 -72
- package/dist/commands/apps.command.js +1 -1
- package/dist/commands/apps.command.js.map +1 -1
- package/dist/services/config/config.service.js +19 -4
- package/dist/services/config/config.service.js.map +1 -1
- package/dist/services/create.service.js +45 -49
- package/dist/services/create.service.js.map +1 -1
- package/dist/services/installer/electronForge.js +1 -1
- package/dist/services/license.service.js +14 -14
- package/dist/templates/groups/apps/groups/.gitignore.template +23 -23
- package/dist/templates/groups/apps/groups/README.md +15 -15
- package/dist/templates/groups/apps/groups/config/web-group-dev.json +12 -12
- package/dist/templates/groups/apps/groups/index.html +17 -17
- package/dist/templates/groups/apps/groups/iocd.app.json +19 -19
- package/dist/templates/groups/apps/groups/package.json +25 -25
- package/dist/templates/groups/apps/groups/public/manifest.json +24 -24
- package/dist/templates/groups/apps/groups/public/robots.txt +3 -3
- package/dist/templates/groups/apps/groups/src/App.css +38 -38
- package/dist/templates/groups/apps/groups/src/App.tsx +11 -11
- package/dist/templates/groups/apps/groups/src/index.css +13 -13
- package/dist/templates/groups/apps/groups/src/index.tsx +19 -19
- package/dist/templates/groups/apps/groups/vite.config.ts +8 -8
- package/dist/templates/groups/template.json +12 -12
- package/dist/templates/ioconnect-desktop/.github/actions/setup-smctl/action.yml +121 -121
- package/dist/templates/ioconnect-desktop/.github/workflows/build.yml +395 -395
- package/dist/templates/ioconnect-desktop/.gitignore.template +14 -14
- package/dist/templates/ioconnect-desktop/README.md +758 -13
- package/dist/templates/ioconnect-desktop/config/forge.config.js +59 -59
- package/dist/templates/ioconnect-desktop/config/iocd.cli.config.json +16 -42
- package/dist/templates/ioconnect-desktop/config/mac-build/entitlements.mac.plist +44 -44
- package/dist/templates/ioconnect-desktop/config/win-build/template.nuspectemplate +32 -32
- package/dist/templates/ioconnect-desktop/modifications/base/iocd/config/system.json.merge +2 -2
- package/dist/templates/ioconnect-desktop/modifications/base/iocd/config/system.json.merge-autoUpdate +9 -9
- package/dist/templates/ioconnect-desktop/package.json +32 -32
- package/dist/templates/ioconnect-desktop/template.json +6 -6
- package/dist/templates/launchpad/apps/launchpad/.eslintrc.json +3 -3
- package/dist/templates/launchpad/apps/launchpad/.gitignore.template +1 -1
- package/dist/templates/launchpad/apps/launchpad/config/iocd.app.def.dev.json +56 -56
- package/dist/templates/launchpad/apps/launchpad/config/iocd.system.build.json +2 -2
- package/dist/templates/launchpad/apps/launchpad/config/iocd.system.dev.json +2 -2
- package/dist/templates/launchpad/apps/launchpad/index.html +16 -16
- package/dist/templates/launchpad/apps/launchpad/iocd.app.json +27 -27
- package/dist/templates/launchpad/apps/launchpad/package-lock.json +2778 -2778
- package/dist/templates/launchpad/apps/launchpad/package.json +21 -21
- package/dist/templates/launchpad/apps/launchpad/src/app/app.tsx +41 -41
- package/dist/templates/launchpad/apps/launchpad/src/app/constants.ts +27 -27
- package/dist/templates/launchpad/apps/launchpad/src/components/logo.tsx +11 -11
- package/dist/templates/launchpad/apps/launchpad/src/components/main-context-menu.tsx +161 -161
- package/dist/templates/launchpad/apps/launchpad/src/components/notifications-button.tsx +44 -44
- package/dist/templates/launchpad/apps/launchpad/src/main.tsx +6 -6
- package/dist/templates/launchpad/apps/launchpad/src/styles.css +16 -16
- package/dist/templates/launchpad/apps/launchpad/tsconfig.json +10 -10
- package/dist/templates/launchpad/apps/launchpad/vite.config.ts +13 -13
- package/dist/templates/launchpad/template.json +12 -12
- package/dist/templates/splash/apps/splash/assets/styles/style.css +39 -39
- package/dist/templates/splash/apps/splash/iocd.app.json +7 -7
- package/dist/templates/splash/apps/splash/script.js +53 -53
- package/dist/templates/splash/apps/splash/splash.html +25 -25
- package/dist/templates/splash/template.json +12 -12
- package/dist/templates/tests/template.json +8 -8
- package/dist/templates/tests/tests/interopio-wdio-iocd-service-0.1.0.tgz +0 -0
- package/dist/templates/tests/tests/package-lock.json +7283 -7283
- package/dist/templates/tests/tests/package.json +22 -22
- package/dist/templates/tests/tests/tests/sample.spec.ts +30 -30
- package/dist/templates/tests/tests/tsconfig.json +10 -10
- package/dist/templates/tests/tests/wdio.config.ts +32 -32
- package/dist/templates/workspaces/apps/workspaces/README.md +15 -15
- package/dist/templates/workspaces/apps/workspaces/config/workspaces-dev.json +20 -20
- package/dist/templates/workspaces/apps/workspaces/index.html +17 -17
- package/dist/templates/workspaces/apps/workspaces/iocd.app.json +19 -19
- package/dist/templates/workspaces/apps/workspaces/package.json +29 -29
- package/dist/templates/workspaces/apps/workspaces/public/manifest.json +25 -25
- package/dist/templates/workspaces/apps/workspaces/public/robots.txt +3 -3
- package/dist/templates/workspaces/apps/workspaces/src/App.css +38 -38
- package/dist/templates/workspaces/apps/workspaces/src/App.tsx +102 -102
- package/dist/templates/workspaces/apps/workspaces/src/index.css +3 -3
- package/dist/templates/workspaces/apps/workspaces/src/index.tsx +28 -28
- package/dist/templates/workspaces/apps/workspaces/src/logo.svg +7 -7
- package/dist/templates/workspaces/apps/workspaces/src/reportWebVitals.ts +15 -15
- package/dist/templates/workspaces/apps/workspaces/src/setupTests.ts +5 -5
- package/dist/templates/workspaces/apps/workspaces/vite.config.ts +8 -8
- package/dist/templates/workspaces/template.json +12 -12
- package/package.json +83 -83
- package/scripts/copy-assets.js +19 -15
- package/scripts/delete-dist.js +12 -12
- package/scripts/generate-schema.js +50 -50
- package/scripts/handle-gitignore-templates.js +157 -157
- package/dist/templates/ioconnect-desktop/.env.example +0 -35
- package/dist/templates/ioconnect-desktop/modifications/base/iocd/assets/images/logo.icns +0 -0
- package/dist/templates/ioconnect-desktop/modifications/base/iocd/assets/images/logo.ico +0 -0
- package/dist/templates/ioconnect-desktop/modifications/base/iocd/assets/images/logo.png +0 -0
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { execSync } = require('child_process');
|
|
4
|
-
const fs = require('fs');
|
|
5
|
-
const path = require('path');
|
|
6
|
-
|
|
7
|
-
console.log('Generating JSON schema from CliConfig interface...');
|
|
8
|
-
|
|
9
|
-
const schemaDir = path.join(__dirname, '..', 'dist', 'schemas');
|
|
10
|
-
const schemaFile = path.join(schemaDir, 'iocd.cli.config.schema.json');
|
|
11
|
-
|
|
12
|
-
// Ensure the schemas directory exists
|
|
13
|
-
if (!fs.existsSync(schemaDir)) {
|
|
14
|
-
fs.mkdirSync(schemaDir, { recursive: true });
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
// Generate schema using typescript-json-schema
|
|
19
|
-
// Point directly to the source file to avoid compilation issues
|
|
20
|
-
execSync(
|
|
21
|
-
`npx typescript-json-schema ./src/services/config/cli.config.ts CliConfig --required --noExtraProps --out ${schemaFile}`,
|
|
22
|
-
{
|
|
23
|
-
cwd: path.join(__dirname, '..'),
|
|
24
|
-
stdio: 'inherit'
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
// Read the generated schema
|
|
29
|
-
const schema = JSON.parse(fs.readFileSync(schemaFile, 'utf8'));
|
|
30
|
-
|
|
31
|
-
// Add metadata at the beginning, preserving proper order
|
|
32
|
-
const enhancedSchema = {
|
|
33
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
34
|
-
"$id": "https://unpkg.com/@interopio/iocd-cli/schemas/iocd.cli.config.schema.json",
|
|
35
|
-
"title": "io.Connect Desktop CLI Configuration",
|
|
36
|
-
"description": "Configuration schema for io.Connect Desktop CLI projects",
|
|
37
|
-
"additionalProperties": schema.additionalProperties,
|
|
38
|
-
"properties": schema.properties,
|
|
39
|
-
"required": schema.required,
|
|
40
|
-
"type": schema.type || "object"
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
// Write back the updated schema
|
|
44
|
-
fs.writeFileSync(schemaFile, JSON.stringify(enhancedSchema, null, 2));
|
|
45
|
-
|
|
46
|
-
console.log('โ
JSON schema generated successfully at:', schemaFile);
|
|
47
|
-
} catch (error) {
|
|
48
|
-
console.error('โ Error generating JSON schema:', error.message);
|
|
49
|
-
process.exit(1);
|
|
50
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execSync } = require('child_process');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
console.log('Generating JSON schema from CliConfig interface...');
|
|
8
|
+
|
|
9
|
+
const schemaDir = path.join(__dirname, '..', 'dist', 'schemas');
|
|
10
|
+
const schemaFile = path.join(schemaDir, 'iocd.cli.config.schema.json');
|
|
11
|
+
|
|
12
|
+
// Ensure the schemas directory exists
|
|
13
|
+
if (!fs.existsSync(schemaDir)) {
|
|
14
|
+
fs.mkdirSync(schemaDir, { recursive: true });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
// Generate schema using typescript-json-schema
|
|
19
|
+
// Point directly to the source file to avoid compilation issues
|
|
20
|
+
execSync(
|
|
21
|
+
`npx typescript-json-schema ./src/services/config/cli.config.ts CliConfig --required --noExtraProps --out ${schemaFile}`,
|
|
22
|
+
{
|
|
23
|
+
cwd: path.join(__dirname, '..'),
|
|
24
|
+
stdio: 'inherit'
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
// Read the generated schema
|
|
29
|
+
const schema = JSON.parse(fs.readFileSync(schemaFile, 'utf8'));
|
|
30
|
+
|
|
31
|
+
// Add metadata at the beginning, preserving proper order
|
|
32
|
+
const enhancedSchema = {
|
|
33
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
34
|
+
"$id": "https://unpkg.com/@interopio/iocd-cli/schemas/iocd.cli.config.schema.json",
|
|
35
|
+
"title": "io.Connect Desktop CLI Configuration",
|
|
36
|
+
"description": "Configuration schema for io.Connect Desktop CLI projects",
|
|
37
|
+
"additionalProperties": schema.additionalProperties,
|
|
38
|
+
"properties": schema.properties,
|
|
39
|
+
"required": schema.required,
|
|
40
|
+
"type": schema.type || "object"
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// Write back the updated schema
|
|
44
|
+
fs.writeFileSync(schemaFile, JSON.stringify(enhancedSchema, null, 2));
|
|
45
|
+
|
|
46
|
+
console.log('โ
JSON schema generated successfully at:', schemaFile);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error('โ Error generating JSON schema:', error.message);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
@@ -1,158 +1,158 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Script to handle .gitignore template files for npm packaging
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* - npm run pre-package: Copies .gitignore files to .gitignore.template
|
|
11
|
-
* - npm run post-publish: Removes .gitignore.template files
|
|
12
|
-
* - npm run post-install: Renames .gitignore.template back to .gitignore
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
const templatesDir = path.join(__dirname, '..', 'src', 'templates');
|
|
16
|
-
const distTemplatesDir = path.join(__dirname, '..', 'dist', 'templates');
|
|
17
|
-
|
|
18
|
-
function findGitignoreFiles(dir) {
|
|
19
|
-
const gitignoreFiles = [];
|
|
20
|
-
|
|
21
|
-
function walk(currentDir) {
|
|
22
|
-
if (!fs.existsSync(currentDir)) return;
|
|
23
|
-
|
|
24
|
-
const files = fs.readdirSync(currentDir);
|
|
25
|
-
|
|
26
|
-
for (const file of files) {
|
|
27
|
-
const filePath = path.join(currentDir, file);
|
|
28
|
-
const stat = fs.statSync(filePath);
|
|
29
|
-
|
|
30
|
-
if (stat.isDirectory()) {
|
|
31
|
-
walk(filePath);
|
|
32
|
-
} else if (file === '.gitignore') {
|
|
33
|
-
gitignoreFiles.push(filePath);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
walk(dir);
|
|
39
|
-
return gitignoreFiles;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function findGitignoreTemplateFiles(dir) {
|
|
43
|
-
const templateFiles = [];
|
|
44
|
-
|
|
45
|
-
function walk(currentDir) {
|
|
46
|
-
if (!fs.existsSync(currentDir)) return;
|
|
47
|
-
|
|
48
|
-
const files = fs.readdirSync(currentDir);
|
|
49
|
-
|
|
50
|
-
for (const file of files) {
|
|
51
|
-
const filePath = path.join(currentDir, file);
|
|
52
|
-
const stat = fs.statSync(filePath);
|
|
53
|
-
|
|
54
|
-
if (stat.isDirectory()) {
|
|
55
|
-
walk(filePath);
|
|
56
|
-
} else if (file === '.gitignore.template') {
|
|
57
|
-
templateFiles.push(filePath);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
walk(dir);
|
|
63
|
-
return templateFiles;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function copyGitignoreToTemplate() {
|
|
67
|
-
console.log('๐ฆ Pre-package: Converting .gitignore files to .gitignore.template files...');
|
|
68
|
-
|
|
69
|
-
// Handle both src and dist directories
|
|
70
|
-
const directories = [templatesDir, distTemplatesDir];
|
|
71
|
-
let totalFiles = 0;
|
|
72
|
-
|
|
73
|
-
for (const dir of directories) {
|
|
74
|
-
if (!fs.existsSync(dir)) continue;
|
|
75
|
-
|
|
76
|
-
const gitignoreFiles = findGitignoreFiles(dir);
|
|
77
|
-
|
|
78
|
-
for (const gitignoreFile of gitignoreFiles) {
|
|
79
|
-
const templateFile = gitignoreFile + '.template';
|
|
80
|
-
|
|
81
|
-
try {
|
|
82
|
-
fs.copyFileSync(gitignoreFile, templateFile);
|
|
83
|
-
console.log(`โ
Copied: ${path.relative(process.cwd(), gitignoreFile)} โ ${path.relative(process.cwd(), templateFile)}`);
|
|
84
|
-
totalFiles++;
|
|
85
|
-
} catch (error) {
|
|
86
|
-
console.error(`โ Failed to copy ${gitignoreFile}:`, error.message);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
console.log(`๐ฆ Pre-package complete: ${totalFiles} .gitignore files converted to .template files`);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
function removeTemplateFiles() {
|
|
95
|
-
console.log('๐งน Post-publish: Removing .gitignore.template files...');
|
|
96
|
-
|
|
97
|
-
// Handle both src and dist directories
|
|
98
|
-
const directories = [templatesDir, distTemplatesDir];
|
|
99
|
-
let totalFiles = 0;
|
|
100
|
-
|
|
101
|
-
for (const dir of directories) {
|
|
102
|
-
if (!fs.existsSync(dir)) continue;
|
|
103
|
-
|
|
104
|
-
const templateFiles = findGitignoreTemplateFiles(dir);
|
|
105
|
-
|
|
106
|
-
for (const templateFile of templateFiles) {
|
|
107
|
-
try {
|
|
108
|
-
fs.unlinkSync(templateFile);
|
|
109
|
-
console.log(`๐๏ธ Removed: ${path.relative(process.cwd(), templateFile)}`);
|
|
110
|
-
totalFiles++;
|
|
111
|
-
} catch (error) {
|
|
112
|
-
console.error(`โ Failed to remove ${templateFile}:`, error.message);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
console.log(`๐งน Post-publish complete: ${totalFiles} .gitignore.template files removed`);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function convertTemplateToGitignore() {
|
|
121
|
-
console.log('๐ Post-install: Converting .gitignore.template files back to .gitignore...');
|
|
122
|
-
|
|
123
|
-
// Only handle dist directory for post-install
|
|
124
|
-
const templateFiles = findGitignoreTemplateFiles(distTemplatesDir);
|
|
125
|
-
let totalFiles = 0;
|
|
126
|
-
|
|
127
|
-
for (const templateFile of templateFiles) {
|
|
128
|
-
const gitignoreFile = templateFile.replace('.template', '');
|
|
129
|
-
|
|
130
|
-
try {
|
|
131
|
-
fs.renameSync(templateFile, gitignoreFile);
|
|
132
|
-
console.log(`โ
Converted: ${path.relative(process.cwd(), templateFile)} โ ${path.relative(process.cwd(), gitignoreFile)}`);
|
|
133
|
-
totalFiles++;
|
|
134
|
-
} catch (error) {
|
|
135
|
-
console.error(`โ Failed to convert ${templateFile}:`, error.message);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
console.log(`๐ Post-install complete: ${totalFiles} .gitignore.template files converted back to .gitignore`);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Parse command line arguments
|
|
143
|
-
const command = process.argv[2];
|
|
144
|
-
|
|
145
|
-
switch (command) {
|
|
146
|
-
case 'pre-package':
|
|
147
|
-
copyGitignoreToTemplate();
|
|
148
|
-
break;
|
|
149
|
-
case 'post-publish':
|
|
150
|
-
removeTemplateFiles();
|
|
151
|
-
break;
|
|
152
|
-
case 'post-install':
|
|
153
|
-
convertTemplateToGitignore();
|
|
154
|
-
break;
|
|
155
|
-
default:
|
|
156
|
-
console.error('Usage: node handle-gitignore-templates.js <pre-package|post-publish|post-install>');
|
|
157
|
-
process.exit(1);
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Script to handle .gitignore template files for npm packaging
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* - npm run pre-package: Copies .gitignore files to .gitignore.template
|
|
11
|
+
* - npm run post-publish: Removes .gitignore.template files
|
|
12
|
+
* - npm run post-install: Renames .gitignore.template back to .gitignore
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const templatesDir = path.join(__dirname, '..', 'src', 'templates');
|
|
16
|
+
const distTemplatesDir = path.join(__dirname, '..', 'dist', 'templates');
|
|
17
|
+
|
|
18
|
+
function findGitignoreFiles(dir) {
|
|
19
|
+
const gitignoreFiles = [];
|
|
20
|
+
|
|
21
|
+
function walk(currentDir) {
|
|
22
|
+
if (!fs.existsSync(currentDir)) return;
|
|
23
|
+
|
|
24
|
+
const files = fs.readdirSync(currentDir);
|
|
25
|
+
|
|
26
|
+
for (const file of files) {
|
|
27
|
+
const filePath = path.join(currentDir, file);
|
|
28
|
+
const stat = fs.statSync(filePath);
|
|
29
|
+
|
|
30
|
+
if (stat.isDirectory()) {
|
|
31
|
+
walk(filePath);
|
|
32
|
+
} else if (file === '.gitignore') {
|
|
33
|
+
gitignoreFiles.push(filePath);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
walk(dir);
|
|
39
|
+
return gitignoreFiles;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function findGitignoreTemplateFiles(dir) {
|
|
43
|
+
const templateFiles = [];
|
|
44
|
+
|
|
45
|
+
function walk(currentDir) {
|
|
46
|
+
if (!fs.existsSync(currentDir)) return;
|
|
47
|
+
|
|
48
|
+
const files = fs.readdirSync(currentDir);
|
|
49
|
+
|
|
50
|
+
for (const file of files) {
|
|
51
|
+
const filePath = path.join(currentDir, file);
|
|
52
|
+
const stat = fs.statSync(filePath);
|
|
53
|
+
|
|
54
|
+
if (stat.isDirectory()) {
|
|
55
|
+
walk(filePath);
|
|
56
|
+
} else if (file === '.gitignore.template') {
|
|
57
|
+
templateFiles.push(filePath);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
walk(dir);
|
|
63
|
+
return templateFiles;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function copyGitignoreToTemplate() {
|
|
67
|
+
console.log('๐ฆ Pre-package: Converting .gitignore files to .gitignore.template files...');
|
|
68
|
+
|
|
69
|
+
// Handle both src and dist directories
|
|
70
|
+
const directories = [templatesDir, distTemplatesDir];
|
|
71
|
+
let totalFiles = 0;
|
|
72
|
+
|
|
73
|
+
for (const dir of directories) {
|
|
74
|
+
if (!fs.existsSync(dir)) continue;
|
|
75
|
+
|
|
76
|
+
const gitignoreFiles = findGitignoreFiles(dir);
|
|
77
|
+
|
|
78
|
+
for (const gitignoreFile of gitignoreFiles) {
|
|
79
|
+
const templateFile = gitignoreFile + '.template';
|
|
80
|
+
|
|
81
|
+
try {
|
|
82
|
+
fs.copyFileSync(gitignoreFile, templateFile);
|
|
83
|
+
console.log(`โ
Copied: ${path.relative(process.cwd(), gitignoreFile)} โ ${path.relative(process.cwd(), templateFile)}`);
|
|
84
|
+
totalFiles++;
|
|
85
|
+
} catch (error) {
|
|
86
|
+
console.error(`โ Failed to copy ${gitignoreFile}:`, error.message);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
console.log(`๐ฆ Pre-package complete: ${totalFiles} .gitignore files converted to .template files`);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function removeTemplateFiles() {
|
|
95
|
+
console.log('๐งน Post-publish: Removing .gitignore.template files...');
|
|
96
|
+
|
|
97
|
+
// Handle both src and dist directories
|
|
98
|
+
const directories = [templatesDir, distTemplatesDir];
|
|
99
|
+
let totalFiles = 0;
|
|
100
|
+
|
|
101
|
+
for (const dir of directories) {
|
|
102
|
+
if (!fs.existsSync(dir)) continue;
|
|
103
|
+
|
|
104
|
+
const templateFiles = findGitignoreTemplateFiles(dir);
|
|
105
|
+
|
|
106
|
+
for (const templateFile of templateFiles) {
|
|
107
|
+
try {
|
|
108
|
+
fs.unlinkSync(templateFile);
|
|
109
|
+
console.log(`๐๏ธ Removed: ${path.relative(process.cwd(), templateFile)}`);
|
|
110
|
+
totalFiles++;
|
|
111
|
+
} catch (error) {
|
|
112
|
+
console.error(`โ Failed to remove ${templateFile}:`, error.message);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
console.log(`๐งน Post-publish complete: ${totalFiles} .gitignore.template files removed`);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function convertTemplateToGitignore() {
|
|
121
|
+
console.log('๐ Post-install: Converting .gitignore.template files back to .gitignore...');
|
|
122
|
+
|
|
123
|
+
// Only handle dist directory for post-install
|
|
124
|
+
const templateFiles = findGitignoreTemplateFiles(distTemplatesDir);
|
|
125
|
+
let totalFiles = 0;
|
|
126
|
+
|
|
127
|
+
for (const templateFile of templateFiles) {
|
|
128
|
+
const gitignoreFile = templateFile.replace('.template', '');
|
|
129
|
+
|
|
130
|
+
try {
|
|
131
|
+
fs.renameSync(templateFile, gitignoreFile);
|
|
132
|
+
console.log(`โ
Converted: ${path.relative(process.cwd(), templateFile)} โ ${path.relative(process.cwd(), gitignoreFile)}`);
|
|
133
|
+
totalFiles++;
|
|
134
|
+
} catch (error) {
|
|
135
|
+
console.error(`โ Failed to convert ${templateFile}:`, error.message);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
console.log(`๐ Post-install complete: ${totalFiles} .gitignore.template files converted back to .gitignore`);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Parse command line arguments
|
|
143
|
+
const command = process.argv[2];
|
|
144
|
+
|
|
145
|
+
switch (command) {
|
|
146
|
+
case 'pre-package':
|
|
147
|
+
copyGitignoreToTemplate();
|
|
148
|
+
break;
|
|
149
|
+
case 'post-publish':
|
|
150
|
+
removeTemplateFiles();
|
|
151
|
+
break;
|
|
152
|
+
case 'post-install':
|
|
153
|
+
convertTemplateToGitignore();
|
|
154
|
+
break;
|
|
155
|
+
default:
|
|
156
|
+
console.error('Usage: node handle-gitignore-templates.js <pre-package|post-publish|post-install>');
|
|
157
|
+
process.exit(1);
|
|
158
158
|
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
###
|
|
2
|
-
# Windows Code Signing Options
|
|
3
|
-
###
|
|
4
|
-
# SignTool Code Signing Options (PFX or Certificate Store), WIN_CODE_SIGNING_TYPE must be set to 'signtool'
|
|
5
|
-
WIN_PFX_PATH=
|
|
6
|
-
WIN_PFX_PASS=
|
|
7
|
-
|
|
8
|
-
# Custom Code Signing Options, WIN_CODE_SIGNING_TYPE must be set to 'custom'
|
|
9
|
-
WIN_CUSTOM_CODE_SIGNING=
|
|
10
|
-
|
|
11
|
-
# Timestamping server URL (optional, defaults to DigiCert)
|
|
12
|
-
TSA_URL=http://timestamp.digicert.com
|
|
13
|
-
|
|
14
|
-
# Sign all binaries (exe, dll) for better SmartScreen reputation (optional, defaults to false)
|
|
15
|
-
SIGN_ALL_BINARIES=true
|
|
16
|
-
|
|
17
|
-
###
|
|
18
|
-
# MacOS Code Signing & Notarization Options
|
|
19
|
-
# Required for distribution outside Mac App Store
|
|
20
|
-
###
|
|
21
|
-
|
|
22
|
-
# Your Apple ID email (must be enrolled in Apple Developer Program)
|
|
23
|
-
MAC_NOTARIZATION_APPLE_ID=your.email@example.com
|
|
24
|
-
|
|
25
|
-
# App-specific password (NOT your regular Apple ID password)
|
|
26
|
-
# Generate at: https://appleid.apple.com/account/manage
|
|
27
|
-
# See: https://support.apple.com/en-us/102654
|
|
28
|
-
MAC_NOTARIZATION_APPLE_ID_PASSWORD=your-app-specific-password
|
|
29
|
-
|
|
30
|
-
# Your Apple Developer Team ID (found in Apple Developer account)
|
|
31
|
-
MAC_NOTARIZATION_APPLE_TEAM_ID=ABCD123456
|
|
32
|
-
|
|
33
|
-
# Optional: Specify code signing identity (auto-detected if not set)
|
|
34
|
-
# Example: "Developer ID Application: Your Name (TEAM123456)"
|
|
35
|
-
# MAC_CODE_SIGNING_IDENTITY=
|
|
Binary file
|
|
Binary file
|