@typecad/jlcpcb-export 1.0.3 → 2.0.0
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 +111 -37
- package/dist/index.d.ts +21 -0
- package/dist/index.js +326 -0
- package/dist/index.js.map +1 -0
- package/package.json +34 -12
- package/index.ts +0 -113
- package/tsconfig.json +0 -111
package/README.md
CHANGED
|
@@ -1,37 +1,111 @@
|
|
|
1
|
-
# JLCPCB Export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
##
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
# JLCPCB Export
|
|
2
|
+
|
|
3
|
+
CLI tool to generate all files needed for [JLCPCB](https://jlcpcb.com/) assembly from a [typeCAD](https://typecad.net) project.
|
|
4
|
+
|
|
5
|
+
Runs DRC, validates the git repo, then outputs drill, position, gerbers, and BOM files formatted for JLCPCB -- zipped and ready to upload.
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
- A [typeCAD](https://typecad.net) project with a `typecad.conf.ts` file
|
|
10
|
+
- [KiCad](https://www.kicad.org/) installed (the CLI searches common install paths automatically)
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm i @typecad/jlcpcb-export
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or run without installing:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx @typecad/jlcpcb-export
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx jlcpcb-export [board-name] [options]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The board name is auto-detected from the `entry` field in `typecad.conf.ts`. Given:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
export default defineConfig({
|
|
34
|
+
entry: './src/my-board.ts',
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The board name `my-board` is used automatically. You can override it by passing an argument:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx jlcpcb-export other-board
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Options
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
Arguments:
|
|
48
|
+
board-name Board name (auto-detected from typecad.conf.ts if omitted)
|
|
49
|
+
|
|
50
|
+
Options:
|
|
51
|
+
-i, --ignore Ignore DRC failures and dirty git repo
|
|
52
|
+
--input <path> Input build directory (default: ./build)
|
|
53
|
+
--output <path> Output directory (default: ./build/jlcpcb-{version})
|
|
54
|
+
--kicad-cli <path> Path to kicad-cli binary (default: auto-discovered)
|
|
55
|
+
-v, --version Print version
|
|
56
|
+
-h, --help Print help
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### KiCad CLI path
|
|
60
|
+
|
|
61
|
+
The tool searches for `kicad-cli` in common install locations. If it's not found, specify the path via CLI:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npx jlcpcb-export --kicad-cli "/Applications/KiCad/kicad-cli"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Or in `typecad.conf.ts`:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
export default defineConfig({
|
|
71
|
+
entry: './src/my-board.ts',
|
|
72
|
+
kicad_cli: '/Applications/KiCad/kicad-cli',
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Adding to a typeCAD Project
|
|
77
|
+
|
|
78
|
+
To run JLCPCB export automatically after building, add it to your project's `package.json` scripts:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"scripts": {
|
|
83
|
+
"build": "typecad build",
|
|
84
|
+
"export": "jlcpcb-export",
|
|
85
|
+
},
|
|
86
|
+
"devDependencies": {
|
|
87
|
+
"@typecad/jlcpcb-export": "^2.0.0"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Then run:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npm run build && npm run export
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`export` will fail if DRC fails or the git repo has uncommitted changes. Use `export:force` to ignore those checks.
|
|
99
|
+
|
|
100
|
+
## Output
|
|
101
|
+
|
|
102
|
+
All files are written to `./build/jlcpcb-export/<package-slug>-<version>/`:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
build/jlcpcb-export/
|
|
106
|
+
my-project-1.0.0/
|
|
107
|
+
my-board_cpl.csv Component placement list (Pick & Place)
|
|
108
|
+
my-board.csv BOM with JLCPCB part numbers
|
|
109
|
+
gerbers.zip Zipped gerbers + drill file
|
|
110
|
+
gerbers/ Raw gerber and drill files
|
|
111
|
+
```
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export declare function discoverKiCADCli(): string | null;
|
|
3
|
+
export interface CliArgs {
|
|
4
|
+
boardName: string | null;
|
|
5
|
+
ignore: boolean;
|
|
6
|
+
inputPath: string;
|
|
7
|
+
outputPath: string | null;
|
|
8
|
+
kicadCli: string;
|
|
9
|
+
help: boolean;
|
|
10
|
+
version: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function parseArgs(argv: string[]): CliArgs;
|
|
13
|
+
export declare function findConfigPath(): string | null;
|
|
14
|
+
export declare function parseEntryFromConfig(configPath: string): string | null;
|
|
15
|
+
export declare function parseKicadCliFromConfig(configPath: string): string | null;
|
|
16
|
+
export declare function findProjectPackageJson(): {
|
|
17
|
+
name: string;
|
|
18
|
+
version: string;
|
|
19
|
+
} | null;
|
|
20
|
+
export declare function runKiCADCommand(kicadCli: string, commandArgs: string[]): boolean;
|
|
21
|
+
export declare function runGitCommand(args: string[]): string | null;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { execFileSync } from "node:child_process";
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { platform } from 'node:os';
|
|
7
|
+
import { replaceInFileSync } from 'replace-in-file';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import { zip } from 'zip-a-folder';
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = path.dirname(__filename);
|
|
12
|
+
const isMainModule = process.argv[1] && path.resolve(process.argv[1]) === __filename;
|
|
13
|
+
const IS_WIN = platform() === 'win32';
|
|
14
|
+
const KICAD_SEARCH_PATHS = IS_WIN
|
|
15
|
+
? ['C:/Program Files/KiCad/10.0/', 'C:/Program Files/KiCad/9.0/', 'C:/Program Files/KiCad/8.0/']
|
|
16
|
+
: ['/usr/share/kicad/', '/Applications/KiCAD/KiCad.app/Contents/ShareSupport/'];
|
|
17
|
+
export function discoverKiCADCli() {
|
|
18
|
+
for (const searchPath of KICAD_SEARCH_PATHS) {
|
|
19
|
+
const cliPath = IS_WIN
|
|
20
|
+
? path.join(searchPath, 'bin', 'kicad-cli.exe')
|
|
21
|
+
: path.join(searchPath, 'bin', 'kicad-cli');
|
|
22
|
+
if (fs.existsSync(cliPath))
|
|
23
|
+
return cliPath;
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
export function parseArgs(argv) {
|
|
28
|
+
const args = {
|
|
29
|
+
boardName: null,
|
|
30
|
+
ignore: false,
|
|
31
|
+
inputPath: './build',
|
|
32
|
+
outputPath: null,
|
|
33
|
+
kicadCli: 'kicad-cli',
|
|
34
|
+
help: false,
|
|
35
|
+
version: false,
|
|
36
|
+
};
|
|
37
|
+
const tokens = argv.slice(2);
|
|
38
|
+
let i = 0;
|
|
39
|
+
const positional = [];
|
|
40
|
+
while (i < tokens.length) {
|
|
41
|
+
const token = tokens[i];
|
|
42
|
+
if (token === '--help' || token === '-h') {
|
|
43
|
+
args.help = true;
|
|
44
|
+
}
|
|
45
|
+
else if (token === '--version' || token === '-v') {
|
|
46
|
+
args.version = true;
|
|
47
|
+
}
|
|
48
|
+
else if (token === '--ignore' || token === '-i') {
|
|
49
|
+
args.ignore = true;
|
|
50
|
+
}
|
|
51
|
+
else if (token === '--input') {
|
|
52
|
+
const val = tokens[++i];
|
|
53
|
+
if (val !== undefined)
|
|
54
|
+
args.inputPath = val;
|
|
55
|
+
}
|
|
56
|
+
else if (token === '--output') {
|
|
57
|
+
const val = tokens[++i];
|
|
58
|
+
if (val !== undefined)
|
|
59
|
+
args.outputPath = val;
|
|
60
|
+
}
|
|
61
|
+
else if (token === '--kicad-cli') {
|
|
62
|
+
const val = tokens[++i];
|
|
63
|
+
if (val !== undefined)
|
|
64
|
+
args.kicadCli = val;
|
|
65
|
+
}
|
|
66
|
+
else if (!token.startsWith('-')) {
|
|
67
|
+
positional.push(token);
|
|
68
|
+
}
|
|
69
|
+
i++;
|
|
70
|
+
}
|
|
71
|
+
if (positional.length > 0) {
|
|
72
|
+
args.boardName = positional[0];
|
|
73
|
+
}
|
|
74
|
+
return args;
|
|
75
|
+
}
|
|
76
|
+
function printHelp() {
|
|
77
|
+
const pkgPath = path.join(__dirname, '..', 'package.json');
|
|
78
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
79
|
+
console.log(`
|
|
80
|
+
${chalk.bgBlue.white.bold(' JLCPCB Export ')} v${pkg.version}
|
|
81
|
+
|
|
82
|
+
Export all files needed for JLCPCB assembly from a typeCAD project.
|
|
83
|
+
|
|
84
|
+
${chalk.bold('Usage:')}
|
|
85
|
+
jlcpcb-export [board-name] [options]
|
|
86
|
+
|
|
87
|
+
${chalk.bold('Arguments:')}
|
|
88
|
+
board-name Board name (auto-detected from typecad.conf.ts if omitted)
|
|
89
|
+
|
|
90
|
+
${chalk.bold('Options:')}
|
|
91
|
+
-i, --ignore Ignore DRC failures and dirty git repo
|
|
92
|
+
--input <path> Input build directory (default: ./build)
|
|
93
|
+
--output <path> Output directory (default: ./build/jlcpcb-{version})
|
|
94
|
+
--kicad-cli <path> Path to kicad-cli binary (default: kicad-cli)
|
|
95
|
+
-v, --version Print version
|
|
96
|
+
-h, --help Print this help message
|
|
97
|
+
|
|
98
|
+
The board name is auto-detected from the entry field in typecad.conf.ts.
|
|
99
|
+
|
|
100
|
+
${chalk.bold('Examples:')}
|
|
101
|
+
jlcpcb-export
|
|
102
|
+
jlcpcb-export --ignore
|
|
103
|
+
jlcpcb-export --input ./output --kicad-cli "/path/to/kicad-cli"
|
|
104
|
+
`);
|
|
105
|
+
}
|
|
106
|
+
function printVersion() {
|
|
107
|
+
const pkgPath = path.join(__dirname, '..', 'package.json');
|
|
108
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
109
|
+
console.log(pkg.version);
|
|
110
|
+
}
|
|
111
|
+
export function findConfigPath() {
|
|
112
|
+
const cwd = process.cwd();
|
|
113
|
+
const candidates = [
|
|
114
|
+
path.join(cwd, 'typecad.conf.ts'),
|
|
115
|
+
path.join(cwd, 'typecad.conf.js'),
|
|
116
|
+
];
|
|
117
|
+
for (const candidate of candidates) {
|
|
118
|
+
if (fs.existsSync(candidate))
|
|
119
|
+
return candidate;
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
export function parseEntryFromConfig(configPath) {
|
|
124
|
+
try {
|
|
125
|
+
const source = fs.readFileSync(configPath, 'utf8');
|
|
126
|
+
const match = source.match(/entry\s*:\s*['"](.+?)['"]/);
|
|
127
|
+
return match ? match[1] : null;
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
export function parseKicadCliFromConfig(configPath) {
|
|
134
|
+
try {
|
|
135
|
+
const source = fs.readFileSync(configPath, 'utf8');
|
|
136
|
+
const match = source.match(/kicad_cli\s*:\s*['"](.+?)['"]/);
|
|
137
|
+
return match ? match[1] : null;
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
export function findProjectPackageJson() {
|
|
144
|
+
let dir = process.cwd();
|
|
145
|
+
for (let i = 0; i < 20; i++) {
|
|
146
|
+
const pkgPath = path.join(dir, 'package.json');
|
|
147
|
+
if (fs.existsSync(pkgPath)) {
|
|
148
|
+
try {
|
|
149
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
150
|
+
if (pkg.name && pkg.version)
|
|
151
|
+
return pkg;
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
// ignore parse errors
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const parent = path.dirname(dir);
|
|
158
|
+
if (parent === dir)
|
|
159
|
+
break;
|
|
160
|
+
dir = parent;
|
|
161
|
+
}
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
export function runKiCADCommand(kicadCli, commandArgs) {
|
|
165
|
+
try {
|
|
166
|
+
execFileSync(kicadCli, commandArgs, { stdio: 'ignore' });
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
export function runGitCommand(args) {
|
|
174
|
+
const gitCmd = IS_WIN ? 'git.exe' : 'git';
|
|
175
|
+
try {
|
|
176
|
+
return execFileSync(gitCmd, args, { encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] });
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
async function run() {
|
|
183
|
+
const args = parseArgs(process.argv);
|
|
184
|
+
if (args.help) {
|
|
185
|
+
printHelp();
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if (args.version) {
|
|
189
|
+
printVersion();
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const configPath = findConfigPath();
|
|
193
|
+
if (!configPath) {
|
|
194
|
+
throw new Error('Not a typeCAD project. Could not find typecad.conf.ts or typecad.conf.js in the current directory.');
|
|
195
|
+
}
|
|
196
|
+
let boardName = args.boardName;
|
|
197
|
+
if (!boardName) {
|
|
198
|
+
const entry = parseEntryFromConfig(configPath);
|
|
199
|
+
if (!entry) {
|
|
200
|
+
throw new Error('Could not find "entry" field in typecad.conf.');
|
|
201
|
+
}
|
|
202
|
+
boardName = path.basename(entry, path.extname(entry));
|
|
203
|
+
}
|
|
204
|
+
if (boardName.endsWith('.kicad_pcb')) {
|
|
205
|
+
boardName = boardName.replace(/\.kicad_pcb$/, '');
|
|
206
|
+
}
|
|
207
|
+
boardName = path.basename(boardName);
|
|
208
|
+
const configKicadCli = parseKicadCliFromConfig(configPath);
|
|
209
|
+
let kicadCli;
|
|
210
|
+
if (args.kicadCli !== 'kicad-cli') {
|
|
211
|
+
kicadCli = args.kicadCli;
|
|
212
|
+
}
|
|
213
|
+
else if (configKicadCli) {
|
|
214
|
+
kicadCli = configKicadCli;
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
const discovered = discoverKiCADCli();
|
|
218
|
+
if (!discovered) {
|
|
219
|
+
throw new Error('Could not find kicad-cli. Install KiCad or specify the path via --kicad-cli or kicad_cli in typecad.conf.');
|
|
220
|
+
}
|
|
221
|
+
kicadCli = discovered;
|
|
222
|
+
}
|
|
223
|
+
const projectPkg = findProjectPackageJson();
|
|
224
|
+
if (!projectPkg) {
|
|
225
|
+
throw new Error('Could not find a package.json with a name and version in the current directory or any parent.');
|
|
226
|
+
}
|
|
227
|
+
const pkgSlug = projectPkg.name.replace(/^@/, '').replace(/\//, '-');
|
|
228
|
+
const inputPath = args.inputPath;
|
|
229
|
+
const outputPath = args.outputPath || `./build/jlcpcb-export/${pkgSlug}-${projectPkg.version}`;
|
|
230
|
+
const ignore = args.ignore;
|
|
231
|
+
process.stdout.write(chalk.bgBlue.white.bold(`JLCPCB`) + ' Assembly Processor starting...\n');
|
|
232
|
+
const pcbFile = path.resolve(inputPath, `${boardName}.kicad_pcb`);
|
|
233
|
+
if (!fs.existsSync(pcbFile)) {
|
|
234
|
+
throw new Error(`PCB file not found: ${pcbFile}`);
|
|
235
|
+
}
|
|
236
|
+
// run DRC on the board
|
|
237
|
+
try {
|
|
238
|
+
execFileSync(kicadCli, ['pcb', 'drc', '--exit-code-violations', '--all-track-errors', '--format', 'json', pcbFile], { stdio: 'pipe' });
|
|
239
|
+
}
|
|
240
|
+
catch {
|
|
241
|
+
if (!ignore) {
|
|
242
|
+
throw new Error('DRC failed');
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
console.log(chalk.yellow('DRC failed. Continuing due to --ignore flag.'));
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
// check the git repo
|
|
249
|
+
const gitStatus = runGitCommand(['rev-parse', '--is-inside-work-tree']);
|
|
250
|
+
if (gitStatus !== null && gitStatus.trim() === 'true') {
|
|
251
|
+
const porcelain = runGitCommand(['status', '--porcelain']);
|
|
252
|
+
if (porcelain !== null && porcelain.trim() !== '') {
|
|
253
|
+
if (!ignore) {
|
|
254
|
+
throw new Error('The repository is dirty. Please commit or stash changes before running this command.');
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
console.log(chalk.yellow('The repository is dirty. Continuing due to --ignore flag.'));
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// make folder
|
|
262
|
+
fs.mkdirSync(outputPath, { recursive: true });
|
|
263
|
+
process.stdout.write(chalk.blue.bold(outputPath) + ' folder created\n');
|
|
264
|
+
// make position file and edit fields
|
|
265
|
+
const cplFile = path.join(outputPath, `${boardName}_cpl.csv`);
|
|
266
|
+
if (runKiCADCommand(kicadCli, ['pcb', 'export', 'pos', '--exclude-dnp', '--units=mm', '--format=csv', '--output', cplFile, pcbFile])) {
|
|
267
|
+
replaceInFileSync({ files: cplFile, from: /^Ref/g, to: 'Designator' });
|
|
268
|
+
replaceInFileSync({ files: cplFile, from: /^PosX/g, to: 'Mid X' });
|
|
269
|
+
replaceInFileSync({ files: cplFile, from: /^PosY/g, to: 'Mid Y' });
|
|
270
|
+
replaceInFileSync({ files: cplFile, from: /^Rot/g, to: 'Rotation' });
|
|
271
|
+
replaceInFileSync({ files: cplFile, from: /^Side/g, to: 'Layer' });
|
|
272
|
+
process.stdout.write(chalk.blue.bold(cplFile) + ' Position/PnP file written\n');
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
console.error(chalk.red(`Failed to generate position file`));
|
|
276
|
+
if (!ignore)
|
|
277
|
+
throw new Error('Failed to generate position file');
|
|
278
|
+
}
|
|
279
|
+
// gerbers
|
|
280
|
+
const gerbersDir = path.join(outputPath, 'gerbers');
|
|
281
|
+
fs.mkdirSync(gerbersDir, { recursive: true });
|
|
282
|
+
let gerbersOk = runKiCADCommand(kicadCli, ['pcb', 'export', 'gerbers', '--output', gerbersDir, pcbFile]);
|
|
283
|
+
if (gerbersOk) {
|
|
284
|
+
process.stdout.write(chalk.blue.bold(gerbersDir + '/') + ' Gerber files written\n');
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
console.error(chalk.red('Failed to generate gerber files'));
|
|
288
|
+
if (!ignore)
|
|
289
|
+
throw new Error('Failed to generate gerber files');
|
|
290
|
+
}
|
|
291
|
+
// make drill files
|
|
292
|
+
let drillOk = runKiCADCommand(kicadCli, ['pcb', 'export', 'drill', '--output', gerbersDir, pcbFile]);
|
|
293
|
+
if (drillOk) {
|
|
294
|
+
process.stdout.write(chalk.blue.bold(path.join(gerbersDir, `${boardName}.drl`)) + ' Drill file written\n');
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
console.error(chalk.red('Failed to generate drill file'));
|
|
298
|
+
if (!ignore)
|
|
299
|
+
throw new Error('Failed to generate drill file');
|
|
300
|
+
}
|
|
301
|
+
// zip them
|
|
302
|
+
if (gerbersOk && drillOk) {
|
|
303
|
+
const gerbersZip = path.join(outputPath, 'gerbers.zip');
|
|
304
|
+
process.stdout.write(chalk.blue.bold(gerbersZip) + ' zipping Gerbers and drill file\n');
|
|
305
|
+
await zip(gerbersDir, gerbersZip);
|
|
306
|
+
}
|
|
307
|
+
// bom file - copy from build directory if it exists
|
|
308
|
+
const bomSource = path.join(inputPath, `${boardName}.csv`);
|
|
309
|
+
const bomDest = path.join(outputPath, `${boardName}.csv`);
|
|
310
|
+
if (fs.existsSync(bomSource)) {
|
|
311
|
+
fs.copyFileSync(bomSource, bomDest);
|
|
312
|
+
replaceInFileSync({ files: bomDest, from: /^MPN/g, to: 'JLCPCB Part#' });
|
|
313
|
+
process.stdout.write(chalk.blue.bold(bomDest) + ' BOM file written\n');
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
process.stdout.write(chalk.yellow(`BOM file not found at ${bomSource}. Skipping BOM generation.\n`));
|
|
317
|
+
}
|
|
318
|
+
process.stdout.write(chalk.blue.italic.underline(`https://jlcpcb.com/`) + ` to order. All files are in ${outputPath}\n`);
|
|
319
|
+
}
|
|
320
|
+
if (isMainModule) {
|
|
321
|
+
run().catch((err) => {
|
|
322
|
+
console.error(chalk.red(`Error: ${err instanceof Error ? err.message : err}`));
|
|
323
|
+
process.exit(1);
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
//# sourceMappingURL=index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AAC,GAAG,EAAE,EAAE;QAChB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAC/E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,26 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typecad/jlcpcb-export",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"keywords": [
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "CLI tool to generate all files needed for JLCPCB assembly from a typeCAD project",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"typecad-package",
|
|
7
|
+
"typecad",
|
|
8
|
+
"jlcpcb",
|
|
9
|
+
"export",
|
|
10
|
+
"pcb",
|
|
11
|
+
"assembly",
|
|
12
|
+
"bom",
|
|
13
|
+
"cpl"
|
|
14
|
+
],
|
|
15
|
+
"author": "typeCAD",
|
|
16
|
+
"license": "EULA",
|
|
6
17
|
"homepage": "https://typecad.net",
|
|
7
18
|
"funding": "https://www.buymeacoffee.com/typecad",
|
|
8
|
-
"
|
|
9
|
-
|
|
19
|
+
"bin": {
|
|
20
|
+
"jlcpcb-export": "dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"main": "dist/index.js",
|
|
23
|
+
"types": "dist/index.d.ts",
|
|
10
24
|
"type": "module",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
25
|
+
"files": [
|
|
26
|
+
"dist/"
|
|
27
|
+
],
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
16
30
|
},
|
|
17
31
|
"dependencies": {
|
|
18
32
|
"chalk": "^5.4.1",
|
|
19
33
|
"replace-in-file": "^8.3.0",
|
|
20
|
-
"zip-a-folder": "^
|
|
21
|
-
|
|
34
|
+
"zip-a-folder": "^6.1.1"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^22.13.0",
|
|
38
|
+
"typescript": "^5.7.3",
|
|
39
|
+
"vitest": "^3.2.6"
|
|
22
40
|
},
|
|
23
41
|
"scripts": {
|
|
42
|
+
"build": "tsc",
|
|
43
|
+
"test": "vitest --run",
|
|
44
|
+
"test:watch": "vitest",
|
|
45
|
+
"prepublishOnly": "npm run build",
|
|
24
46
|
"package_publish": "npm publish --access public"
|
|
25
47
|
}
|
|
26
48
|
}
|
package/index.ts
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { PCB, Schematic, kicad_cli_path } from "@typecad/typecad";
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import { execSync } from "node:child_process";
|
|
4
|
-
import fs from 'node:fs';
|
|
5
|
-
import { replaceInFileSync } from 'replace-in-file';
|
|
6
|
-
import { zip } from 'zip-a-folder';
|
|
7
|
-
|
|
8
|
-
let package_json = require(`${process.env.INIT_CWD}/package.json`);
|
|
9
|
-
|
|
10
|
-
const runCommand = (command: string) => {
|
|
11
|
-
try {
|
|
12
|
-
execSync(`${command}`, { stdio: "ignore" });
|
|
13
|
-
} catch (e) {
|
|
14
|
-
console.error(`Failed executing ${command}`, e);
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
return true;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export function jlcpcb_export(schematic: Schematic, pcb: PCB, ignore?: boolean) {
|
|
21
|
-
let output_path = `./build/jlcpcb-${package_json.version}`;
|
|
22
|
-
let input_path = './build';
|
|
23
|
-
let _ignore = ignore || false;
|
|
24
|
-
|
|
25
|
-
process.stdout.write(chalk.bgBlue.white.bold(`JLCPCB`) + ' Assembly Processor starting...\n');
|
|
26
|
-
|
|
27
|
-
// run DRC on the board
|
|
28
|
-
try {
|
|
29
|
-
execSync(`"${kicad_cli_path}" pcb drc --exit-code-violations --all-track-errors --format json ${input_path}/${pcb.Boardname}.kicad_pcb`);
|
|
30
|
-
} catch (error) {
|
|
31
|
-
if (!_ignore) {
|
|
32
|
-
schematic.error('DRC failed');
|
|
33
|
-
} else {
|
|
34
|
-
schematic.warn('DRC failed. Continuing due to ignore flag.');
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// check the git repo
|
|
39
|
-
try {
|
|
40
|
-
const stdout = execSync('git status --porcelain').toString();
|
|
41
|
-
if (stdout.trim() !== '') {
|
|
42
|
-
if (!_ignore) {
|
|
43
|
-
schematic.error('The repository is dirty. Please commit or stash changes before running this command.');
|
|
44
|
-
} else {
|
|
45
|
-
schematic.warn('The repository is dirty. Please commit or stash changes before running this command. Continuing due to ignore flag.');
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
} catch (error) {
|
|
49
|
-
schematic.error(`Failed executing ${error}`);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// make folder
|
|
53
|
-
fs.mkdirSync(`${output_path}`, { recursive: true });
|
|
54
|
-
process.stdout.write(chalk.blue.bold(`${output_path}`) + ' folder created\n');
|
|
55
|
-
|
|
56
|
-
// make position file and edit fields
|
|
57
|
-
process.stdout.write(chalk.blue.bold(`${output_path}/${pcb.Boardname}_cpl.csv`) + ' Position/PnP file written\n');
|
|
58
|
-
runCommand(`"${kicad_cli_path}" pcb export pos --exclude-dnp --units=mm --format=csv --output ${output_path}/${pcb.Boardname}_cpl.csv ${input_path}/${pcb.Boardname}.kicad_pcb`)
|
|
59
|
-
|
|
60
|
-
replaceInFileSync({
|
|
61
|
-
files: `${output_path}/${pcb.Boardname}_cpl.csv`,
|
|
62
|
-
from: /Ref/g,
|
|
63
|
-
to: 'Designator',
|
|
64
|
-
});
|
|
65
|
-
replaceInFileSync({
|
|
66
|
-
files: `${output_path}/${pcb.Boardname}_cpl.csv`,
|
|
67
|
-
from: /PosX/g,
|
|
68
|
-
to: 'Mid X',
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
replaceInFileSync({
|
|
72
|
-
files: `${output_path}/${pcb.Boardname}_cpl.csv`,
|
|
73
|
-
from: /PosY/g,
|
|
74
|
-
to: 'Mid Y',
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
replaceInFileSync({
|
|
78
|
-
files: `${output_path}/${pcb.Boardname}_cpl.csv`,
|
|
79
|
-
from: /Rot/g,
|
|
80
|
-
to: 'Rotation',
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
replaceInFileSync({
|
|
84
|
-
files: `${output_path}/${pcb.Boardname}_cpl.csv`,
|
|
85
|
-
from: /Side/g,
|
|
86
|
-
to: 'Layer',
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
// gerbers
|
|
90
|
-
// make directory
|
|
91
|
-
fs.mkdirSync(`${output_path}/gerbers`, { recursive: true });
|
|
92
|
-
// make gerbers
|
|
93
|
-
process.stdout.write(chalk.blue.bold(`${output_path}/gerbers/`) + ' Gerber files written\n');
|
|
94
|
-
runCommand(`"${kicad_cli_path}" pcb export gerbers --output ${output_path}/gerbers ${input_path}/${pcb.Boardname}.kicad_pcb`)
|
|
95
|
-
|
|
96
|
-
// make drill files
|
|
97
|
-
process.stdout.write(chalk.blue.bold(`${output_path}/gerbers/${pcb.Boardname}.drl`) + ' Drill file written\n');
|
|
98
|
-
runCommand(`"${kicad_cli_path}" pcb export drill --output ${output_path}/gerbers ${input_path}/${pcb.Boardname}.kicad_pcb`)
|
|
99
|
-
|
|
100
|
-
// zip them
|
|
101
|
-
process.stdout.write(chalk.blue.bold(`${output_path}/gerbers.zip`) + ' zipping Gerbers and drill file\n');
|
|
102
|
-
zip(`${output_path}/gerbers`, `${output_path}/gerbers.zip`);
|
|
103
|
-
|
|
104
|
-
// bom file
|
|
105
|
-
schematic.bom(output_path);
|
|
106
|
-
replaceInFileSync({
|
|
107
|
-
files: `${output_path}/${pcb.Boardname}.csv`,
|
|
108
|
-
from: /MPN/g,
|
|
109
|
-
to: 'JLCPCB Part#',
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
process.stdout.write(chalk.blue.italic.underline(`https://jlcpcb.com/`) + ` to order. All files are in ./build/jlcpcb-${package_json.version}\n`);
|
|
113
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
4
|
-
|
|
5
|
-
/* Projects */
|
|
6
|
-
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
7
|
-
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
-
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
9
|
-
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
10
|
-
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
-
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
-
|
|
13
|
-
/* Language and Environment */
|
|
14
|
-
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
15
|
-
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
|
-
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
17
|
-
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
|
18
|
-
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
19
|
-
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
20
|
-
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
21
|
-
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
22
|
-
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
23
|
-
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
24
|
-
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
25
|
-
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
26
|
-
|
|
27
|
-
/* Modules */
|
|
28
|
-
"module": "commonjs", /* Specify what module code is generated. */
|
|
29
|
-
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
30
|
-
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
31
|
-
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
32
|
-
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
33
|
-
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
34
|
-
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
35
|
-
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
36
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
37
|
-
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
38
|
-
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
|
39
|
-
// "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */
|
|
40
|
-
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
|
41
|
-
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
|
42
|
-
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
|
43
|
-
// "noUncheckedSideEffectImports": true, /* Check side effect imports. */
|
|
44
|
-
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
45
|
-
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
|
46
|
-
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
47
|
-
|
|
48
|
-
/* JavaScript Support */
|
|
49
|
-
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
50
|
-
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
51
|
-
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
52
|
-
|
|
53
|
-
/* Emit */
|
|
54
|
-
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
55
|
-
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
56
|
-
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
57
|
-
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
58
|
-
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
59
|
-
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
60
|
-
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
61
|
-
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
|
62
|
-
// "removeComments": true, /* Disable emitting comments. */
|
|
63
|
-
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
64
|
-
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
65
|
-
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
66
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
67
|
-
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
68
|
-
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
69
|
-
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
70
|
-
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
71
|
-
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
72
|
-
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
73
|
-
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
74
|
-
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
75
|
-
|
|
76
|
-
/* Interop Constraints */
|
|
77
|
-
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
78
|
-
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
|
79
|
-
// "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
|
|
80
|
-
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
81
|
-
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
|
82
|
-
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
83
|
-
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
84
|
-
|
|
85
|
-
/* Type Checking */
|
|
86
|
-
"strict": true, /* Enable all strict type-checking options. */
|
|
87
|
-
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
88
|
-
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
89
|
-
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
90
|
-
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
91
|
-
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
92
|
-
// "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */
|
|
93
|
-
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
94
|
-
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
95
|
-
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
96
|
-
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
97
|
-
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
98
|
-
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
99
|
-
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
100
|
-
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
101
|
-
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
102
|
-
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
103
|
-
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
104
|
-
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
105
|
-
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
106
|
-
|
|
107
|
-
/* Completeness */
|
|
108
|
-
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
109
|
-
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
110
|
-
}
|
|
111
|
-
}
|