Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

converted to typescript and GSF conventions #2

Merged
merged 1 commit into from
Sep 23, 2024
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
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build/
dist/
src/**/**.d.ts
src/**/**.js
8 changes: 8 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./node_modules/gts/",
"rules": {
"@typescript-eslint/no-explicit-any": [
"off"
]
}
}
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve
labels: 'bug'
---
<!--- Please provide us the following info -->

## Description of the Error
<!--- Tell us what happened -->

## Expected Behaviour
<!--- Tell us what should happen -->

## Actual Behaviour
<!--- Tell us what happens instead of the expected behavior -->

## Steps to Reproduce
<!--- A set of specific instructions to reproduce the bug. Include code, if relevant -->


## Link to online environment
<!--- Please provide a link to Stackblitz or similar tool that allows us to reproduce your error in a preconfigured online environment -->

<!--- If you provided a link to Stackblitz or similar, you can ignore the remaining fields.
Otherwise, please provide the following information -->

## Manifest File That Generated the Error

<!--- Provide the manifest file that you ran that generated the error-->

## Links to Any Additional Code
<!--- E.g. your plugin code, it must be available online -->

## Runtime Info
<!--- Such as OS, node version, package.json, IF version -->
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/feedback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Feedback
about: Submitting feedback on plugin template
title: 'Feedback - '
labels: ''
assignees: ''

---

## Scope

What does your feedback relate to?

- [] Project aims/objectives
- [] Repository structure
- [] Documentation
- [] Tests
- [] Other

## Details

Does your feedback relate to a specific problem that can be demonstrated and reproduced? If so, please provide details of how to repro below.
Include your platform config and the version of IEF you are using (e.g. Ubuntu 20.04, running latest dev branch on XX date).

## Expected Behaviour

What do things look like if they are going right?
e.g. "the github issue board is cleared out every X days"

## Actual behaviour

How are things actually working?
e.g. "issues are sitting on the board for over X days"

## Proposed actions

What fixes do you propose?
e.g. "please define a response time of X days for issues and publish in the project README"


**Note: We will take all feedback seriously. Please be polite and constructive - aggressive or abusive feedback will simply be deleted.**
21 changes: 21 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply. -->
- [ ] Enhancement (project structure, spelling, grammar, formatting)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.


### A description of the changes proposed in the Pull Request
<!--- Provide a small description of the changes. -->
-
-


<!-- Make sure tests and lint pass on CI. -->

26 changes: 26 additions & 0 deletions .github/workflows/nodejs-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Node.js CI

on: push

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Run lint
run: npm run lint

- name: Run tests
run: npm run test --silent
14 changes: 11 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Dependency directories
node_modules/
src/**/*.js
src/**/*.d.ts
lib/**/*.js
lib/**/*.d.ts
node_modules
.idea
*.tsbuildinfo
dist
yarn-error.log
build
coverage
.env
/.idea/
examples/outputs
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint
# npm test
npm run fix:package
15 changes: 15 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# Exclude typescript source and config
*.ts
tsconfig.json

# Include javascript files and typescript declarations
!*.js
!*.d.ts

# Exclude jsii outdir
dist

# Include .jsii and .jsii.gz
!.jsii
!.jsii.gz
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('gts/.prettierrc.json')
}
48 changes: 38 additions & 10 deletions examples/outputs/water-cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,57 @@ tags: null
initialize:
plugins:
water-cloud:
path: water-cloud
path: if-water-cloud
method: WaterCloud
global-config:
keep-exisiting: true
execution:
command: >-
/opt/homebrew/Cellar/node/22.8.0/bin/node /opt/homebrew/bin/if-run
--manifest ./examples/water-cloud.yml --output
./examples/outputs/water-cloud.yml
/Users/adamcoles/.npm/_npx/1bf7c3c15bf47d04/node_modules/.bin/ts-node
/Users/adamcoles/oc-workspace/if/src/if-run/index.ts --manifest
../if-water-cloud/examples/water-cloud.yml --output
../if-water-cloud/examples/outputs/water-cloud.yml
environment:
if-version: 0.6.0
os: macOS
os-version: 14.6.1
node-version: 22.8.0
date-time: 2024-09-16T11:25:29.344Z (UTC)
dependencies: []
date-time: 2024-09-23T14:38:25.934Z (UTC)
dependencies:
- '@babel/core@7.22.10'
- '@babel/preset-typescript@7.23.3'
- '@commitlint/cli@18.6.0'
- '@commitlint/config-conventional@18.6.0'
- '@grnsft/if-core@0.0.23'
- '@jest/globals@29.7.0'
- '@types/jest@29.5.8'
- '@types/js-yaml@4.0.9'
- '@types/luxon@3.4.2'
- '@types/node@20.9.0'
- axios-mock-adapter@1.22.0
- axios@1.7.2
- cross-env@7.0.3
- csv-parse@5.5.6
- csv-stringify@6.4.6
- fixpack@4.0.0
- gts@5.2.0
- husky@8.0.3
- if-water-cloud@1.0.0 extraneous -> file:../../if-water-cloud
- jest@29.7.0
- js-yaml@4.1.0
- lint-staged@15.2.2
- luxon@3.4.4
- release-it@16.3.0
- rimraf@5.0.5
- ts-command-line-args@2.5.1
- ts-jest@29.1.1
- typescript-cubic-spline@1.0.1
- typescript@5.2.2
- winston@3.11.0
- zod@3.23.8
status: success
tree:
pipeline:
compute:
- water-cloud
config:
water-cloud: null
inputs:
- timestamp: 2024-04-01T00:00
duration: 100
Expand Down
8 changes: 4 additions & 4 deletions examples/water-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ initialize:
plugins:
water-cloud:
method: WaterCloud
path: 'water-cloud'
path: 'if-water-cloud'
global-config:
keep-exisiting: true
default-wue: 1.8
input-parameters: ['energy']
output-parameter: 'water-cloud'
tree:
pipeline:
compute:
- water-cloud
config:
water-cloud:
inputs:
- timestamp: 2024-04-01T00:00
duration: 100
Expand Down
14 changes: 14 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
transform: {
'^.+\\.ts?$': [
'ts-jest',
{
tsconfig: 'tsconfig.json',
},
],
},
modulePathIgnorePatterns: ['./build'],
};
Loading
Loading