update readme with nix setup and disclaimer, increase scale max to 10
This commit is contained in:
56
AGENTS.md
Normal file
56
AGENTS.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# Agent Guidelines for NLS Guilloche Generator
|
||||
|
||||
**IMPORTANT**: This is an archived Angular 6 project. We maintain it for running purposes only - no development, upgrades, or new features. Never run npm commands directly; always use the Makefile/nix shell wrapper.
|
||||
|
||||
## Build/Lint/Test Commands
|
||||
|
||||
- **Build app**: `npm run build`
|
||||
- **Build library**: `npm run build:library`
|
||||
- **Start dev server**: `npm start`
|
||||
- **Lint**: `npm run lint`
|
||||
- **Run all tests**: `npm run test`
|
||||
- **Run single test**: `ng test --include="**/specific-test.spec.ts"`
|
||||
- **E2E tests**: `npm run e2e`
|
||||
|
||||
## Code Style Guidelines
|
||||
|
||||
### Formatting
|
||||
- 2-space indentation
|
||||
- Single quotes for strings
|
||||
- Semicolons always
|
||||
- Max line length: 140 characters
|
||||
- No trailing whitespace
|
||||
- Insert final newline in files
|
||||
|
||||
### TypeScript/Angular
|
||||
- Target: ES5
|
||||
- Use `const` instead of `let` when possible
|
||||
- Arrow return shorthand
|
||||
- Interface over type literal
|
||||
- No unused expressions
|
||||
- No console.log (except debug/info/time/timeEnd/trace)
|
||||
- Component class suffix required
|
||||
- Import spacing required
|
||||
|
||||
### Naming Conventions
|
||||
- **Components**: PascalCase + `Component` suffix (e.g., `AppComponent`)
|
||||
- **Services**: PascalCase + `Service` suffix (e.g., `NlsMathService`)
|
||||
- **Models**: PascalCase + `.model` suffix (e.g., `point.model.ts`)
|
||||
- **Files**: kebab-case for components, camelCase for services/models
|
||||
- **Properties/Methods**: camelCase
|
||||
|
||||
### Member Ordering
|
||||
1. Static fields
|
||||
2. Instance fields
|
||||
3. Static methods
|
||||
4. Instance methods
|
||||
|
||||
### Imports
|
||||
- Angular imports first
|
||||
- Third-party imports second
|
||||
- Local imports last
|
||||
- Use relative imports (`./` or `../`)
|
||||
|
||||
### Error Handling
|
||||
- Follow standard TypeScript practices
|
||||
- Use appropriate Angular error handling patterns
|
||||
12
Makefile
Normal file
12
Makefile
Normal file
@@ -0,0 +1,12 @@
|
||||
.PHONY: start build help
|
||||
|
||||
start:
|
||||
NIXPKGS_ALLOW_INSECURE=1 nix-shell --run "npm start"
|
||||
|
||||
build:
|
||||
NIXPKGS_ALLOW_INSECURE=1 nix-shell --run "npm run build"
|
||||
|
||||
help:
|
||||
@echo "Available commands:"
|
||||
@echo " start - Start the development server"
|
||||
@echo " build - Build the project for production"
|
||||
19
README.md
19
README.md
@@ -15,10 +15,21 @@
|
||||
|
||||
---
|
||||
|
||||
## Rquirements
|
||||
## Requirements
|
||||
|
||||
- Node.js
|
||||
- Node.js 10.24.1 (insecure EOL version, provided without warranty)
|
||||
- Angular CLI
|
||||
- Nix (for reproducible development environment)
|
||||
|
||||
## Development Setup
|
||||
|
||||
This project uses Nix for a reproducible development environment.
|
||||
|
||||
1. Enter the Nix shell: `nix-shell`
|
||||
2. Install dependencies: `npm install`
|
||||
3. Start development: `make start` or `npm run start`
|
||||
|
||||
**Disclaimer:** This software is provided without any warranty. Use at your own risk.
|
||||
|
||||
## NPM Scripts
|
||||
|
||||
@@ -30,9 +41,9 @@
|
||||
|
||||
## Development server
|
||||
|
||||
Download dependencies with `npm i` or `yarn`.
|
||||
After entering the Nix shell, download dependencies with `npm install`.
|
||||
|
||||
Run `npm run start` for a dev server. Browser opens and navigates automatically to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
|
||||
Run `make start` or `npm run start` for a dev server. Browser opens and navigates automatically to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
|
||||
|
||||
## Build
|
||||
|
||||
|
||||
26
projects/nls-guilloche/src/nls/models/matrix.model.ts
Normal file
26
projects/nls-guilloche/src/nls/models/matrix.model.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Copyright (C) 2018 Michael Czechowski <mail@dailysh.it>
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; version 2.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc., 51
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import { Point } from './point.model';
|
||||
|
||||
export interface Matrix {
|
||||
start: Point;
|
||||
end: Point;
|
||||
center: Point;
|
||||
width: number;
|
||||
height: number;
|
||||
unit?: number;
|
||||
}
|
||||
25
shell.nix
Normal file
25
shell.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
let
|
||||
lib = import <nixpkgs/lib>;
|
||||
buildNodeJs = pkgs.callPackage "${<nixpkgs>}/pkgs/development/web/nodejs/nodejs.nix" {
|
||||
python = pkgs.python3;
|
||||
};
|
||||
|
||||
nodejsVersion = lib.fileContents ./.nvmrc;
|
||||
|
||||
nodejs = buildNodeJs {
|
||||
enableNpm = true;
|
||||
version = nodejsVersion;
|
||||
sha256 = "032801kg24j04xmf09m0vxzlcz86sv21s24lv9l4cfv08k1c4byp";
|
||||
};
|
||||
|
||||
# Overlay to use custom nodejs for nodePackages
|
||||
customPkgs = pkgs // { inherit nodejs; };
|
||||
|
||||
in customPkgs.mkShell {
|
||||
buildInputs = with customPkgs; [
|
||||
nodejs
|
||||
nodePackages."@angular/cli"
|
||||
];
|
||||
}
|
||||
@@ -47,7 +47,7 @@ export let ConfigForm: FormGroup = fb.group({
|
||||
])),
|
||||
scale: fb.control('', Validators.compose([
|
||||
Validators.min(0),
|
||||
Validators.max(1)
|
||||
Validators.max(10)
|
||||
])),
|
||||
stroke: fb.control('', Validators.compose([
|
||||
Validators.min(0.1),
|
||||
|
||||
23
src/app/forms/preset.form.ts
Normal file
23
src/app/forms/preset.form.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright (C) 2018 Michael Czechowski <mail@dailysh.it>
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the Free
|
||||
* Software Foundation; version 2.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc., 51
|
||||
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
|
||||
const fb = new FormBuilder();
|
||||
|
||||
export let PresetForm: FormGroup = fb.group({
|
||||
canvas: fb.control('')
|
||||
});
|
||||
15
src/app/presets/canvas.preset.ts
Normal file
15
src/app/presets/canvas.preset.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
export const CanvasPresets = [
|
||||
{
|
||||
title: 'Visitenkarte (hochkant)',
|
||||
defaults: {
|
||||
canvas: {
|
||||
width: 284,
|
||||
height: 482
|
||||
},
|
||||
margin: {
|
||||
x: 28,
|
||||
y: 272
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
1094
src/styles-variables.scss
Normal file
1094
src/styles-variables.scss
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user