Skip to content

Commit

Permalink
chore: reset prettier options
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebeamish committed Dec 7, 2024
1 parent 5104d3d commit 7076d97
Show file tree
Hide file tree
Showing 24 changed files with 1,901 additions and 1,906 deletions.
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["@babel/preset-env"]
}
"presets": ["@babel/preset-env"]
}
4 changes: 0 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[*]
end_of_line = lf
insert_final_newline = true

[*.js]
indent_style = tab
indent_size = 2
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"tabWidth": 2,
"useTabs": true
"useTabs": false
}
1 change: 0 additions & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

41 changes: 23 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/jakebeamish/Penplotting.js/node.js.yml?style=flat&label=tests)

Penplotting.js is a JavaScript framework for making generative art in SVG format for penplotters.
This project is a personal project, and as such, it is a work-in-progress. New
This project is a personal project, and as such, it is a work-in-progress. New
features and breaking changes are to be expected in future updates. Use at your
own discretion, feel free to contribute and raise issues.

Expand All @@ -23,19 +23,21 @@ npm i @jakebeamish/penplotting
## Usage

To start a new plot, run

```sh
npx new-plot
```

This is a shell script that will create new default `index.html`,
`style.css` and `plot.js` files in the current working directory.
Inside `plot.js`, adjust the options for initializing the plot:

```js
const plot = new Plot({
units: "mm",
title: "My amazing plot",
size: Paper.A5,
strokeWidth: 0.05
units: "mm",
title: "My amazing plot",
size: Paper.A5,
strokeWidth: 0.05,
});
```

Expand All @@ -46,14 +48,14 @@ the SVG document using `plot.add(shapes)`.
```js
// This is where the work is made
plot.generate = () => {
// Create Lines from Vectors
const a = new Vector(10, 10);
const b = new Vector(90, 90);
const line = new Line(a, b);
// Create Lines from Vectors
const a = new Vector(10, 10);
const b = new Vector(90, 90);
const line = new Line(a, b);

// Add shapes to the Plot
plot.add(line);
}
// Add shapes to the Plot
plot.add(line);
};

plot.draw();
```
Expand All @@ -62,10 +64,11 @@ Calling `plot.draw()` at the end of the file will generate an SVG element
and UI inside `index.html`, which can be opened in a browser.

### Keyboard shortcuts
| Action | Key |
|----------------------------|----|
|Download an SVG file | `d` |
|Regenerate with random seed | `r` |

| Action | Key |
| --------------------------- | --- |
| Download an SVG file | `d` |
| Regenerate with random seed | `r` |

### Plotting the SVG files

Expand All @@ -74,16 +77,18 @@ Personally, I use vpype to optimise the file, and then the axidraw Inkscape plug

## Contributing

Contributions are welcome. Issues, comments and Pull Requests can be made at
Contributions are welcome. Issues, comments and Pull Requests can be made at
https://github.com/jakebeamish/penplot-svg-tool/issues.

The project is tested using jest. Documentation is generated using JSDoc.

## License

This project is licensed under the MIT License. See the [LICENSE.md](https://github.com/jakebeamish/Penplotting.js/blob/main/LICENSE.md) file for
details.

## Acknowledgements

This project incorporates code from:
- [CodingTrain/Quadtree](https://github.com/CodingTrain/Quadtree) - Licensed under the MIT License.

- [CodingTrain/Quadtree](https://github.com/CodingTrain/Quadtree) - Licensed under the MIT License.
40 changes: 20 additions & 20 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
module.exports = {
transform: {
// '^.+\\.feature$': 'jest-cucumber',
"^.+\\.[tj]sx?$": "babel-jest",
},
testEnvironment: "jsdom",
// setupFilesAfterEnv: ['./jest.setup.js'],
testMatch: [
"**/tests/**/*.[jt]s?(x)",
"**/tests/features/**/*.feature", // Feature files
"**/tests/steps/**/*.steps.js", // Step definitions
],
reporters: [
"default",
[
"./node_modules/jest-html-reporter",
{
pageTitle: "Test Report",
},
],
],
transform: {
// '^.+\\.feature$': 'jest-cucumber',
"^.+\\.[tj]sx?$": "babel-jest",
},
testEnvironment: "jsdom",
// setupFilesAfterEnv: ['./jest.setup.js'],
testMatch: [
"**/tests/**/*.[jt]s?(x)",
"**/tests/features/**/*.feature", // Feature files
"**/tests/steps/**/*.steps.js", // Step definitions
],
reporters: [
"default",
[
"./node_modules/jest-html-reporter",
{
pageTitle: "Test Report",
},
],
],
};
66 changes: 30 additions & 36 deletions jsdoc.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,33 @@
{
"source": {
"include": [
"source"
]
},
"opts": {
"encoding": "utf8",
"readme": "./README.md",
"destination": "./docs",
"recurse": true,
"verbose": true,
"template": "./node_modules/clean-jsdoc-theme",
"theme_opts": {
"default_theme": "light",
"title": "Penplotting.js",
"homepageTitle": "Penplotting.js",
"menu": [
{
"title": "GitHub",
"link": "https://github.com/jakebeamish/Penplotting.js/",
"target": "_blank"
}
]
}
},
"plugins": [
"plugins/markdown"
],
"markdown": {
"hardwrap": false,
"idInHeadings": true
},
"templates": {
"clean-jsdoc-theme": {

"source": {
"include": ["source"]
},
"opts": {
"encoding": "utf8",
"readme": "./README.md",
"destination": "./docs",
"recurse": true,
"verbose": true,
"template": "./node_modules/clean-jsdoc-theme",
"theme_opts": {
"default_theme": "light",
"title": "Penplotting.js",
"homepageTitle": "Penplotting.js",
"menu": [
{
"title": "GitHub",
"link": "https://github.com/jakebeamish/Penplotting.js/",
"target": "_blank"
}
]
}
}
},
"plugins": ["plugins/markdown"],
"markdown": {
"hardwrap": false,
"idInHeadings": true
},
"templates": {
"clean-jsdoc-theme": {}
}
}
104 changes: 52 additions & 52 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
{
"name": "@jakebeamish/penplotting",
"version": "4.2.0",
"description": "A JavaScript framework for making SVG files for penplotters.",
"main": "source/index.js",
"bin": {
"new-plot": "new-plot.sh"
},
"scripts": {
"test": "jest --coverage",
"docs": "jsdoc --configure jsdoc.json --verbose -p"
},
"files": [
"source/**/*.js",
"new-plot.sh",
"!source/tests/**"
],
"keywords": [
"svg",
"penplot",
"plotter",
"penplotter",
"penplotting",
"art",
"generativeart",
"p5.js",
"processing"
],
"author": {
"name": "Jake Beamish",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "git://github.com/jakebeamish/Penplotting.js.git"
},
"homepage": "https://github.com/jakebeamish/Penplotting.js",
"bugs": {
"url": "https://github.com/jakebeamish/Penplotting.js/issues"
},
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.24.6",
"@babel/preset-env": "^7.24.6",
"babel-jest": "^29.7.0",
"clean-jsdoc-theme": "^4.3.0",
"jest": "^29.7.0",
"jest-cucumber": "^4.4.0",
"jest-environment-jsdom": "^29.7.0",
"jest-html-reporter": "^3.10.2",
"jsdoc": "^4.0.3",
"prettier": "3.3.3"
}
"name": "@jakebeamish/penplotting",
"version": "4.2.0",
"description": "A JavaScript framework for making SVG files for penplotters.",
"main": "source/index.js",
"bin": {
"new-plot": "new-plot.sh"
},
"scripts": {
"test": "jest --coverage",
"docs": "jsdoc --configure jsdoc.json --verbose -p"
},
"files": [
"source/**/*.js",
"new-plot.sh",
"!source/tests/**"
],
"keywords": [
"svg",
"penplot",
"plotter",
"penplotter",
"penplotting",
"art",
"generativeart",
"p5.js",
"processing"
],
"author": {
"name": "Jake Beamish",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "git://github.com/jakebeamish/Penplotting.js.git"
},
"homepage": "https://github.com/jakebeamish/Penplotting.js",
"bugs": {
"url": "https://github.com/jakebeamish/Penplotting.js/issues"
},
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.24.6",
"@babel/preset-env": "^7.24.6",
"babel-jest": "^29.7.0",
"clean-jsdoc-theme": "^4.3.0",
"jest": "^29.7.0",
"jest-cucumber": "^4.4.0",
"jest-environment-jsdom": "^29.7.0",
"jest-html-reporter": "^3.10.2",
"jsdoc": "^4.0.3",
"prettier": "3.3.3"
}
}
Loading

0 comments on commit 7076d97

Please sign in to comment.