Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
679 changes: 467 additions & 212 deletions CHANGELOG.md

Large diffs are not rendered by default.

1,297 changes: 1,217 additions & 80 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tempo-monorepo",
"version": "3.8.0",
"version": "3.9.0",
"private": true,
"engines": {
"node": ">=20.0.0"
Expand All @@ -11,16 +11,19 @@
"url": "https://github.com/magmacomputing/magma.git"
},
"workspaces": [
"packages/*"
"packages/*",
"packages/plugins/*"
],
"scripts": {
"test": "cross-env TEMPO_LICENSE_KEY=\"\" vitest run",
"build:tempo": "npm run build --workspace=@magmacomputing/tempo",
"build:library": "npm run build --workspace=@magmacomputing/library",
"build:plugins": "npm run build --workspaces --if-present",
"clean": "node node_modules/typescript-7/bin/tsc -b --clean",
"version:bump": "node bin/version-bump.mjs",
"version:sync": "node bin/version-sync.mjs",
"repl": "npm run repl --workspace=@magmacomputing/tempo",
"repl:plugins": "node packages/plugins/bin/repl.mjs",
"repl:dist": "npm run repl:dist --workspace=@magmacomputing/tempo",
"core": "npm run core --workspace=@magmacomputing/tempo",
"docs:dev": "npm run docs:dev --workspace=@magmacomputing/tempo",
Expand All @@ -45,6 +48,7 @@
"playwright": "^1.61.1",
"rollup": "^4.62.2",
"tslib": "^2.8.1",
"tsup": "^8.5.1",
"tsx": "^4.22.3",
"typescript": "^6.0.3",
"typescript-7": "npm:typescript@^7.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@magmacomputing/library",
"version": "3.8.0",
"version": "3.9.0",
"description": "Shared utility library for Tempo",
"author": "Magma Computing Solutions",
"license": "MIT",
Expand Down
48 changes: 48 additions & 0 deletions packages/magma-cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# @magmacomputing/magma-cli

`magma-cli` is a lightweight, internal command-line tool built to unify build scripts across the Magma Computing monorepo.

## Why does this exist?

Many npm scripts traditionally rely on OS-specific shell commands (like `rm -rf`). This creates a fragile build environment that can break across different operating systems (such as Windows). Instead of pulling in external dependencies like `rimraf` or `del-cli`, `magma-cli` provides native, zero-dependency, cross-platform implementations specifically tailored for our build pipeline.

## Usage

This package registers the `magma-cli` binary. Because it is part of the npm workspace, npm automatically links it to the root `node_modules/.bin/magma-cli`.

You can use it directly in any `package.json` script within the monorepo:

```json
"scripts": {
"postbuild": "magma-cli rm dist/src"
}
```

Or you can run it manually via `npx` from anywhere in the project:

```bash
npx magma-cli rm dist/src
```

## Available Commands

### `rm <path...>`
Recursively and forcefully removes the specified files or directories using Node's built-in `fs.rmSync`.
- **Example:** `magma-cli rm dist/src build/ temp/`

## Adding New Commands

To extend `magma-cli` with new capabilities (e.g., cross-platform file copying), simply edit `index.js`. The CLI uses a lightweight argument router:

```javascript
const [command, ...args] = process.argv.slice(2);

if (command === 'rm') {
// ...
} else if (command === 'cp') {
// Add your new command implementation here
} else {
console.error(`Unknown command: ${command}`);
process.exit(1);
}
```
21 changes: 21 additions & 0 deletions packages/magma-cli/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env node
import fs from 'node:fs';
import path from 'node:path';

const [command, ...args] = process.argv.slice(2);

if (command === 'rm') {
for (const arg of args) {
if (!arg) continue;
const fullPath = path.resolve(process.cwd(), arg);
try {
fs.rmSync(fullPath, { recursive: true, force: true });
} catch (err) {
console.error(`Failed to remove ${fullPath}:`, err.message);
process.exitCode = 1;
}
}
Comment thread
magmacomputing marked this conversation as resolved.
} else {
console.error(`Unknown command: ${command}`);
process.exit(1);
}
9 changes: 9 additions & 0 deletions packages/magma-cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@magmacomputing/magma-cli",
"version": "1.0.0",
"private": true,
"type": "module",
"bin": {
"magma-cli": "./index.js"
}
}
64 changes: 64 additions & 0 deletions packages/plugins/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Changelog

All notable changes to the `@magmacomputing/tempo-plugin-astro` project will be documented in this file.

## [2.1.2] - 2026-07-15

### Fixed
- Fixed an issue where the polynomial algorithm could return mathematical garbage for years outside the Jean Meeus limit. It now strictly enforces the `-1000` to `+3000` year bounds by throwing a `RangeError`.

## [2.1.0] - 2026-07-02

### Changed
- **Open Source Transition**: The Astro plugin is now officially a Community plugin! It is 100% free and open-source under the MIT License.
- **Licensing Removal**: Removed all proprietary licensing logic (`definePremiumTerm`) and initialization token checks.
- **Clear-Text Build**: Removed `javascript-obfuscator` from the build pipeline. The published NPM artifact is now fully readable clear-text JavaScript.
- Updated documentation and README to reflect the new open-source structure.

## [1.1.6] - 2026-06-11

### Changed
- Renamed the metadata payload property `type` to `event` (Equinox vs. Solstice) to better reflect astronomical terminology and reduce naming collisions.
- Refactored internal `calculateAstroMoment` parameter from `season` to `quarter` to resolve semantic ambiguity between meteorological seasons and astronomical quarters.
- Augmented the `@magmacomputing/tempo/core` module to natively type the `TempoTermRegistry` for `astro` and `astronomy`, providing full strict IntelliSense autocomplete for IDEs.

### Fixed
- **Type Definitions**: Added missing `start: Tempo` and `end: Tempo` boundaries to the `TempoTermRegistry` augmentation, ensuring accurate typings for the dynamic range boundaries injected by the core resolver.
- **NPM Registry Metadata**: Explicitly added `README.md`, `CHANGELOG.md`, and `LICENSE` to the `files` array in `package.json` to ensure the npmjs.com registry correctly renders package documentation.

## [1.1.3] - 2026-06-07

### Security
- Migrated licensing enforcement from `jose` to the native WebCrypto Tempo Core primitives.

### Fixed
- Replaced all usage of the global `Date` object with the `instant()` temporal engine in the core validator to ensure timeline consistency.
- Corrected test environment resolution boundaries that caused unhandled asynchronous Promise verification leaks.

## [1.1.2] - 2026-06-04

### Fixed
- Resolved the "Ghost-Trap" architectural conflict that prevented validation when used with Tempo v3.0.0.
- Decoupled `definePremiumTerm` and cryptographic validation from the plugin bundle. Licensing engine state and references are now directly imported from the Tempo Core (`@magmacomputing/tempo/plugin`).
- Removed the `@magmacomputing/tempo-plugin-core` bundled `devDependency` to prevent duplicate initialization.

## [1.0.2] - 2026-05-25

### Security
- Migrated licensing enforcement to the newly decoupled `@magmacomputing/tempo-plugin-core` workspace.
- The proprietary license verification and string-obfuscation logic is now baked directly into the plugin bundle during the build step, decentralizing the security model and eliminating reliance on the open-source engine for validation.
- Updated `devDependencies` to automatically resolve the new internal `@core` monorepo symlink via `tsup`.

## [1.0.0] - 2026-05-18

### Added
- Initial release of the Astronomical Seasons plugin.
- Implements the Jean Meeus polynomial approximation algorithm for precise Equinox and Solstice moments.
- Returns fully scoped astronomical objects containing:
- Precise start/end dates for each astronomical season
- The astronomical `key` (Vernal, Summer, Autumnal, Winter)
- The colloquial traditional `season` mapping (Spring, Summer, Autumn, Winter)
- The `event` (Equinox vs. Solstice)
- Fully supports automatic label inversion for Northern vs. Southern hemisphere configurations (`sphere: 'south'`).
- Implements the `v2.10.0` Tempo Core Licensing API via cryptographic JSON Web Signatures (JWS).
- Auto-registers itself via side-effect upon import.
21 changes: 21 additions & 0 deletions packages/plugins/astro/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Magma Computing

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

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.
63 changes: 63 additions & 0 deletions packages/plugins/astro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
![Tempo Plugin](https://magmacomputing.github.io/tempo-plugin-docs/plugin-logo.svg)

# @magmacomputing/tempo-plugin-astro

<p align="center">
<a href="https://www.npmjs.com/package/@magmacomputing/tempo-plugin-astro"><img src="https://img.shields.io/npm/v/@magmacomputing/tempo-plugin-astro?style=flat-square" alt="npm version" style="display: inline-block; margin: 0 4px;"></a> <a href="https://www.npmjs.com/package/@magmacomputing/tempo"><img src="https://img.shields.io/npm/dependency-version/@magmacomputing/tempo-plugin-astro/peer/@magmacomputing/tempo?style=flat-square" alt="npm peer dependency version" style="display: inline-block; margin: 0 4px;"></a> <a href="https://www.npmjs.com/package/@magmacomputing/tempo-plugin-astro"><img src="https://img.shields.io/npm/l/@magmacomputing/tempo-plugin-astro?style=flat-square" alt="License" style="display: inline-block; margin: 0 4px;"></a> <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-Ready-blue?logo=typescript&style=flat-square" alt="TypeScript Ready" style="display: inline-block; margin: 0 4px;"></a> <a href="https://magmacomputing.github.io/magma/9-plugins/astro.html"><img src="https://img.shields.io/badge/Docs-VitePress-brightgreen?logo=vitepress&style=flat-square" alt="Documentation" style="display: inline-block; margin: 0 4px;"></a>
</p>

This is a Community plugin for the [Tempo](https://github.com/magmacomputing/magma) library that provides precise astronomical events (Equinoxes and Solstices) and maps them to traditional season names based on hemisphere.

👉 **[View the full documentation on our GitHub Pages](https://magmacomputing.github.io/magma/9-plugins/astro.html)**

## Installation

```bash
npm install @magmacomputing/tempo-plugin-astro
```

## Usage

```typescript
import { Tempo } from '@magmacomputing/tempo';
import { AstroTerm } from '@magmacomputing/tempo-plugin-astro';

// Pass the plugin to `Tempo.init` to register it into the runtime.
Tempo.init({
plugins: [AstroTerm]
});

const t = new Tempo('2026-03-20');

// Get the Astronomical Event mapping
console.log(t.term.astro);
// Output: 'Vernal'
```

### Response Payload

When resolving the term, the plugin intelligently returns the correct astronomical event and its corresponding traditional season based on your configured hemisphere (`sphere`):

```javascript
{
key: 'Vernal', // Flips to 'Autumnal' if sphere is set to 'south'
season: 'Spring', // Flips to 'Autumn' if sphere is set to 'south'
sphere: 'north', // Flips to 'south' if sphere is set to 'south'
event: 'Equinox',
group: 'astronomy',
year: 2026,
month: 3,
// ...
}
```

> **Did you know?**
> `t.term.astronomy.season` returns the *Astronomical* season calculated by the precise timing of solstices and equinoxes. This will often differ from `t.term.season` in the core library, which uses standard Meteorological/Civil calendar boundaries (e.g., 1st of the month).

## Documentation

For full API reference, advanced configuration, and detailed explanations of the astronomical calculations, please visit the official **[Astro Plugin Documentation ↗](https://magmacomputing.github.io/tempo-plugin-docs/astro)**.

## Licensing

This is a **Community** plugin. It is completely free and open-source for personal and commercial use. No license token is required.
77 changes: 77 additions & 0 deletions packages/plugins/astro/doc/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
![Tempo Plugin](/plugin-logo.svg)

# @magmacomputing/tempo-plugin-astro

<p align="center">
<a href="https://www.npmjs.com/package/@magmacomputing/tempo-plugin-astro"><img src="https://img.shields.io/npm/v/@magmacomputing/tempo-plugin-astro?style=flat-square" alt="npm version" style="display: inline-block; margin: 0 4px;"></a> <a href="https://www.npmjs.com/package/@magmacomputing/tempo"><img src="https://img.shields.io/npm/dependency-version/@magmacomputing/tempo-plugin-astro/peer/@magmacomputing/tempo?style=flat-square" alt="npm peer dependency version" style="display: inline-block; margin: 0 4px;"></a> <a href="https://www.npmjs.com/package/@magmacomputing/tempo-plugin-astro"><img src="https://img.shields.io/npm/l/@magmacomputing/tempo-plugin-astro?style=flat-square" alt="License" style="display: inline-block; margin: 0 4px;"></a> <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-Ready-blue?logo=typescript&style=flat-square" alt="TypeScript Ready" style="display: inline-block; margin: 0 4px;"></a>
</p>

This is a Community plugin for the [Tempo](https://github.com/magmacomputing/magma) library that calculates the exact astronomical season (Equinoxes and Solstices) for any date using the **Jean Meeus polynomial algorithm**.

> [!NOTE]
> **Mean-Polynomial Approximation (Ch. 27)**
> This plugin specifically implements the mean-polynomial calculation from Chapter 27 of Meeus' *Astronomical Algorithms*. To keep the library extremely lightweight, it omits the massive periodic correction tables required for exact apparent calculations. It is strictly enforced to support the mathematical range of **-1000 to +3000 AD**.

Because it is a true astronomical calculation rather than a fixed calendar date, it precisely determines the exact minute the sun crosses the celestial equator. It is also **hemisphere-aware**: by configuring your Tempo instance with a `sphere` (e.g., `sphere: 'south'`), the plugin accurately flips the Vernal Equinox from Spring to Autumn.

::: info Meteorological vs Astronomical
Unlike Tempo's built-in **Meteorological** `season` Term — which rigidly snaps to the 1st day of calendar months — this **Astronomical** plugin calculates the dynamic, true solar boundaries that shift slightly year-over-year.
:::
## Installation

```bash
npm install @magmacomputing/tempo-plugin-astro
```

## Usage

```typescript
import { Tempo } from '@magmacomputing/tempo';
import { AstroTerm } from '@magmacomputing/tempo-plugin-astro';

// Pass the plugin to `Tempo.init` to register it into the runtime.
Tempo.init({
plugins: [AstroTerm]
});

const t = new Tempo('2026-03-20');

// Get the Astronomical Event mapping
console.log(t.term.astro);
// Output: 'Vernal'
```

### Response Payload

When resolving the term, the plugin intelligently returns the correct astronomical event and its corresponding traditional season based on your configured hemisphere (`sphere`):

```javascript
{
key: 'Vernal', // Flips to 'Autumnal' if sphere is set to 'south'
season: 'Spring', // Flips to 'Autumn' if sphere is set to 'south'
sphere: 'north', // Flips to 'south' if sphere is set to 'south'
event: 'Equinox',
group: 'astronomy',
year: 2026,
month: 3,
day: 20,
hour: 14,
minute: 45,
second: 0
}
```

You can also access the full metadata object containing the sub-second precision fields via the `astronomy` term:

```typescript
console.log(t.term.astronomy);
// Output: { key: 'Vernal', group: 'astronomy', year: 2026, month: 3, day: 20, hour: 14, minute: 45, ... }
```

::: tip Did you know?
**Seasons:** `t.term.astronomy.season` returns the *Astronomical* season calculated by the precise timing of solstices and equinoxes. This will often differ from `t.term.season.key` in the core library, which uses standard Meteorological/Civil calendar boundaries (e.g., 1st of the month).
:::

## Licensing

This is a **Community** plugin. It is completely free and open-source for personal and commercial use. No license token is required.
Loading
Loading