Skip to content

Commit

Permalink
Merge pull request #519 from Kipper-Lang/508-feature-add-config-file-…
Browse files Browse the repository at this point in the history
…support-for-kippercli

Add config file support for `@kipper/cli`
  • Loading branch information
Luna-Klatzer authored Jun 25, 2024
2 parents 04e7d79 + 3c86d92 commit db428e5
Show file tree
Hide file tree
Showing 71 changed files with 4,042 additions and 9,099 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ To use development versions of Kipper download the

### Added

- Support for config files with a new monorepo package called `@kipper/config`, which implements config file loading
and parsing. This package is used by the Kipper CLI to automatically load and parse config files.
([#502](https://github.com/Kipper-Lang/Kipper/issues/502)).
- Added setup wizard to the `@kipper/cli` to automatically create a Kipper project with a config file.
([#502](https://github.com/Kipper-Lang/Kipper/issues/502)).
- Support for complex string formatting (or also called templating) in the form of Python-like F-Strings.
([#287](https://github.com/Kipper-Lang/Kipper/issues/287)).
- New valid conversions:
Expand All @@ -37,6 +42,7 @@ To use development versions of Kipper download the
- `ASTNodeMapper`, which handles the mapping between kind numbers, rule names, AST classes and parser context classes.
- `PrimaryExpression`, which is an abstract base class for all primary expressions.
- `PostfixExpression`, which is an abstract base class for all postfix expressions.
- `PromptModule` in `@kipper/cli`, which contains all prompt-related functions and classes.
- New interfaces:
- `PrimaryExpressionSemantics`, which represents the semantics of a primary expression.
- `PrimaryExpressionTypeSemantics`, which represents the type semantics of a primary expression.
Expand Down Expand Up @@ -73,6 +79,9 @@ To use development versions of Kipper download the
- `KipperTargetBuiltInGenerator.undefinedToStr()`, for the built-in conversion from `undefined` to `str`.
- `replaceObjKeys()`, which replaces the keys of an object with the values returned by a function.
- `inverseMap()`, which inverts a map by swapping the keys and values.
- `loadConfig()` in `@kipper/cli`, which loads a config file from the specified path.
- `loadAutoConfig()` in `@kipper/cli`, which loads a config file from the current working directory.
- `copyConfigResources()` in `@kipper/cli`, which copies the resources from the config file to the output directory.

### Changed

Expand Down
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,4 @@ which can be included and used inside a browser without any dependencies.

```bash
pnpm run add-next-tag MAJOR.MINOR.PATCH
```
```
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ We appreciate any feedback or help! Kipper is open-source and free for anyone, h
![License](https://img.shields.io/github/license/Kipper-Lang/Kipper?color=cyan)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FLuna-Klatzer%2FKipper.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FLuna-Klatzer%2FKipper?ref=badge_shield)

Copyright (C) 2021-2023 Luna Klatzer
Copyright (C) 2021-2024 Luna Klatzer

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
Expand Down
76 changes: 0 additions & 76 deletions kipper/cli/.gitignore
Original file line number Diff line number Diff line change
@@ -1,76 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# oclif .gitignore ttttt
*-debug.log
*-error.log
/.nyc_output
/lib
/tmp
/yarn.lock
node_modules

# Runtime data
pids
*.pid
*.seed
*.pid.lock
gen/

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc __tests__ coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript controller_v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# Transpiled JavaScript files from Typescript
/dist

# Cache used by TypeScript's incremental build
*.tsbuildinfo

*.idea
29 changes: 17 additions & 12 deletions kipper/cli/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
![](https://github.com/Kipper-Lang/Kipper/raw/main/img/Kipper-Logo-with-head.png)

# Kipper CLI - `@kipper/cli` 🦊🖥️
# Kipper CLI - `@kipper/cli` 🦊

The Kipper command line interface (CLI) to interact with the Kipper compiler. 🦊
The Kipper command line interface (CLI) to interact with the Kipper compiler. ⌨️

Kipper is a JavaScript-like strongly and strictly typed language with Python flavour. It aims to provide
straightforward, simple, secure and type-safe coding with better efficiency and developer satisfaction!

It compiles to both JavaScript and TypeScript, and can be set up in your terminal, Node.js or ES6+ browser. 🦊🖥️
It compiles to both JavaScript and TypeScript, and can be set up in your terminal, Node.js or ES6+ browser. 🦊💻

_For more details, you can read more about this project on the [project repository](https://github.com/Kipper-Lang/Kipper)
and the [Kipper website](https://kipper-lang.org)._
Expand All @@ -22,9 +22,10 @@ and the [Kipper website](https://kipper-lang.org)._
[![DOI](https://zenodo.org/badge/411260595.svg)](https://zenodo.org/badge/latestdoi/411260595)

<!-- toc -->
* [Kipper CLI - `@kipper/cli` 🦊🖥️](#kipper-cli---kippercli-️)
* [Usage](#usage)
* [Commands](#commands)

- [Kipper CLI - `@kipper/cli` 🦊🖥️](#kipper-cli---kippercli-️)
- [Usage](#usage)
- [Commands](#commands)
<!-- tocstop -->

## General Information
Expand All @@ -39,6 +40,7 @@ and the [Kipper website](https://kipper-lang.org)._
# Usage

<!-- usage -->

```sh-session
$ npm install -g @kipper/cli
$ kipper COMMAND
Expand All @@ -50,16 +52,18 @@ USAGE
$ kipper COMMAND
...
```

<!-- usagestop -->

# Commands

<!-- commands -->
* [`kipper analyse [FILE]`](#kipper-analyse-file)
* [`kipper compile [FILE]`](#kipper-compile-file)
* [`kipper help [COMMAND]`](#kipper-help-command)
* [`kipper run [FILE]`](#kipper-run-file)
* [`kipper version`](#kipper-version)

- [`kipper analyse [FILE]`](#kipper-analyse-file)
- [`kipper compile [FILE]`](#kipper-compile-file)
- [`kipper help [COMMAND]`](#kipper-help-command)
- [`kipper run [FILE]`](#kipper-run-file)
- [`kipper version`](#kipper-version)

## `kipper analyse [FILE]`

Expand Down Expand Up @@ -188,6 +192,7 @@ USAGE
```

_See code: [src/commands/version.ts](https://github.com/Kipper-Lang/Kipper/blob/v0.11.0-alpha.1/kipper/cli/src/commands/version.ts)_

<!-- commandsstop -->

## Contributing to Kipper
Expand All @@ -204,7 +209,7 @@ We appreciate any feedback or help! Kipper is open-source and free for anyone, h
![License](https://img.shields.io/github/license/Kipper-Lang/Kipper?color=cyan)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FLuna-Klatzer%2FKipper.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FLuna-Klatzer%2FKipper?ref=badge_shield)

Copyright (C) 2021-2023 Luna Klatzer
Copyright (C) 2021-2024 Luna Klatzer

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
Expand Down
29 changes: 17 additions & 12 deletions kipper/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"kipper": "./bin/run"
},
"dependencies": {
"@kipper/config": "workspace:~",
"@kipper/core": "workspace:~",
"@kipper/target-js": "workspace:~",
"@kipper/target-ts": "workspace:~",
Expand All @@ -16,21 +17,18 @@
"@oclif/parser": "3.8.10",
"@oclif/errors": "1.3.6",
"@oclif/plugin-warn-if-update-available": "2.0.37",
"tslog": "3.3.4"
"tslib": "~2.6.2",
"tslog": "3.3.4",
"ts-node": "10.9.2",
"chalk": "4.1.2",
"inquirer": "7.3.3"
},
"devDependencies": {
"@types/node": "18.16.16",
"@types/sinon": "10.0.15",
"@oclif/test": "2.3.21",
"ts-node": "10.9.1",
"@sinonjs/fake-timers": "10.0.2",
"rimraf": "5.0.1",
"os-tmpdir": "1.0.2",
"pseudomap": "1.0.2",
"typescript": "5.1.3",
"oclif": "3.4.6",
"json-parse-even-better-errors": "2.3.1",
"semver": "7.5.1"
"@types/inquirer": "7.3.3",
"typescript": "5.1.3",
"prettier": "2.8.8"
},
"engines": {
"node": ">=16.0.0",
Expand Down Expand Up @@ -81,8 +79,15 @@
"lint": "pnpm run tslint && pnpm run prettier",
"lint:fix": "pnpm run tslint:fix && pnpm run prettier",
"build": "tsc",
"postbuild": "cp -r ./src/templates ./lib/templates",
"tslint": "eslint ./src/ --ext .ts --config ./../../.eslintrc",
"tslint:fix": "eslint ./src/ --ext .ts --config ./../../.eslintrc --fix",
"start": "node ./bin/run"
"start": "node ./bin/run",
"start:analyse": "node ./bin/run analyse",
"start:compile": "node ./bin/run compile",
"start:help": "node ./bin/run help",
"start:new": "node ./bin/run new",
"start:run": "node ./bin/run run",
"start:version": "node ./bin/run version"
}
}
Loading

0 comments on commit db428e5

Please sign in to comment.