0.0.2 • Published 3 years ago

@inrupt/template-ts v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

TypeScript project template for Inrupt projects

This is a template project from which new TypeScript projects can be generated. It sets up the basic structure for libraries, including linting and tests, from unit testing with Jest through to end-to-end acceptance testing with Testcafe and Code Sandbox.

Usage

Short version: search everywhere for "template-ts" and replace all instances with the proper name of your GitHub repo or NPM module.

In more detail, you will need to:

  • Update references in .github from "template-ts" to the name of your GitHub repo.
  • Update packaging tests in .github/workflows/cd-packaging-tests/bundler-\* to point to the correct location and relevant exported modules.
  • Replace src/module/index.ts and src/index.ts, with your source code (obviously).
  • Update e2e/browser/e2e.testcafe.ts to include actual tests after exporting functions to test from .codesandbox/sandbox/src/end-to-end-test-helpers.ts. pageModels includes code to handle authentication, which can be removed if irrelevant.
  • Update package.json to fix links to homepage, bugs, etc.
  • Update "Exports" to match your directory structure.

Caveats

  • The .eslintignore is hacky, but due to the way .codesandbox works we can't include end-to-end test files in the project in the tsconfig. This means we have to explicitly ignore the files, or the linter gets upset about trying to lint files outside of the project. To be fixed if we can customize the Code Sandbox location.
  • This project has CodeQL disabled until it is a public project. If you use this template, you may want to disable CodeQL until your project is made public.
  • This project also has the publish-website action disabled for the same reason; disable it in your project until it is ready to be published.

ENV variables for your GitHub repo

You will need the following variables for the CD process:

  • NPM_TOKEN

You will need a number of variables for the CI process:

End-to-end tests:

  • E2E_TEST_ESS_COMPAT_PROD_CLIENT_ID
  • E2E_TEST_ESS_COMPAT_PROD_CLIENT_SECRET
  • E2E_TEST_ESS_COMPAT_PROD_IDP_URL
  • E2E_TEST_ESS_COMPAT_PROD_POD
  • E2E_TEST_ESS_COMPAT_PROD_REFRESH_TOKEN
  • E2E_TEST_ESS_PROD_CLIENT_ID
  • E2E_TEST_ESS_PROD_CLIENT_SECRET
  • E2E_TEST_ESS_PROD_COGNITO_PASSWORD
  • E2E_TEST_ESS_PROD_COGNITO_USER
  • E2E_TEST_ESS_PROD_IDP_URL
  • E2E_TEST_ESS_PROD_POD
  • E2E_TEST_ESS_PROD_REFRESH_TOKEN
  • TESTCAFE_ESS_DEV_COGNITO_PASSWORD
  • TESTCAFE_ESS_DEV_COGNITO_USER
  • TESTCAFE_ESS_DEV_IDP_URL
  • TESTCAFE_ESS_DEV_POD
  • TESTCAFE_ESS_PROD_COGNITO_PASSWORD
  • TESTCAFE_ESS_PROD_COGNITO_USER
  • TESTCAFE_ESS_PROD_IDP_URL
  • TESTCAFE_ESS_PROD_POD

Changelog

See the release notes.

License

MIT © Inrupt

0.0.2

3 years ago

0.0.1

3 years ago