diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000..8e09ab4 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,9 @@ +# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries +# For IE 9-11 support, please uncomment the last line of the file and adjust as needed +> 0.5% +last 2 versions +Firefox ESR +not dead +# IE 9-11 \ No newline at end of file diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6e87a00 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# Editor configuration, see http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..6595022 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,59 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +which template: + +* [ ] MaterialDesignFrameworkModule — Material Design +* [ ] Bootstrap3FrameworkModule — Bootstrap 3 +* [ ] Bootstrap4FrameworkModule — Bootstrap 4 +* [ ] Bootstrap5FrameworkModule — Bootstrap 5 +* [ ] DaisyUIFrameworkModule — DaisyUI +* [ ] NoFrameworkModule — plain HTML +* [ ] Other (please specify below) + +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: + +1. ... + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + +- OS: [e.g. iOS] +- Browser [e.g. chrome, safari] +- Version [e.g. 22] + +**Log output covering before error and any error statements** + +```logs +Insert log hereCopy +``` + +**Additional context** +Add any other context about the problem here. + + + +**Detailed Description** + + +**Context** + + + +**Possible Implementation** + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6f6b0dd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: CI + +on: + workflow_dispatch: + inputs: + logLevel: + description: 'Log level' + required: true + default: 'warning' + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + ci: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x, lts/*] + + steps: + - uses: actions/checkout@v3 + - name: Setup Node ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - name: Build libs and demo + run: npm run build:demo + - name: Test libs + run: | + npm run test:core -- --code-coverage --no-watch --no-progress --browsers=ChromeHeadlessCI + npm run test:bs3 -- --code-coverage --no-watch --no-progress --browsers=ChromeHeadlessCI + npm run test:bs4 -- --code-coverage --no-watch --no-progress --browsers=ChromeHeadlessCI + npm run test:material -- --code-coverage --no-watch --no-progress --browsers=ChromeHeadlessCI + - name: Publish code coverage + run: npm run publish:coverage diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..db55795 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,54 @@ +name: "CodeQL" + +on: + push: + branches: [main, angular6-json-schema-form] + pull_request: + # The branches below must be a subset of the branches above + branches: [main, angular6-json-schema-form] + schedule: + - cron: '0 18 * * 3' + +jobs: + analyse: + name: Analyse + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + # Override language selection by uncommenting this and choosing your languages + # with: + # languages: go, javascript, csharp, python, cpp, java + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/createdist.yml b/.github/workflows/createdist.yml new file mode 100644 index 0000000..1f9feb0 --- /dev/null +++ b/.github/workflows/createdist.yml @@ -0,0 +1,113 @@ +#workflow creates a dist branch for each library, based on its package version +#should create the following 2 dist branches per lib project +#for example the material library project with package version x.x.x will create branches: +#dist_material +#dist_material_vx.x.x + +name: CreateDist + +on: + push: + branches: [ main ] + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: setup Node + uses: actions/setup-node@v3 + - run: npm ci + - run: npm run build:libs + + - name: version core + uses: nyaa8/package-version@v1 + with: + path: './dist/@zajsf/core/package.json' + + - name: dist core versioned + uses: s0/git-publish-subdir-action@develop + env: + REPO: self + BRANCH: dist_core_v${{ env.PACKAGE_VERSION }} + FOLDER: ./dist/@zajsf/core + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: dist core + uses: s0/git-publish-subdir-action@develop + env: + REPO: self + BRANCH: dist_core + FOLDER: ./dist/@zajsf/core + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: version bootstrap3 + uses: nyaa8/package-version@v1 + with: + path: './dist/@zajsf/bootstrap3/package.json' + + - name: dist bootstrap3 versioned + uses: s0/git-publish-subdir-action@develop + env: + REPO: self + BRANCH: dist_bootstrap3_v${{ env.PACKAGE_VERSION }} + FOLDER: ./dist/@zajsf/bootstrap3 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: dist bootstrap3 + uses: s0/git-publish-subdir-action@develop + env: + REPO: self + BRANCH: dist_bootstrap3 + FOLDER: ./dist/@zajsf/bootstrap3 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: version bootstrap4 + uses: nyaa8/package-version@v1 + with: + path: './dist/@zajsf/bootstrap4/package.json' + + + - name: dist_bootstrap4 versioned + uses: s0/git-publish-subdir-action@develop + env: + REPO: self + BRANCH: dist_bootstrap4_v${{ env.PACKAGE_VERSION }} + FOLDER: ./dist/@zajsf/bootstrap4 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: dist_bootstrap4 + uses: s0/git-publish-subdir-action@develop + env: + REPO: self + BRANCH: dist_bootstrap4 + FOLDER: ./dist/@zajsf/bootstrap4 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + + - name: version material + uses: nyaa8/package-version@v1 + with: + path: './dist/@zajsf/material/package.json' + + - name: dist material versioned + uses: s0/git-publish-subdir-action@develop + env: + REPO: self + BRANCH: dist_material_v${{ env.PACKAGE_VERSION }} + FOLDER: ./dist/@zajsf/material + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: dist material + uses: s0/git-publish-subdir-action@develop + env: + REPO: self + BRANCH: dist_material + FOLDER: ./dist/@zajsf/material + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + + + diff --git a/.github/workflows/dependabot.yml b/.github/workflows/dependabot.yml new file mode 100644 index 0000000..b9eec68 --- /dev/null +++ b/.github/workflows/dependabot.yml @@ -0,0 +1,46 @@ +version: 2 +updates: + # npm dependencies + - package-ecosystem: "npm" + # package.json directory + directory: "/" + # Check for dependencies update every week on Sunday so owners are not spammed during the week + schedule: + interval: "monthly" + # 10 PRs created per week max seems managable? + open-pull-requests-limit: 5 + commit-message: + # Prefix all commit messages with "build" + prefix: "build" + - package-ecosystem: "npm" + directory: "/projects/zajsf-core" + schedule: + interval: "weekly" + day: "sunday" + open-pull-requests-limit: 5 + commit-message: + prefix: "build" + - package-ecosystem: "npm" + directory: "/projects/zajsf-material" + schedule: + interval: "weekly" + day: "sunday" + open-pull-requests-limit: 5 + commit-message: + prefix: "build" + - package-ecosystem: "npm" + directory: "/projects/zajsf-bootstrap3" + schedule: + interval: "weekly" + day: "sunday" + open-pull-requests-limit: 5 + commit-message: + prefix: "build" + - package-ecosystem: "npm" + directory: "/projects/zajsf-bootstrap4" + schedule: + interval: "weekly" + day: "sunday" + open-pull-requests-limit: 5 + commit-message: + prefix: "build" diff --git a/.github/workflows/deploy-branch.yml b/.github/workflows/deploy-branch.yml new file mode 100644 index 0000000..adddaba --- /dev/null +++ b/.github/workflows/deploy-branch.yml @@ -0,0 +1,28 @@ +name: DeployBranch + +on: + workflow_dispatch: + inputs: + branch: + description: 'Define branch name' + required: true + default: 'main' + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.branch }} + - name: setup Node + uses: actions/setup-node@v3 + - run: npm ci + - run: npm run build:demo + + - name: deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist/demo + exclude_assets: '' diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..fc315b4 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,24 @@ +name: Deploy + +on: + push: + branches: [ main ] + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: setup Node + uses: actions/setup-node@v3 + - run: npm ci + - run: npm run build:demo + + - name: deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist/demo + exclude_assets: '' diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..a89070a --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,19 @@ +name: Mark stale issues and pull requests + +on: + schedule: + - cron: "0 0 * * *" + +jobs: + stale: + + runs-on: ubuntu-latest + + steps: + - uses: actions/stale@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: 'Stale issue' + stale-pr-message: 'Stale pull request' + stale-issue-label: 'no-issue-activity' + stale-pr-label: 'no-pr-activity' diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..84c8d4f --- /dev/null +++ b/.gitignore @@ -0,0 +1,40 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/tmp +/out-tsc + +# dependencies +/node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# misc +/.angular/cache +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +/typings + +# System Files +.DS_Store +Thumbs.db diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..23d9c36 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +16.13.2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e2bd3df --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,162 @@ +# Contributing to zajsf + +zajsf is an open project and welcomes contributions. These guidelines are provided to help you understand how the project works and to make contributing smooth and fun for everybody involved. + +There are two main forms of contribution: reporting issues and performing code changes. + +## Reporting Issues + +If you find a problem with zajsf, report it using [GitHub issues](https://github.com/zahmo/zajsf/issues/new). + +Before reporting a new issue, please take a moment to check whether it has already been reported +[here](https://github.com/zahmo/zajsf/issues). If this is the case, please: + +- Read all the comments to confirm that it's the same issue you're having. +- Refrain from adding "same thing here" or "+1" comments. Just hit the + "subscribe" button to get notifications for this issue. +- Add a comment only if you can provide helpful information that has not been + provided in the discussion yet. + +When creating a new issue, make sure you include: + +1. As much detail as possible about your setup/environment +1. Steps to reproduce the issue/bug +1. What you expected to happen +1. What happened instead + +This information will help to determine the cause and prepare a fix as fast as possible. + +## Code Changes + +Code contributions come in various forms and sizes, from simple bug fixes to implementation +of new features. + +To send your code change, use GitHub pull requests. The workflow is as follows: + + 1. Fork the project. + + 1. Create a branch based on `main`. + + 1. Implement your change, including tests and documentation. + + 1. Run tests to make sure your change didn't break anything. + + 1. Publish the branch and create a pull request. + + 1. zajsf developers will review your change and possibly point out issues. + Adapt the code under their guidance until all issues are resolved. + + 1. Finally, the pull request will get merged or rejected. + +See also [GitHub's guide on contributing](https://help.github.com/articles/fork-a-repo). + +If you want to do multiple unrelated changes, use separate branches and pull +requests. + +### Start the development environment + +Let's first generate all the bundles we need to start the demo: + +```bash +$ cd zajsf +$ yarn install or npm install +$ yarn start +``` + +You can stop the demo application. +The tricky part now is to run concurrently both the demo application & the library in watch mode. +So, first choose which library you want to change then run `$ ng build @zajsf/core --watch` for example +to build in watch mode the `@zajsf/core`. +Now let's start the demo application in watch mode too. So, open a new terminal and run `$ ng serve` and there you go. +This method is tricky but it works perfectly in all environments (I tried other methods like npm-run-all +or concurrently packages but angular-cli build doesn't restart after a failed build). +If you have a better method please send a PR. + +### Commits + +Each commit in the pull request should do only one thing, which is clearly +described by its commit message. Especially avoid mixing formatting changes and +functional changes into one commit. When writing commit messages, adhere to +[Angular Conventional Commit](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines). + +#### Commit Message Format +Each commit message consists of a **header**, a **body** and a **footer**. The header has a special +format that includes a **type**, a **scope** and a **subject**: + +``` +(): + + + +