Navigation Menu

Skip to content

Commit

Permalink
Introduce environment for code examples (#7588)
Browse files Browse the repository at this point in the history
* - Move the wrappers:
  i. @handsontable/angular
  ii. @handsontable/react
  iii. @handsontable/vue
 to the './wrappers/' subdirectory,
- Configure npm workspaces for the wrappers,
- Add a link to the root directory under './packages/handsontable', because of an issue with generating 'package-lock.json',
- Add scripts for:
  i. running commands on specific projects
  ii. running commands for all projects
  iii. recognizing the context for running tests only for specific projects
- Add the config for Codesandbox CI,�
- Update some of the dependencies, to be compatible with npm@7's auto-installing peerDependencies,
- Modify and/or create issue templates, PR templates and other content,
- Update urls to the wrappers in READMEs,
- Add (and temporarily disable) new eslint options.
 (#7380)

* - Update the CONTRIBUTING file.
- Modify the packages' dependencies to fix npm audit errors.
 #7380

* Clean up the helper scripts. #7380

* Update package-lock #7380

* - Add a version-bumping script
- Add a first version of the release-scheduling script (will be extended with bundle verification etc)
 #7380

* [WIP]
- add some dependency adjustment, needed after introducing the monorepo,
- rearrange and refactor the helper scripts,
- add a build verification script,
- add a cleaning script,
- add a "freeze" script,
- update the versioning script.

* [WIP]
- Unify the typescript version across the packages�.
- Clean up some of the unused dependencies.
- Bump some versions to be compatible with the typescript version.
- Bump the angular version to 9 (along with some of the dependencies) in the angular wrapper + disable Ivy for compatibility.

* [WIP]
- Add npm scripts for freezing, releasing and publishing + unify their naming between the packages.
- Rename the scripts from camelCase to kebab-case.
- Modify the freezing script with the commit/push functionality, along with some fixes.
- Add a release script.
- Modify the angular wrapper's version static to make it work with older TS versions, after changing its' dependency from Angular 8 to Angular 9.
- Modify the GH actions config to use Node 15 instead of 12.

* Add project aliases to the 'delegate-command' script.

* Add a script for aliasing the symlinks for the internal packages in node_modules.

* - Update the 'eslint-plugin-import' package (will need to be updated in the future)
- Remove the wrapper entries from the codesandbox config (temporarily)
- Add a safenet to the release script to prevent accidental release pushes to master (the --push argument)
- Add a script to re-link local packages in node_modules (needed after the modularization merge)
- Add a eslint-disabling comment to one of the files (bug in the eslint-plugin-import package)

* Update the node_modules link swapping script.

* - Make the linter script run the lint command to all packages (if the script exists).
- Simplify some scripts.
- Add the changelog entry.
- Correct the codesandbox ci script, to (temporarily) build only handsontable.

* - Rearrange the package.json structure for better readability.
- Add a forced handsontable build in the targeted test script.
- Add an error message in the node_modules linking script.

* - Move the link-swapping script to postbuild:es.
- Refresh package-lock.
- Fix the delegate-command script.

* - Rewrite the scripts to esm and rearrange their structure,
- Add 'semver' package
- Utilize 'execa' package
- Modify the 'repository' entries in the wrappers package.jsons

* Post-CR updates

* Change the Node version to 15 in the changelog script.

* Set the node version of Codesandbox CI to 14.

* - Extend the test-targeting script with pipeline handling.
- Extend the run-all script with an exclude option.
- Clean up ther scripts.

* Fix a problem with the run-all script.

* - Switch to rimraf.sync in the node_modules cleaning script
- Minor fixes in the monorepo scripts

* Fix a potential error with react and vue builds.

* Add a .nvmrc file.

* Apply suggestions from code review

Co-authored-by: Krzysztof Budnik <571316+budnix@users.noreply.github.com>

* Update wrappers/angular-handsontable/README.md

Co-authored-by: Krzysztof Budnik <571316+budnix@users.noreply.github.com>

* Rewrite the `prepare-package-for-publish` script to mjs.

* Apply suggestions from code review

Co-authored-by: Krzysztof Budnik <571316+budnix@users.noreply.github.com>

* change: move code-snippets repo to HOT repo

+ modify code a bit in scripts/code-examples to run in new environment

* change: add http-server dev dep

* change: install http-server in code examples from root node_modules

* change: add new script to install deps in examples

* change: use Node 15 on CI

* change: remove redundant files

* change: address the comments on GH

#7515 (comment)
#7515 (comment)
#7515 (comment)

* Modify the package-linking script.

* change: clean up old files and update angular template hot version

* change: delete yarn.lock

#7515 (comment)

* change: update templates README

- #7515 (comment)
- #7515 (comment)
- #7515 (comment)
- #7515 (comment)

* change: refactor installing deps in examples

Get rid of removing node_modules and test config script

* change: update package.json to "next" version

* change: typo

- #7515 (comment)

* - Remove all 'require's from the scripts in favor of '--experimental-json-modules'.
- Get rid of callbacks in the execa helper in favor of promises.
- Clean up some code.

* change: add GH Action env variable

- #7515 (comment)

* - Add missing flags to the package.json scripts.
- Apple post-CR suggestions.

* Apply suggestions from code review

Co-authored-by: Krzysztof Budnik <571316+budnix@users.noreply.github.com>

* Update wrappers/angular-handsontable/package.json

Co-authored-by: Krzysztof Budnik <571316+budnix@users.noreply.github.com>

* Update scripts/verify-bundles.mjs

Co-authored-by: Krzysztof Budnik <571316+budnix@users.noreply.github.com>

* Update scripts/verify-bundles.mjs

Co-authored-by: Krzysztof Budnik <571316+budnix@users.noreply.github.com>

* change: add shared package.json content

- #7515 (comment)

* change: remove from gitignore

- #7515 (comment)

* change: correct homepage

* change: add "license" to package.json

* Add missing async/await syntax to the release script.

* change: add template's README

- #7515 (comment)

* change: package.json version to 0.0.0

Since "next" doesn't follow semantic versioning

* - Add a temporary flag to the eslint task, to prevent the error on not finding the 'mjs' files in the 'scripts' directory. (to be fixed in a future task).
- Update the package-lock.

* Modify the 'run-all' script with the yargs array parser.

* change: switch from "snippets" to "examples" in README

* - Modify the eslint rules for importing in the scripts directory.
- Modify the targeted tests script.

* change + refactor: refactor scritps and add post build script to rename prod directory

* change: remove redundant angular files

* Correct the targeted testing script.

* - Force the targeting script to build all versions of handsontable (as there's no way to know what other projects might want to import).
- Move the symlink creation to postbuild.

* change: refactor, remove redundant assets etc

* change: remove dist before build

* change: simplify test script

* fix lint

* Update package.json

#7515 (comment)

Co-authored-by: Jan Siegel <jansiegel@users.noreply.github.com>

* Update scripts/code-examples.js

Co-authored-by: Jan Siegel <jansiegel@users.noreply.github.com>

* change: fix typos

- #7515 (comment)
- #7515 (comment)
- #7515 (comment)
- #7515 (comment)
- #7515 (comment)

* refactor: change to .mjs

- #7515 (comment)

* change: console color

- #7515 (comment)

* refactor: use 'execa'

- related to the comment #7515 (comment)

* refactor: add more spacings

Related to the comment:
- #7515 (comment)

* remove redundant import

* remove files

* - Add a 'examples' workspace to manage the framework-related example workspaces.
- Add framework-related workspaces to manage the framework-based examples.
- Modify some of the examples settings to install properly in the monorepo context.
- Modify the code snippet scripts and the root-level monorepo scripts.

* Modify the way examples load css files, so that it works both locally and on codesandbox.

* Remove a redundant css import from one of the vue examples.

* Update the examples' package.json and update with a fresh package-lock.

* Rebuild package-lock.

* - Set a more specific node version in nvmrc.
- Extend the examples' README.md with information about the sub-workspaces and examples' building.
- Downgrade the vue examples to prevent issues with peerDependency installation on older npm version.

* Fix the parcel version in the vanilla examples to 1.12.3, due to a problem with babel in the later version.

* Link "live" dependencies only for the "next" directory in the examples.

* Correct the previous commit.

* - Rewrite the examples symlinking script to not symlink the live directories to the 'next' example package.
- Correct the angular examples package symlinking mechanism.

* Update examples/README.md

#7588 (comment)

Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>

* change: update README

Adress all comments about README from PR discussion #7588 (review)

* change: push examples build to develop

- #7588 (comment)

* Update examples/templates/vue/public/index.html

Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>

* Update examples/templates/vue/package.json

Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>

* Update examples/templates/angular/package.json

Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>

* Update examples/templates/angular/src/index.html

Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>

* Update examples/templates/js/index.html

Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>

* Update examples/templates/react/public/index.html

Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>

* Update examples/templates/react/public/index.html

Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>

* change: run tests in examples dist folder wuth only one http-server instance

- #7588 (comment)

* change: update README with new testing flow

* fix: correct kill http-server after finish tests

* change: add missing licenKey to React template

* change: remove React.StrictMode

* fix: tests failed on CI

* npm install

* try fix CI testing

* fix testing on CI

* refactor: replace console logs

* change: remove `npm run test` mentions in each code example template

* change: remove <noscript> from vue examples

* refactor: flatten component structure

* npm install

* update README

* change: add more logs

Because removing node_modules in each example last very long thus this command looks like it's frozen

* change: add LICENSE.txt file to all code examples

* Update examples/templates/README.md

Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>

* change: extend vue build size limit

* change: disable angular build warnings

* change + refactor: flatten structure and change styles in Vue template

See comment #7588 (review)

* change: add new Vue code example and update templates/ README

* change: change Angular template and make new Angular basic example

* change: modify JS template and make new JS code example

* change: modify React template and create new React example

* refactor: change the way of renaming production folder name

* change: move code examples script to examples/ directory and close process after tests are finished

* change: add passing tests to examples and fix CI testing URL

* npm i

* change: use `javascript` formatting to remove red background from GH which indicates error

* refactor: quotes

* refactor: rename `npm run jasmine` script

* Update README.md

* change: run examples install in examples/ directory

Before that change, the script `npm run examples:install <version>` was running `npm run install:version <version>` inside the examples/<version> directory, which doesn't have package.json. Thus the script was running from the parent directory package.json in examples/ directory implicitly.

Now the script `npm run install:version <version>` is run in the examples/ directory.

* change: use async rimraf

The rimraf hadn't been removing `node_modules` from the frameworks directory.
As async, it works as expected.

* change: correct rimraf usage

* Update examples/scripts/code-examples.mjs

#7588 (comment)

Co-authored-by: Jan Siegel <jansiegel@users.noreply.github.com>

* Update examples/scripts/clean-subpackages.mjs

#7588 (comment)

Co-authored-by: Jan Siegel <jansiegel@users.noreply.github.com>

* Update examples/package.json

#7588 (comment)

Co-authored-by: Jan Siegel <jansiegel@users.noreply.github.com>

* change: disable npm audit

* wip: fix dependency versions

* Modify the fixed dependency versions.

Co-authored-by: Krzysztof Budnik <571316+budnix@users.noreply.github.com>
Co-authored-by: Oskar Kowalów <kowalow.oskar@gmail.com>
Co-authored-by: Oskar Kowalów <33433795+Osky772@users.noreply.github.com>
Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>
  • Loading branch information
5 people committed Mar 30, 2021
1 parent a357f97 commit 53e1cec
Show file tree
Hide file tree
Showing 122 changed files with 4,054 additions and 1,310 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/code-examples.yml
@@ -0,0 +1,53 @@
name: Code Examples

on:
workflow_dispatch:
inputs:
hotVersion:
description: 'Handsontable version to update all code examples (eg.: 8.0.0)'

jobs:
Examples:
name: Version and Deploy
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # https://github.com/actions/checkout/releases/tag/v2.3.4
- name: Use Node 15
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e # https://github.com/actions/setup-node/releases/tag/v2.1.4
with:
node-version: '15'
- name: Checkout gh-pages branch to "./examples/tmp" folder
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # https://github.com/actions/checkout/releases/tag/v2.3.4
with:
ref: gh-pages
path: './examples/tmp'
- name: Install global dependencies
run: npm ci
- name: Create new examples for version
run: npm run examples:version ${{ github.event.inputs.hotVersion }}
# this action can throw an error, when the examples for specific version exist already. If they exist, move to the next action
continue-on-error: true
- name: Install dependencies of code examples
run: npm run examples:install ${{ github.event.inputs.hotVersion }}
- name: Build the code examples
run: npm run examples:build ${{ github.event.inputs.hotVersion }}
- name: Test each code example
run: npm run examples:test ${{ github.event.inputs.hotVersion }}
- name: Setup git config
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: Commit
# make commit only when there is something to commit, so when new examples have been made
run: |
git pull --ff
if [ "$(git status --porcelain)" ]; then
git add examples/${{ github.event.inputs.hotVersion }}
git commit -m "Update code examples with version: ${{ github.event.inputs.hotVersion }}"
git push origin develop
fi
- name: Deploy
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # https://github.com/peaceiris/actions-gh-pages/releases/tag/v3.7.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./examples/tmp
2 changes: 1 addition & 1 deletion .nvmrc
@@ -1 +1 @@
15
15.9.0
101 changes: 101 additions & 0 deletions examples/README.md
@@ -0,0 +1,101 @@
# Code examples

This folder contains all code examples, that Handsontable uses for myriad reasons, such as documentation, blog, etc. Each code example is a separate project that uses Handsontable to present certain features.

Code examples are structured by Handsontable version. Inside the version directory, examples are grouped by category, which can be anything. The most important category is "docs", which is used in the Handsontable documentation website.

To see a deployed code example you can visit its URL. See [Live on production](#live-on-production) section to learn about the URL structure.

To play around with the actual code for a specific code example you can open it on CodeSandbox. See [Preview on CodeSandbox](#preview-on-codesandbox) section to learn more.

To run arbitrary code example locally on your machine see [How to run the arbitrary code example](#how-to-run-the-arbitrary-code-example) section.

### Contents

- [Folder structure](#folder-structure)
- [Live on production](#live-on-production)
- [Preview on CodeSandbox](#preview-on-codesandbox)
- [Creating new examples](#creating-new-examples)
- [Editing existing examples](#editing-existing-examples)
- [Development](#development)
- [How to run the arbitrary code example](#how-to-run-the-arbitrary-code-example)
- [Testing](#testing)
- [How to tun tests for arbitrary code example](#how-to-tun-tests-for-arbitrary-code-example)
- [How to run tests for the versioned code examples locally](#how-to-run-tests-for-the-versioned-code-examples-locally)

### Folder structure

Within the `/examples` directory, there are all the code examples created for specific Handsontable version and the `templates` folder, which contains base projects for creating new code examples. A path to the example follow the undermentioned convention:

`/examples/<version_number>/<category>/<framework>/<example_path>`

- `<version_number>` - the destributed version of the Handsontable and Handsontable's wrapper or `next` - the value provided to the NPM scripts as the last argument.
- `<category>` - category of the code examples. The main category is `docs` which means: code examples from the documentation.
- `<framework>` - any supported framework's name (react, angular, vue, js).
- `<example_path>` - path to the specific code example. A folder name of the code example will identify that code example - it will be used as a URL further. The folder name of the code example should be the same across all the frameworks.

An example path to the code example: `examples/8.1.0/docs/angular/custom-id`

It's worth noting, that the `examples` directory is defined as a `npm workspace`, as well as each of the `<framework>` directories within it. This allows installing shared dependencies for all the framework-specific examples.

### Live on production

All code examples are available online. The base URL for the code examples is https://examples.handsontable.com/handsontable/ and after the slash comes the path to the built project.

URL to the specific project follow the undermentioned convention:

`<version_number>/<category>/<framework>/<example_path>`

An example URL to the live example: https://examples.handsontable.com/handsontable/8.1.0/docs/js/settings

For more details see the [Folder structure](#folder-structure) section.

### Preview on CodeSandbox

To preview the arbitary code example on CodeSandbox you must get the link to the project folder in the Gihub repo. You will find all code examples in our repo https://github.com/handsontable/handsontable/tree/develop/examples.

For example: if the URL to the project is: https://github.com/handsontable/handsontable/tree/develop/examples/8.0.0/docs/js/settings you can preview that project on CodeSandbox adding the "box" word right after the "github" and before the ".com". The URL to the sandboxed project would be https://githubbox.com/handsontable/handsontable/tree/develop/examples/8.0.0/docs/js/settings.

### Creating new examples

Read the [Templates Guideline](./templates/README.md) for the detailed information about new code examples creation.

### Editing existing examples

Sometimes you want to edit existing code examples that is live in the `/examples/<version_number>` directory.

1. Edit code examples within the `/examples/<version_number>` directory.
2. Commit and push the code examples to the repo.
3. In Github Actions run a manual workflow with the `<version_number>` input of the Handsontable and Handsontable's wrapper version.
4. The code examples will be deployed to the Github Pages and will be available under the same URL as they already were.

### Development

To see code examples in action run these commands:

1. `npm run examples:install <version_number>` - will install the dependencies of all the examples matching the `<version_number>`, utilizing the `examples`' internal workspace logic.
2. `npm run examples:build <version_number>` - will build each code example in the `/examples/<version_number>` directory then copy each example's production output to the `/examples/tmp/<version_number>`. The path to the code example in the `/examples/tmp` follows the [Folder structure](#folder-structure) convention.
3. `npm run examples:start` - it will start the `http-server` right in the `/examples/tmp` on PORT `8080`. So the URL to the specific code example would be `http://localhost:8080/8.1.0/docs/angular/custom-context-menu/`. The URL follows the same convention as mentioned in the [Live on production](#live-on-production) section.

**Important:** As the `next` directory of the examples uses the local builds of `handsontable` and the wrappers, for the `next` build process to work, all the root-level packages need to be built (for example, bu running `npm run all build`) before running the examples build script.

#### How to run the arbitrary code example

To launch only one code example, go to the project directory, run `npm install` and `npm run start`. This will instal all the project dependencies and start a development server. After this command is called visit http://localhost:8080.

### Testing

Each code example has its own test specs, which lives in the `spec` directory.

> Templates have one **failing test**, which has been added to force developers to write passing tests for the next code examples.
#### How to tun tests for arbitrary code example

Each code example has its own test suites which you can run using a development server:
1. Run the `npm run start` command.
2. After the app is launched on a server, run the `npm run test` command which will launch tests specified to this code example.

#### How to run tests for the versioned code examples locally

1. Code examples **must** exist in the `examples/<version_number>` directory and be built using the command `npm run examples:build <version_number>`.
3. `npm run examples:test <version_number>`. This command will run `npm run test` for each code example (to know what the `npm run test` command does check out the section above).
5 changes: 5 additions & 0 deletions examples/next/docs/angular/basic-example/.gitignore
@@ -0,0 +1,5 @@
dist
build
.cache
.env
.eslintcache
22 changes: 22 additions & 0 deletions examples/next/docs/angular/basic-example/LICENSE.txt
@@ -0,0 +1,22 @@
(The MIT License)

Copyright (c) Handsoncode sp. z o.o. <hello@handsoncode.net>

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.
33 changes: 33 additions & 0 deletions examples/next/docs/angular/basic-example/README.md
@@ -0,0 +1,33 @@
# Angular Basic Example

## Description

This is a demonstration code example in Angular.

## Live preview

You can preview this template on CodeSandbox under the URL: https://githubbox.com/handsontable/handsontable/tree/master/next/docs/angular/basic-example

## How to run this project

### Installation

Call `npm install` to install all necessary dependencies.

### Development

To start local development server call `npm run start`. Now you can visit http://localhost:8080 to view this project.

### Testing

In order to run tests for this project call `npm run start` which will launch the development server and after the server is running, call `npm run test` to run test specs.

## License

This example is released under the MIT license.

Copyrights belong to Handsoncode sp. z o.o.

## Contact support

We provide support for all users through [GitHub issues](https://github.com/handsontable/handsontable/issues). If you have a commercial license then you can add a new ticket through the [contact form](https://handsontable.com/contact?category=technical_support).
92 changes: 92 additions & 0 deletions examples/next/docs/angular/basic-example/angular.json
@@ -0,0 +1,92 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"angular": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
},
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"styles": [
"src/styles.scss",
"node_modules/handsontable/dist/handsontable.full.css"
],
"scripts": [],
"preserveSymlinks": true,
"allowedCommonJsDependencies": [
"core-js",
"pikaday",
"@handsontable/formulajs"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "angular:build"
},
"configurations": {
"production": {
"browserTarget": "angular:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "angular:build"
}
}
}
}
},
"defaultProject": "angular"
}
48 changes: 48 additions & 0 deletions examples/next/docs/angular/basic-example/package.json
@@ -0,0 +1,48 @@
{
"name": "angular-basic-example",
"private": true,
"version": "0.0.0",
"homepage": "https://handsontable.com/",
"repository": {
"type": "git",
"url": "https://github.com/handsontable/handsontable.git"
},
"bugs": {
"url": "https://github.com/handsontable/handsontable/issues"
},
"author": "Handsoncode <hello@handsontable.com>",
"scripts": {
"ng": "ng",
"start": "ng serve --port 8080",
"build": "ng build",
"test": "node spec/support/jasmine.config.js"
},
"dependencies": {
"@angular/animations": "11.2.7",
"@angular/common": "11.2.7",
"@angular/compiler": "11.2.7",
"@angular/core": "11.2.7",
"@angular/forms": "11.2.7",
"@angular/platform-browser": "11.2.7",
"@angular/platform-browser-dynamic": "11.2.7",
"@angular/router": "11.2.7",
"@handsontable/angular": "latest",
"handsontable": "latest",
"rxjs": "6.6.7",
"tslib": "2.1.0",
"zone.js": "0.10.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.1100.7",
"@angular/cli": "11.2.6",
"@angular/compiler-cli": "11.2.7",
"@types/jasmine": "3.6.9",
"@types/node": "12.20.7",
"jasmine": "3.7.0",
"jasmine-console-reporter": "3.1.0",
"puppeteer": "7.1.0",
"ts-node": "8.3.0",
"typescript": "4.0.7"
},
"license": "MIT"
}
27 changes: 27 additions & 0 deletions examples/next/docs/angular/basic-example/spec/Smoke.spec.js
@@ -0,0 +1,27 @@
/* eslint-disable */
const puppeteer = require('puppeteer');

describe('Smoke check', () => {
let browser = null;
let page = null;
const BASE_URL = process.env.TEST_URL || 'http://localhost:8080';

beforeEach(async () => {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 100000;
// browser = await puppeteer.launch({ headless: false, slowMo: 250, devtools: true });
browser = await puppeteer.launch();
page = await browser.newPage();
await page.goto(BASE_URL);
}, 90000);

afterEach(async () => {
await browser.close();
});

it('should render Handsontable', async () => {
const hotCell = await page.$('.handsontable td');

// assertion
await expect(hotCell).toBeTruthy();
});
});

0 comments on commit 53e1cec

Please sign in to comment.