Compare commits
No commits in common. "master" and "v3.0.10" have entirely different histories.
@ -1,66 +0,0 @@
|
|||||||
name: Default (not tags)
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags-ignore:
|
|
||||||
- '**'
|
|
||||||
|
|
||||||
env:
|
|
||||||
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
|
||||||
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
|
|
||||||
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
|
||||||
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
|
||||||
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
|
|
||||||
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
security:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
continue-on-error: true
|
|
||||||
container:
|
|
||||||
image: ${{ env.IMAGE }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install pnpm and npmci
|
|
||||||
run: |
|
|
||||||
pnpm install -g pnpm
|
|
||||||
pnpm install -g @shipzone/npmci
|
|
||||||
|
|
||||||
- name: Run npm prepare
|
|
||||||
run: npmci npm prepare
|
|
||||||
|
|
||||||
- name: Audit production dependencies
|
|
||||||
run: |
|
|
||||||
npmci command npm config set registry https://registry.npmjs.org
|
|
||||||
npmci command pnpm audit --audit-level=high --prod
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: Audit development dependencies
|
|
||||||
run: |
|
|
||||||
npmci command npm config set registry https://registry.npmjs.org
|
|
||||||
npmci command pnpm audit --audit-level=high --dev
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
test:
|
|
||||||
if: ${{ always() }}
|
|
||||||
needs: security
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: ${{ env.IMAGE }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Test stable
|
|
||||||
run: |
|
|
||||||
npmci node install stable
|
|
||||||
npmci npm install
|
|
||||||
npmci npm test
|
|
||||||
|
|
||||||
- name: Test build
|
|
||||||
run: |
|
|
||||||
npmci node install stable
|
|
||||||
npmci npm install
|
|
||||||
npmci npm build
|
|
@ -1,124 +0,0 @@
|
|||||||
name: Default (tags)
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
env:
|
|
||||||
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
|
||||||
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
|
|
||||||
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
|
|
||||||
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
|
|
||||||
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
|
|
||||||
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
security:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
continue-on-error: true
|
|
||||||
container:
|
|
||||||
image: ${{ env.IMAGE }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Prepare
|
|
||||||
run: |
|
|
||||||
pnpm install -g pnpm
|
|
||||||
pnpm install -g @shipzone/npmci
|
|
||||||
npmci npm prepare
|
|
||||||
|
|
||||||
- name: Audit production dependencies
|
|
||||||
run: |
|
|
||||||
npmci command npm config set registry https://registry.npmjs.org
|
|
||||||
npmci command pnpm audit --audit-level=high --prod
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
- name: Audit development dependencies
|
|
||||||
run: |
|
|
||||||
npmci command npm config set registry https://registry.npmjs.org
|
|
||||||
npmci command pnpm audit --audit-level=high --dev
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
test:
|
|
||||||
if: ${{ always() }}
|
|
||||||
needs: security
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: ${{ env.IMAGE }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Prepare
|
|
||||||
run: |
|
|
||||||
pnpm install -g pnpm
|
|
||||||
pnpm install -g @shipzone/npmci
|
|
||||||
npmci npm prepare
|
|
||||||
|
|
||||||
- name: Test stable
|
|
||||||
run: |
|
|
||||||
npmci node install stable
|
|
||||||
npmci npm install
|
|
||||||
npmci npm test
|
|
||||||
|
|
||||||
- name: Test build
|
|
||||||
run: |
|
|
||||||
npmci node install stable
|
|
||||||
npmci npm install
|
|
||||||
npmci npm build
|
|
||||||
|
|
||||||
release:
|
|
||||||
needs: test
|
|
||||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: ${{ env.IMAGE }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Prepare
|
|
||||||
run: |
|
|
||||||
pnpm install -g pnpm
|
|
||||||
pnpm install -g @shipzone/npmci
|
|
||||||
npmci npm prepare
|
|
||||||
|
|
||||||
- name: Release
|
|
||||||
run: |
|
|
||||||
npmci node install stable
|
|
||||||
npmci npm publish
|
|
||||||
|
|
||||||
metadata:
|
|
||||||
needs: test
|
|
||||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: ${{ env.IMAGE }}
|
|
||||||
continue-on-error: true
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Prepare
|
|
||||||
run: |
|
|
||||||
pnpm install -g pnpm
|
|
||||||
pnpm install -g @shipzone/npmci
|
|
||||||
npmci npm prepare
|
|
||||||
|
|
||||||
- name: Code quality
|
|
||||||
run: |
|
|
||||||
npmci command npm install -g typescript
|
|
||||||
npmci npm install
|
|
||||||
|
|
||||||
- name: Trigger
|
|
||||||
run: npmci trigger
|
|
||||||
|
|
||||||
- name: Build docs and upload artifacts
|
|
||||||
run: |
|
|
||||||
npmci node install stable
|
|
||||||
npmci npm install
|
|
||||||
pnpm install -g @git.zone/tsdoc
|
|
||||||
npmci command tsdoc
|
|
||||||
continue-on-error: true
|
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -15,6 +15,8 @@ node_modules/
|
|||||||
|
|
||||||
# builds
|
# builds
|
||||||
dist/
|
dist/
|
||||||
dist_*/
|
dist_web/
|
||||||
|
dist_serve/
|
||||||
|
dist_ts_web/
|
||||||
|
|
||||||
# custom
|
# custom
|
126
.gitlab-ci.yml
Normal file
126
.gitlab-ci.yml
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
# gitzone ci_default
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- .npmci_cache/
|
||||||
|
key: '$CI_BUILD_STAGE'
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- security
|
||||||
|
- test
|
||||||
|
- release
|
||||||
|
- metadata
|
||||||
|
|
||||||
|
# ====================
|
||||||
|
# security stage
|
||||||
|
# ====================
|
||||||
|
mirror:
|
||||||
|
stage: security
|
||||||
|
script:
|
||||||
|
- npmci git mirror
|
||||||
|
tags:
|
||||||
|
- lossless
|
||||||
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
|
snyk:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:snyk
|
||||||
|
stage: security
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci command npm install --ignore-scripts
|
||||||
|
- npmci command snyk test
|
||||||
|
tags:
|
||||||
|
- lossless
|
||||||
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
|
# ====================
|
||||||
|
# test stage
|
||||||
|
# ====================
|
||||||
|
|
||||||
|
testStable:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci node install stable
|
||||||
|
- npmci npm install
|
||||||
|
- npmci npm test
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
|
tags:
|
||||||
|
- lossless
|
||||||
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
|
testBuild:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci node install stable
|
||||||
|
- npmci npm install
|
||||||
|
- npmci command npm run build
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
|
tags:
|
||||||
|
- lossless
|
||||||
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
|
release:
|
||||||
|
stage: release
|
||||||
|
script:
|
||||||
|
- npmci node install stable
|
||||||
|
- npmci npm publish
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- lossless
|
||||||
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
|
# ====================
|
||||||
|
# metadata stage
|
||||||
|
# ====================
|
||||||
|
codequality:
|
||||||
|
stage: metadata
|
||||||
|
allow_failure: true
|
||||||
|
script:
|
||||||
|
- npmci command npm install -g tslint typescript
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci npm install
|
||||||
|
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||||
|
tags:
|
||||||
|
- lossless
|
||||||
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
stage: metadata
|
||||||
|
script:
|
||||||
|
- npmci trigger
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- lossless
|
||||||
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
|
pages:
|
||||||
|
stage: metadata
|
||||||
|
script:
|
||||||
|
- npmci node install lts
|
||||||
|
- npmci command npm install -g @gitzone/tsdoc
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci npm install
|
||||||
|
- npmci command tsdoc
|
||||||
|
tags:
|
||||||
|
- lossless
|
||||||
|
- docker
|
||||||
|
- notpriv
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1 week
|
||||||
|
paths:
|
||||||
|
- public
|
||||||
|
allow_failure: true
|
23
.snyk
Normal file
23
.snyk
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
|
||||||
|
version: v1.13.5
|
||||||
|
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
|
||||||
|
ignore:
|
||||||
|
SNYK-JS-JSYAML-173999:
|
||||||
|
- '@pushrocks/smartfm > gray-matter > js-yaml':
|
||||||
|
reason: None given
|
||||||
|
expires: '2019-10-10T16:23:38.993Z'
|
||||||
|
- '@pushrocks/smartyaml > js-yaml':
|
||||||
|
reason: None given
|
||||||
|
expires: '2019-10-10T16:23:38.993Z'
|
||||||
|
SNYK-JS-JSYAML-174129:
|
||||||
|
- '@pushrocks/smartfm > gray-matter > js-yaml':
|
||||||
|
reason: None given
|
||||||
|
expires: '2019-10-10T16:23:38.993Z'
|
||||||
|
- '@pushrocks/smartyaml > js-yaml':
|
||||||
|
reason: None given
|
||||||
|
expires: '2019-10-10T16:23:38.993Z'
|
||||||
|
SNYK-JS-LODASH-450202:
|
||||||
|
- '@pushrocks/smartinteract > inquirer > lodash':
|
||||||
|
reason: None given
|
||||||
|
expires: '2019-10-10T16:23:38.993Z'
|
||||||
|
patch: {}
|
24
.vscode/launch.json
vendored
24
.vscode/launch.json
vendored
@ -2,10 +2,28 @@
|
|||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"command": "npm test",
|
"name": "current file",
|
||||||
"name": "Run npm test",
|
"type": "node",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"type": "node-terminal"
|
"args": [
|
||||||
|
"${relativeFile}"
|
||||||
|
],
|
||||||
|
"runtimeArgs": ["-r", "@gitzone/tsrun"],
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"protocol": "inspector",
|
||||||
|
"internalConsoleOptions": "openOnSessionStart"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "test.ts",
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"args": [
|
||||||
|
"test/test.ts"
|
||||||
|
],
|
||||||
|
"runtimeArgs": ["-r", "@gitzone/tsrun"],
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"protocol": "inspector",
|
||||||
|
"internalConsoleOptions": "openOnSessionStart"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -15,7 +15,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"projectType": {
|
"projectType": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": ["website", "element", "service", "npm", "wcc"]
|
"enum": ["website", "element", "service", "npm"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
237
changelog.md
237
changelog.md
@ -1,237 +0,0 @@
|
|||||||
# Changelog
|
|
||||||
|
|
||||||
## 2025-04-15 - 4.0.16 - fix(dependencies)
|
|
||||||
Update dependency references and bump version numbers; adjust workflow and template commands
|
|
||||||
|
|
||||||
- Bump versions for devDependencies (@git.zone/tsbuild, @git.zone/tsrun, @git.zone/tstest, @push.rocks/tapbundle, and @types/node) and dependencies (@push.rocks/lik, @push.rocks/smartfile, @push.rocks/smartfm, @push.rocks/smarthbs, @push.rocks/smartinteract, @push.rocks/smartobject, @push.rocks/smartpromise, @push.rocks/smartshell, and @push.rocks/smartyaml)
|
|
||||||
- Replace smartparam with smartobject in both plugins and core modules
|
|
||||||
- Fix workflow install command by renaming '@gitzone/tsdoc' to '@git.zone/tsdoc'
|
|
||||||
- Update template runafter command from 'npm install' to 'echo "runafter"'
|
|
||||||
|
|
||||||
## 2024-05-29 - 4.0.15 - configuration updates
|
|
||||||
Updates to the project’s configuration files, description and build settings.
|
|
||||||
|
|
||||||
- Updated description.
|
|
||||||
- Updated tsconfig (applied in multiple commits).
|
|
||||||
- Updated npmextra.json (githost).
|
|
||||||
|
|
||||||
## 2023-08-18 - 4.0.14 - core
|
|
||||||
Improved core functionality.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2023-07-25 - 4.0.13 - core & organization
|
|
||||||
Enhancements in core behavior and organizational structure.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
- Switched to new organization scheme.
|
|
||||||
|
|
||||||
## 2023-06-25 - 4.0.12 - core
|
|
||||||
Core improvements.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2023-06-25 - 4.0.11 - core
|
|
||||||
Core improvements.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2023-06-25 - 4.0.10 - core
|
|
||||||
Core improvements.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2023-06-25 - 4.0.9 - core
|
|
||||||
Core improvements.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2023-06-25 - 4.0.8 - core
|
|
||||||
Core improvements.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2023-06-25 - 4.0.7 - core
|
|
||||||
Core improvements.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2023-06-25 - 4.0.6 - core
|
|
||||||
Core improvements.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2023-06-25 - 4.0.5 - core
|
|
||||||
Core improvements.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2023-06-24 - 4.0.4 - core
|
|
||||||
Core improvements.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2023-06-24 - 4.0.3 - core
|
|
||||||
Core improvements.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2022-06-25 - 4.0.2 - core
|
|
||||||
Core improvements.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2022-06-25 - 4.0.1 - core
|
|
||||||
Core improvements.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2022-06-25 - 4.0.0 - core
|
|
||||||
Core improvements.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2022-06-25 - 3.0.10 - core (breaking)
|
|
||||||
A breaking change was introduced affecting the module format.
|
|
||||||
|
|
||||||
- BREAKING CHANGE (core): switched to ESM.
|
|
||||||
|
|
||||||
## 2020-01-31 - 3.0.9 - core
|
|
||||||
Routine core update.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2019-10-11 - 3.0.8 - core
|
|
||||||
Routine core update.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2019-10-02 - 3.0.7 - core
|
|
||||||
Routine core update.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2019-09-10 - 3.0.6 - core
|
|
||||||
Routine core update.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2019-09-10 - 3.0.5 - core
|
|
||||||
Routine core update.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2019-09-10 - 3.0.4 - core
|
|
||||||
Routine core update.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2019-09-10 - 3.0.3 - general updates
|
|
||||||
Updates to project dependencies and general code improvements.
|
|
||||||
|
|
||||||
- Performed update.
|
|
||||||
- Updated dependencies.
|
|
||||||
|
|
||||||
## 2019-02-17 - 3.0.2 - core
|
|
||||||
Routine core update.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2019-01-27 - 3.0.1 - core
|
|
||||||
Routine core update.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
|
|
||||||
## 2018-10-04 - 3.0.0 - core
|
|
||||||
Changes from merging and core improvements.
|
|
||||||
|
|
||||||
- Fixed core update.
|
|
||||||
- Merged master branch changes and performed additional updates.
|
|
||||||
|
|
||||||
## 2018-08-30 - 2.0.2 - structure (breaking)
|
|
||||||
A breaking change in the project’s structure.
|
|
||||||
|
|
||||||
- BREAKING CHANGE (structure): templates now take their path within the constructor.
|
|
||||||
|
|
||||||
## 2018-08-27 - 2.0.1 - minor
|
|
||||||
Versions in this range involved only version bump commits with no significant changes.
|
|
||||||
|
|
||||||
- No significant changes.
|
|
||||||
|
|
||||||
## 2017-08-09 - 1.0.14 - scope (breaking)
|
|
||||||
A breaking change in the package scope was applied.
|
|
||||||
|
|
||||||
- BREAKING CHANGE (scope): switched to new @pushrocks scope.
|
|
||||||
|
|
||||||
## 2017-08-09 - 1.0.13 - core
|
|
||||||
Improvements to variable handling.
|
|
||||||
|
|
||||||
- Fixed variable distribution.
|
|
||||||
|
|
||||||
## 2017-07-28 - 1.0.12 - dependencies
|
|
||||||
Dependency updates.
|
|
||||||
|
|
||||||
- Updated dependencies.
|
|
||||||
|
|
||||||
## 2017-06-01 - 1.0.11 - dependencies
|
|
||||||
Dependency updates.
|
|
||||||
|
|
||||||
- Updated dependencies.
|
|
||||||
|
|
||||||
## 2017-06-01 - 1.0.10 - CLI improvements
|
|
||||||
Enhanced CLI error prevention.
|
|
||||||
|
|
||||||
- Prevented error due to empty defaults.yml.
|
|
||||||
|
|
||||||
## 2017-05-27 - 1.0.9 - dependencies
|
|
||||||
Dependency updates.
|
|
||||||
|
|
||||||
- Updated dependencies.
|
|
||||||
|
|
||||||
## 2017-05-27 - 1.0.8 - templating
|
|
||||||
Improved file templating support.
|
|
||||||
|
|
||||||
- Added support for frontmatter for advanced file templating.
|
|
||||||
|
|
||||||
## 2017-05-27 - 1.0.7 - documentation
|
|
||||||
Documentation improvements.
|
|
||||||
|
|
||||||
- Added docs.
|
|
||||||
|
|
||||||
## 2017-05-27 - 1.0.6 - fixes
|
|
||||||
Minor fixes.
|
|
||||||
|
|
||||||
- Fixed deep add.
|
|
||||||
|
|
||||||
## 2017-05-26 - 1.0.5 - smartfile updates
|
|
||||||
Smartfile updates.
|
|
||||||
|
|
||||||
- Updated smartfile.
|
|
||||||
|
|
||||||
## 2017-05-26 - 1.0.4 - tests
|
|
||||||
Test fixes.
|
|
||||||
|
|
||||||
- Fixed tests.
|
|
||||||
|
|
||||||
## 2017-05-26 - 1.0.3 - smartfile updates
|
|
||||||
Smartfile updates.
|
|
||||||
|
|
||||||
- Updated smartfile.
|
|
||||||
|
|
||||||
## 2017-05-25 - 1.0.2 - functionality
|
|
||||||
Minor functionality improvements.
|
|
||||||
|
|
||||||
- Ensured proper functionality.
|
|
||||||
|
|
||||||
## 2017-05-25 - 1.0.1 - core
|
|
||||||
Core fixes.
|
|
||||||
|
|
||||||
- Fixed working issues.
|
|
||||||
|
|
||||||
## 2017-05-06 - 1.0.0 - initial release and CLI integration
|
|
||||||
The initial release introducing CLI support and project setup.
|
|
||||||
|
|
||||||
- Added CLI to prompt for missing variables.
|
|
||||||
- Started CLI integration.
|
|
||||||
- Added readme and CI tslint configuration.
|
|
||||||
- Performed initial setup and various update tasks.
|
|
@ -9,25 +9,12 @@
|
|||||||
"gitzone": {
|
"gitzone": {
|
||||||
"projectType": "npm",
|
"projectType": "npm",
|
||||||
"module": {
|
"module": {
|
||||||
"githost": "code.foss.global",
|
"githost": "gitlab.com",
|
||||||
"gitscope": "push.rocks",
|
"gitscope": "pushrocks",
|
||||||
"gitrepo": "smartscaf",
|
"gitrepo": "smartscaf",
|
||||||
"description": "A project aimed at quickly scaffolding projects with support for TypeScript, smart file handling, and template rendering.",
|
"shortDescription": "scaffold projects quickly",
|
||||||
"npmPackagename": "@push.rocks/smartscaf",
|
"npmPackagename": "@pushrocks/smartscaf",
|
||||||
"license": "MIT",
|
"license": "MIT"
|
||||||
"keywords": [
|
|
||||||
"typescript",
|
|
||||||
"scaffolding",
|
|
||||||
"template rendering",
|
|
||||||
"file handling",
|
|
||||||
"project setup",
|
|
||||||
"smart interaction",
|
|
||||||
"yaml",
|
|
||||||
"cli tool"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"tsdoc": {
|
|
||||||
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
1923
package-lock.json
generated
Normal file
1923
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
68
package.json
68
package.json
@ -1,68 +1,58 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartscaf",
|
"name": "@pushrocks/smartscaf",
|
||||||
"version": "4.0.16",
|
"version": "3.0.10",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A project aimed at quickly scaffolding projects with support for TypeScript, smart file handling, and template rendering.",
|
"description": "scaffold projects quickly",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "(tstest test/)",
|
||||||
"build": "(tsbuild --web --allowimplicitany)",
|
"build": "(tsbuild)"
|
||||||
"buildDocs": "tsdoc"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://code.foss.global/push.rocks/smartscaf.git"
|
"url": "git+ssh://git@gitlab.com/pushrocks/smartscaf.git"
|
||||||
},
|
},
|
||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://gitlab.com/pushrocks/smartscaf/issues"
|
"url": "https://gitlab.com/pushrocks/smartscaf/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://code.foss.global/push.rocks/smartscaf",
|
"homepage": "https://gitlab.com/pushrocks/smartscaf#README",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"typescript",
|
"scaffold",
|
||||||
"scaffolding",
|
"polymer",
|
||||||
"template rendering",
|
"npm"
|
||||||
"file handling",
|
|
||||||
"project setup",
|
|
||||||
"smart interaction",
|
|
||||||
"yaml",
|
|
||||||
"cli tool"
|
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@git.zone/tsbuild": "^2.3.2",
|
"@gitzone/tsbuild": "^2.1.17",
|
||||||
"@git.zone/tsrun": "^1.3.3",
|
"@gitzone/tsrun": "^1.2.8",
|
||||||
"@git.zone/tstest": "^1.0.96",
|
"@gitzone/tstest": "^1.0.28",
|
||||||
"@push.rocks/tapbundle": "^5.6.3",
|
"@pushrocks/tapbundle": "^3.2.0",
|
||||||
"@types/node": "^22.14.1"
|
"@types/node": "^13.5.3",
|
||||||
|
"tslint": "^6.0.0",
|
||||||
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@push.rocks/lik": "^6.1.0",
|
"@pushrocks/lik": "^3.0.13",
|
||||||
"@push.rocks/smartfile": "^11.2.0",
|
"@pushrocks/smartfile": "^7.0.6",
|
||||||
"@push.rocks/smartfm": "^2.2.2",
|
"@pushrocks/smartfm": "^2.0.4",
|
||||||
"@push.rocks/smarthbs": "^3.0.3",
|
"@pushrocks/smarthbs": "^2.0.8",
|
||||||
"@push.rocks/smartinteract": "^2.0.16",
|
"@pushrocks/smartinteract": "^2.0.4",
|
||||||
"@push.rocks/smartobject": "^1.0.12",
|
"@pushrocks/smartparam": "^1.1.3",
|
||||||
"@push.rocks/smartpromise": "^4.2.3",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
"@push.rocks/smartshell": "^3.2.3",
|
"@pushrocks/smartshell": "^2.0.25",
|
||||||
"@push.rocks/smartyaml": "^3.0.4"
|
"@pushrocks/smartyaml": "^2.0.3"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
"ts_web/**/*",
|
"ts_web/**/*",
|
||||||
"dist/**/*",
|
"dist/**/*",
|
||||||
"dist_*/**/*",
|
"dist_web/**/*",
|
||||||
"dist_ts/**/*",
|
|
||||||
"dist_ts_web/**/*",
|
"dist_ts_web/**/*",
|
||||||
"assets/**/*",
|
"assets/**/*",
|
||||||
"cli.js",
|
"cli.js",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
],
|
]
|
||||||
"type": "module",
|
|
||||||
"browserslist": [
|
|
||||||
"last 1 chrome versions"
|
|
||||||
],
|
|
||||||
"packageManager": "pnpm@10.7.0+sha512.6b865ad4b62a1d9842b61d674a393903b871d9244954f652b8842c2b553c72176b278f64c463e52d40fff8aba385c235c8c9ecf5cc7de4fd78b8bb6d49633ab6"
|
|
||||||
}
|
}
|
||||||
|
10262
pnpm-lock.yaml
generated
10262
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
|||||||
|
|
108
readme.md
108
readme.md
@ -1,97 +1,39 @@
|
|||||||
# @push.rocks/smartscaf
|
# @pushrocks/smartscaf
|
||||||
scaffold projects quickly
|
scaffold projects quickly
|
||||||
|
|
||||||
## Install
|
## Availabililty and Links
|
||||||
To install `@push.rocks/smartscaf`, run the following command in your project directory:
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartscaf)
|
||||||
|
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartscaf)
|
||||||
|
* [github.com (source mirror)](https://github.com/pushrocks/smartscaf)
|
||||||
|
* [docs (typedoc)](https://pushrocks.gitlab.io/smartscaf/)
|
||||||
|
|
||||||
```bash
|
## Status for master
|
||||||
npm install @push.rocks/smartscaf --save
|
[](https://gitlab.com/pushrocks/smartscaf/commits/master)
|
||||||
```
|
[](https://gitlab.com/pushrocks/smartscaf/commits/master)
|
||||||
|
[](https://www.npmjs.com/package/@pushrocks/smartscaf)
|
||||||
|
[](https://snyk.io/test/npm/@pushrocks/smartscaf)
|
||||||
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
[](https://prettier.io/)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Smartscaf provides a streamlined approach to quickly scaffold projects with predefined templates. It leverages modern TypeScript and ESM syntax to offer a flexible and powerful toolchain for project initialization. This guide will walk you through utilizing Smartscaf to its full potential, including setting up templates, customizing scaffolding processes, and programmatically controlling scaffolding operations.
|
Use TypeScript for best in class instellisense.
|
||||||
|
|
||||||
### Setting Up Your First Template
|
For further information read the linked docs at the top of this README.
|
||||||
|
|
||||||
A Smartscaf template is essentially a directory with a set of files that you want to reuse across projects. It can include source code files, configuration files, and a special `.smartscaf.yml` file for defining template variables and dependencies.
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||||
|
|
||||||
1. **Create a Template Directory**: This directory should contain all the files and folders representing your template.
|
[](https://)
|
||||||
|
|
||||||
2. **Define Template Variables in `.smartscaf.yml`**: This YAML file contains metadata about your template, such as default values for variables, dependency templates to merge, and scripts to run after scaffolding. Here's a basic example:
|
## Contribution
|
||||||
|
|
||||||
```yml
|
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||||
defaults:
|
|
||||||
projectName: "My Awesome Project"
|
|
||||||
dependencies:
|
|
||||||
merge: []
|
|
||||||
runafter:
|
|
||||||
- "npm install"
|
|
||||||
```
|
|
||||||
|
|
||||||
3. **Utilize Handlebars Syntax for Dynamic Content**: Files in your template can use the Handlebars syntax (`{{variableName}}`) for dynamic content that will be replaced during the scaffolding process.
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
### Scaffolding a New Project
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||||
|
|
||||||
Once you have a template ready, you can scaffold a new project by programmatically creating and manipulating a `ScafTemplate` instance from Smartscaf.
|
[](https://maintainedby.lossless.com)
|
||||||
|
|
||||||
1. **Import Smartscaf and Create a New Instance**:
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import { ScafTemplate } from '@push.rocks/smartscaf';
|
|
||||||
|
|
||||||
async function scaffoldProject() {
|
|
||||||
const myTemplate = await ScafTemplate.createTemplateFromDir('<path-to-your-template>');
|
|
||||||
await myTemplate.readTemplateFromDir(); // Load the template
|
|
||||||
// Supply any additional variables or override defaults
|
|
||||||
await myTemplate.supplyVariables({
|
|
||||||
projectName: 'My New Project'
|
|
||||||
});
|
|
||||||
// Optionally, interactively ask for missing variables
|
|
||||||
// await myTemplate.askCliForMissingVariables();
|
|
||||||
await myTemplate.writeToDisk('<destination-path>'); // Scaffold!
|
|
||||||
}
|
|
||||||
|
|
||||||
scaffoldProject().then(() => console.log('Project scaffolded successfully!'));
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **Customizing the Scaffolding Process**: You can customize the scaffolding process by defining additional logic to manipulate files, directories, or template variables before writing to disk.
|
|
||||||
|
|
||||||
### Advanced Features
|
|
||||||
|
|
||||||
- **Merging Templates**: Smartscaf allows you to compose complex templates by specifying dependencies in the `.smartscaf.yml` file. This enables you to merge multiple templates into one scaffolded project.
|
|
||||||
|
|
||||||
- **Running Scripts After Scaffolding**: Specify an array of shell commands in the `runafter` section of your `.smartscaf.yml` to be executed after the project is scaffolded. This is useful for running installations or initial builds.
|
|
||||||
|
|
||||||
- **Programmatic API**: Smartscaf's flexible API allows for programmatically controlling every aspect of the scaffolding process, making it suitable for integrating into build tools, command line utilities, or CI/CD pipelines.
|
|
||||||
|
|
||||||
### Complete Feature Set and Use Cases
|
|
||||||
|
|
||||||
The usage scenarios outlined above merely scratch the surface of what Smartscaf can do. With its comprehensive API, you can manage complex scaffolding tasks, including but not limited to:
|
|
||||||
|
|
||||||
- Creating project templates with varying levels of complexity and customization.
|
|
||||||
- Dynamically adjusting project structures based on user input or external parameters.
|
|
||||||
- Integrating scaffolding steps into larger automation workflows, significantly reducing manual setup time for new projects.
|
|
||||||
|
|
||||||
In conclusion, Smartscaf empowers developers to streamline their project initialization process, ensuring consistency, reducing boilerplate, and allowing more time to be spent on development rather than setup. Its flexibility and broad feature set make it a valuable tool in a modern developer's toolkit.
|
|
||||||
|
|
||||||
For further information and a deeper dive into Smartscaf's capabilities, please refer to the [official documentation](https://gitlab.com/push.rocks/smartscaf#README) and explore the [source code](https://gitlab.com/push.rocks/smartscaf) for advanced use cases and customization options.
|
|
||||||
|
|
||||||
## License and Legal Information
|
|
||||||
|
|
||||||
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
|
||||||
|
|
||||||
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
### Trademarks
|
|
||||||
|
|
||||||
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
|
|
||||||
|
|
||||||
### Company Information
|
|
||||||
|
|
||||||
Task Venture Capital GmbH
|
|
||||||
Registered at District court Bremen HRB 35230 HB, Germany
|
|
||||||
|
|
||||||
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
|
|
||||||
|
|
||||||
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { expect, tap } from '@push.rocks/tapbundle';
|
import { expect, tap } from '@pushrocks/tapbundle';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
import * as smartscaf from '../ts/index.js';
|
import * as smartscaf from '../ts/index';
|
||||||
|
|
||||||
process.env.CI = 'true';
|
process.env.CI = 'true';
|
||||||
|
|
||||||
@ -9,12 +9,12 @@ let testScafTemplate: smartscaf.ScafTemplate;
|
|||||||
|
|
||||||
tap.test('should create new Smartscaf instance', async () => {
|
tap.test('should create new Smartscaf instance', async () => {
|
||||||
testScafTemplate = new smartscaf.ScafTemplate('./test/test_template');
|
testScafTemplate = new smartscaf.ScafTemplate('./test/test_template');
|
||||||
expect(testScafTemplate).toBeInstanceOf(smartscaf.ScafTemplate);
|
expect(testScafTemplate).to.be.instanceof(smartscaf.ScafTemplate);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('Smartscaf instance -> should read a template directory', async () => {
|
tap.test('Smartscaf instance -> should read a template directory', async () => {
|
||||||
await testScafTemplate.readTemplateFromDir();
|
await testScafTemplate.readTemplateFromDir();
|
||||||
expect(testScafTemplate.templateSmartfileArray.length).toEqual(6);
|
expect(testScafTemplate.templateSmartfileArray.length).to.equal(6);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('smartfile -> should accept variables', async () => {
|
tap.test('smartfile -> should accept variables', async () => {
|
||||||
|
@ -10,4 +10,4 @@ dependencies:
|
|||||||
- ../test_template_2
|
- ../test_template_2
|
||||||
|
|
||||||
runafter:
|
runafter:
|
||||||
- echo 'runafter'
|
- npm install
|
@ -1,6 +1,3 @@
|
|||||||
---
|
|
||||||
fileName: anothername.yml
|
|
||||||
---
|
|
||||||
# this is a {{templateObject.value1}}
|
# this is a {{templateObject.value1}}
|
||||||
# this is a {{templateObject.value2}}
|
# this is a {{templateObject.value2}}
|
||||||
# this is a {{templateVar3}}
|
# this is a {{templateVar3}}
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
/**
|
|
||||||
* autocreated commitinfo by @push.rocks/commitinfo
|
|
||||||
*/
|
|
||||||
export const commitinfo = {
|
|
||||||
name: '@push.rocks/smartscaf',
|
|
||||||
version: '4.0.16',
|
|
||||||
description: 'A project aimed at quickly scaffolding projects with support for TypeScript, smart file handling, and template rendering.'
|
|
||||||
}
|
|
@ -1 +1 @@
|
|||||||
export * from './smartscaf.classes.smartscaf.js';
|
export * from './smartscaf.classes.smartscaf';
|
||||||
|
@ -1 +1 @@
|
|||||||
export * from './smartscaf.js';
|
export * from './smartscaf';
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
import * as plugins from './smartscaf.plugins.js';
|
import * as plugins from './smartscaf.plugins';
|
||||||
import * as interfaces from './interfaces/index.js';
|
import * as interfaces from './interfaces';
|
||||||
|
|
||||||
|
// interfaces
|
||||||
|
import { Smartfile } from '@pushrocks/smartfile';
|
||||||
|
|
||||||
export interface ScafTemplateContructorOptions {
|
export interface ScafTemplateContructorOptions {
|
||||||
name?: string;
|
name?: string;
|
||||||
@ -8,9 +11,7 @@ export interface ScafTemplateContructorOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class ScafTemplate {
|
export class ScafTemplate {
|
||||||
public static async createTemplateFromDir(dirPathArg: string) {
|
public static async createTemplateFromDir() {}
|
||||||
return new ScafTemplate(dirPathArg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the name of the template
|
* the name of the template
|
||||||
@ -36,7 +37,7 @@ export class ScafTemplate {
|
|||||||
/**
|
/**
|
||||||
* the files of the template as array of Smartfiles
|
* the files of the template as array of Smartfiles
|
||||||
*/
|
*/
|
||||||
public templateSmartfileArray: plugins.smartfile.SmartFile[];
|
public templateSmartfileArray: Smartfile[];
|
||||||
public requiredVariables: string[];
|
public requiredVariables: string[];
|
||||||
public defaultVariables: any;
|
public defaultVariables: any;
|
||||||
public suppliedVariables: any = {};
|
public suppliedVariables: any = {};
|
||||||
@ -56,21 +57,19 @@ export class ScafTemplate {
|
|||||||
let smartscafFile: interfaces.ISmartscafFile = {
|
let smartscafFile: interfaces.ISmartscafFile = {
|
||||||
defaults: {},
|
defaults: {},
|
||||||
dependencies: {
|
dependencies: {
|
||||||
merge: [],
|
merge: []
|
||||||
},
|
},
|
||||||
runafter: [],
|
runafter: []
|
||||||
};
|
};
|
||||||
|
|
||||||
const smartscafSmartfile = this.templateSmartfileArray.find((smartfileArg) => {
|
const smartscafSmartfile = this.templateSmartfileArray.find(smartfileArg => {
|
||||||
return smartfileArg.parsedPath.base === '.smartscaf.yml';
|
return smartfileArg.parsedPath.base === '.smartscaf.yml';
|
||||||
});
|
});
|
||||||
|
|
||||||
if (smartscafSmartfile) {
|
if (smartscafSmartfile) {
|
||||||
smartscafFile = {
|
smartscafFile = {
|
||||||
...smartscafFile,
|
...smartscafFile,
|
||||||
...(await plugins.smartyaml.yamlStringToObject(
|
...(await plugins.smartyaml.yamlStringToObject(smartscafSmartfile.contentBuffer.toString()))
|
||||||
smartscafSmartfile.contentBuffer.toString()
|
|
||||||
)),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
this.smartscafFile = smartscafFile;
|
this.smartscafFile = smartscafFile;
|
||||||
@ -88,7 +87,7 @@ export class ScafTemplate {
|
|||||||
public async supplyVariables(variablesArg) {
|
public async supplyVariables(variablesArg) {
|
||||||
this.suppliedVariables = {
|
this.suppliedVariables = {
|
||||||
...this.suppliedVariables,
|
...this.suppliedVariables,
|
||||||
...variablesArg,
|
...variablesArg
|
||||||
};
|
};
|
||||||
this.missingVariables = await this._checkSuppliedVariables();
|
this.missingVariables = await this._checkSuppliedVariables();
|
||||||
}
|
}
|
||||||
@ -111,15 +110,14 @@ export class ScafTemplate {
|
|||||||
return 'undefined variable';
|
return 'undefined variable';
|
||||||
}
|
}
|
||||||
})(),
|
})(),
|
||||||
message: `What is the value of ${missingVariable}?`,
|
message: `What is the value of ${missingVariable}?`
|
||||||
},
|
}
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
const answerBucket = await localSmartInteract.runQueue();
|
const answerBucket = await localSmartInteract.runQueue();
|
||||||
const answers = answerBucket.getAllAnswers();
|
await answerBucket.answerMap.forEach(async answer => {
|
||||||
for (const answer of answers) {
|
await plugins.smartparam.smartAdd(this.suppliedVariables, answer.name, answer.value);
|
||||||
await plugins.smartobject.smartAdd(this.suppliedVariables, answer.name, answer.value);
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -128,7 +126,7 @@ export class ScafTemplate {
|
|||||||
*/
|
*/
|
||||||
public async writeToDisk(destinationDirArg) {
|
public async writeToDisk(destinationDirArg) {
|
||||||
this.destinationPath = destinationDirArg;
|
this.destinationPath = destinationDirArg;
|
||||||
const smartfileArrayToWrite: plugins.smartfile.SmartFile[] = [];
|
const smartfileArrayToWrite: Smartfile[] = [];
|
||||||
for (const smartfile of this.templateSmartfileArray) {
|
for (const smartfile of this.templateSmartfileArray) {
|
||||||
// lets filter out template files
|
// lets filter out template files
|
||||||
if (smartfile.path === '.smartscaf.yml') {
|
if (smartfile.path === '.smartscaf.yml') {
|
||||||
@ -141,14 +139,14 @@ export class ScafTemplate {
|
|||||||
|
|
||||||
// handle frontmatter
|
// handle frontmatter
|
||||||
const smartfmInstance = new plugins.smartfm.Smartfm({
|
const smartfmInstance = new plugins.smartfm.Smartfm({
|
||||||
fmType: 'yaml',
|
fmType: 'yaml'
|
||||||
});
|
});
|
||||||
const parsedTemplate = smartfmInstance.parse(renderedTemplateString) as any;
|
const parsedTemplate = smartfmInstance.parse(renderedTemplateString) as any;
|
||||||
if (parsedTemplate.data.fileName) {
|
if (parsedTemplate.data.fileName) {
|
||||||
smartfile.updateFileName(parsedTemplate.data.fileName);
|
smartfile.updateFileName(parsedTemplate.data.fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
smartfile.contents = Buffer.from(await plugins.smarthbs.postprocess(parsedTemplate.content));
|
smartfile.contents = Buffer.from(parsedTemplate.content);
|
||||||
smartfileArrayToWrite.push(smartfile);
|
smartfileArrayToWrite.push(smartfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,7 +206,7 @@ export class ScafTemplate {
|
|||||||
* >> - yourDeeperKey: yourValue
|
* >> - yourDeeperKey: yourValue
|
||||||
*/
|
*/
|
||||||
private async _checkDefaultVariables() {
|
private async _checkDefaultVariables() {
|
||||||
const smartscafSmartfile = this.templateSmartfileArray.find((smartfileArg) => {
|
const smartscafSmartfile = this.templateSmartfileArray.find(smartfileArg => {
|
||||||
return smartfileArg.parsedPath.base === '.smartscaf.yml';
|
return smartfileArg.parsedPath.base === '.smartscaf.yml';
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -254,7 +252,7 @@ export class ScafTemplate {
|
|||||||
throw new Error('cannot run scripts without an destinationdir');
|
throw new Error('cannot run scripts without an destinationdir');
|
||||||
}
|
}
|
||||||
const smartshellInstance = new plugins.smartshell.Smartshell({
|
const smartshellInstance = new plugins.smartshell.Smartshell({
|
||||||
executor: 'bash',
|
executor: 'bash'
|
||||||
});
|
});
|
||||||
for (const command of this.smartscafFile.runafter) {
|
for (const command of this.smartscafFile.runafter) {
|
||||||
await smartshellInstance.exec(`cd ${this.destinationPath} && ${command}`);
|
await smartshellInstance.exec(`cd ${this.destinationPath} && ${command}`);
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as lik from '@push.rocks/lik';
|
import * as lik from '@pushrocks/lik';
|
||||||
import * as smartfile from '@push.rocks/smartfile';
|
import * as smartfile from '@pushrocks/smartfile';
|
||||||
import * as smartfm from '@push.rocks/smartfm';
|
import * as smartfm from '@pushrocks/smartfm';
|
||||||
import * as smarthbs from '@push.rocks/smarthbs';
|
import * as smarthbs from '@pushrocks/smarthbs';
|
||||||
import * as smartinteract from '@push.rocks/smartinteract';
|
import * as smartinteract from '@pushrocks/smartinteract';
|
||||||
import * as smartobject from '@push.rocks/smartobject';
|
import * as smartparam from '@pushrocks/smartparam';
|
||||||
import * as smartpromise from '@push.rocks/smartpromise';
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
import * as smartyaml from '@push.rocks/smartyaml';
|
import * as smartyaml from '@pushrocks/smartyaml';
|
||||||
import * as smartshell from '@push.rocks/smartshell';
|
import * as smartshell from '@pushrocks/smartshell';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
path,
|
path,
|
||||||
@ -16,8 +16,8 @@ export {
|
|||||||
smartfm,
|
smartfm,
|
||||||
smarthbs,
|
smarthbs,
|
||||||
smartinteract,
|
smartinteract,
|
||||||
smartobject,
|
smartparam,
|
||||||
smartpromise,
|
smartpromise,
|
||||||
smartyaml,
|
smartyaml,
|
||||||
smartshell,
|
smartshell
|
||||||
};
|
};
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"useDefineForClassFields": false,
|
|
||||||
"target": "ES2022",
|
|
||||||
"module": "NodeNext",
|
|
||||||
"moduleResolution": "NodeNext",
|
|
||||||
"esModuleInterop": true,
|
|
||||||
"verbatimModuleSyntax": true
|
|
||||||
},
|
|
||||||
"exclude": [
|
|
||||||
"dist_*/**/*.d.ts"
|
|
||||||
]
|
|
||||||
}
|
|
17
tslint.json
Normal file
17
tslint.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"extends": ["tslint:latest", "tslint-config-prettier"],
|
||||||
|
"rules": {
|
||||||
|
"semicolon": [true, "always"],
|
||||||
|
"no-console": false,
|
||||||
|
"ordered-imports": false,
|
||||||
|
"object-literal-sort-keys": false,
|
||||||
|
"member-ordering": {
|
||||||
|
"options":{
|
||||||
|
"order": [
|
||||||
|
"static-method"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultSeverity": "warning"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user