Skip to content

Commit

Permalink
wip: rename identify-layers back to wtg
Browse files Browse the repository at this point in the history
  • Loading branch information
mcous committed Jan 15, 2023
1 parent 6f82b37 commit 49ce1c6
Show file tree
Hide file tree
Showing 22 changed files with 37 additions and 37 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
"dependencies": {
"@tracespace/cli": "workspace:*",
"@tracespace/fixtures": "workspace:*",
"@tracespace/identify-layers": "workspace:*",
"@tracespace/parser": "workspace:*",
"@tracespace/plotter": "workspace:*",
"@tracespace/renderer": "workspace:*",
"@tracespace/www": "workspace:*",
"@tracespace/xml-id": "workspace:*"
"@tracespace/xml-id": "workspace:*",
"whats-that-gerber": "workspace:*"
},
"devDependencies": {
"@babel/core": "^7.20.12",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"yargs": "^15.1.0"
},
"devDependencies": {
"@tracespace/identify-layers": "workspace:*",
"@types/common-prefix": "^1.1.0"
"@types/common-prefix": "^1.1.0",
"whats-that-gerber": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {Options as GerberToSvgOptions} from 'gerber-to-svg'
import gerberToSvg from 'gerber-to-svg'
import type {Stackup, InputLayer} from 'pcb-stackup'
import pcbStackup from 'pcb-stackup'
import * as LayerId from '@tracespace/identify-layers'
import * as LayerId from 'whats-that-gerber'
import yargs from 'yargs'

import {examples} from './examples'
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "../../config/tsconfig.base.json",
"references": [{"path": "../../packages/identify-layers"}],
"references": [{"path": "../../packages/whats-that-gerber"}],
"compilerOptions": {
"composite": true,
"emitDeclarationOnly": true,
Expand Down
6 changes: 3 additions & 3 deletions packages/fixtures/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const fixtures = require('@tracespace/fixtures')

### gerber filenames

`gerber-filenames.json` is a JSON file with a collection of example Gerber / drill filenames along with what PCB layer type they represent organized by CAD package. This fixture is primarily used to test `@tracespace/identify-layers`.
`gerber-filenames.json` is a JSON file with a collection of example Gerber / drill filenames along with what PCB layer type they represent organized by CAD package. This fixture is primarily used to test `whats-that-gerber`.

```js
const {gerberFilenames} = require('@tracespace/fixtures')
Expand All @@ -52,7 +52,7 @@ Array<{
files: Array<{
/** filename */
name: string,
/** expected @tracespace/identify-layers type */
/** expected whats-that-gerber type */
type: string
}>
}>
Expand Down Expand Up @@ -101,7 +101,7 @@ Array<{
filename: string,
/** format of the file */
format: 'gerber' | 'drill',
/** @tracespace/identify-layers type of the layer */
/** whats-that-gerber type of the layer */
type: string,
/** file contents (i.e. results of fs.readFile on filepath) */
source: string
Expand Down
4 changes: 2 additions & 2 deletions packages/renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
},
"homepage": "https://github.com/tracespace/tracespace#readme",
"dependencies": {
"@tracespace/identify-layers": "workspace:*",
"@tracespace/parser": "workspace:*",
"@tracespace/plotter": "workspace:*",
"@tracespace/xml-id": "workspace:*",
"@types/hast": "^2.3.4"
"@types/hast": "^2.3.4",
"whats-that-gerber": "workspace:*"
},
"devDependencies": {
"@types/unist": "^2.0.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"references": [
{"path": "../parser"},
{"path": "../plotter"},
{"path": "../identify-layers"},
{"path": "../whats-that-gerber"},
{"path": "../xml-id"}
],
"compilerOptions": {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @tracespace/identify-layers
# whats-that-gerber

Have you got a bunch of Gerber files lying around without any idea what they're for? We've all been there. `@tracespace/identify-layers` is here to help.
Have you got a bunch of Gerber files lying around without any idea what they're for? We've all been there. `whats-that-gerber` is here to help.

This module examines a set of Gerber and NC drill file names and tries to guess the layer type of each file from the filename.

Expand All @@ -11,13 +11,13 @@ Part of the [tracespace][] collection of PCB visualization tools.
## install

```shell
npm install @tracespace/identify-layers
npm install whats-that-gerber
```

Or, use a script tag:

```html
<script src="https://unpkg.com/@tracespace/identify-layers"></script>
<script src="https://unpkg.com/whats-that-gerber"></script>
<script>
// namespace TracespaceIdentifyLayers now available
const {identifyLayers} = TracespaceIdentifyLayers
Expand All @@ -29,9 +29,9 @@ Or, use a script tag:
Pass `identifyLayers` an array of filenames from a PCB, and it will give you back an object keyed by filename with the best guess it can make for the type and side of each file. If both `side` and `type` are `null`, the filename cannot be identified as a Gerber / drill file.

```js
const {identifyLayers} = require('@tracespace/identify-layers')
const {identifyLayers} = require('whats-that-gerber')
// ES Modules work, too
// import {identifyLayers} from '@tracespace/identify-layers'
// import {identifyLayers} from 'whats-that-gerber'

const filenames = ['my-board-F_Cu.gbr', 'my-board-B_Cu.gbr', 'foo.bar']
const typeByFilename = identifyLayers(filenames)
Expand All @@ -57,9 +57,9 @@ There are 12 available layer types, were a type is an object of the format:
You can get an array of all types with:

```js
const {getAllLayers} = require('@tracespace/identify-layers')
const {getAllLayers} = require('whats-that-gerber')
// ES Modules work, too
// import {getAllLayers} from '@tracespace/identify-layers'
// import {getAllLayers} from 'whats-that-gerber'

const allLayers = getAllLayers()
```
Expand Down Expand Up @@ -99,20 +99,20 @@ const {
SIDE_BOTTOM, // 'bottom'
SIDE_INNER, // 'inner'
SIDE_ALL, // 'all'
} = require('@tracespace/identify-layers')
} = require('whats-that-gerber')

// ES Modules work, too
// import {TYPE_COPPER} from '@tracespace/identify-layers'
// import {TYPE_COPPER} from 'whats-that-gerber'
```

#### checking if a layer type is valid

You can check if any given string is a valid layer type with:

```js
const {validate} = require('@tracespace/identify-layers')
const {validate} = require('whats-that-gerber')
// ES Modules work, too
// import {validate} from '@tracespace/identify-layers'
// import {validate} from 'whats-that-gerber'

const type1 = {side: 'top', type: 'copper'}
const type2 = {side: 'foo', type: 'silkscreen'}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@tracespace/identify-layers",
"name": "whats-that-gerber",
"version": "5.0.0-next.0",
"description": "Identify Gerber and drill files by filename",
"types": "./lib/index.d.ts",
"exports": {
"types": "./lib/index.d.ts",
"source": "./src/index.ts",
"import": "./dist/tracespace-identify-layers.js",
"require": "./dist/tracespace-identify-layers.umd.cjs"
"import": "./dist/whats-that-gerber.js",
"require": "./dist/whats-that-gerber.umd.cjs"
},
"files": [
"dist",
Expand All @@ -23,7 +23,7 @@
"repository": {
"type": "git",
"url": "git+https://github.com/tracespace/tracespace.git",
"directory": "packages/identify-layers"
"directory": "packages/whats-that-gerber"
},
"keywords": [
"pcb",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const EXPECTED_LAYERS = [
{type: 'drawing', side: null},
]

describe('@tracespace/identify-layers', () => {
describe('whats-that-gerber', () => {
it('should default to null', () => {
const result = identifyLayers('foobar')

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"files": [],
"references": [
{"path": "./packages/cli"},
{"path": "./packages/identify-layers"},
{"path": "./packages/parser"},
{"path": "./packages/plotter"},
{"path": "./packages/renderer"},
{"path": "./packages/whats-that-gerber"},
{"path": "./packages/xml-id"},
{"path": "./www"}
]
Expand Down

0 comments on commit 49ce1c6

Please sign in to comment.