Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: stenciljs/core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.17.0
Choose a base ref
...
head repository: stenciljs/core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.17.1
Choose a head ref

Commits on Jun 21, 2022

  1. chore(tests): restore expectFiles functionality (#3420)

    this commit fixes a testing utility, `expectFiles`. prior to this
    commit, the testing utility would call through to a file system
    interface to verify that a file existed. however, the utility didn't do
    anything with the results, as the return value of the file's existence
    check:
    1. didn't throw an `Error`
    2. returned an object to designate whether the file existed or not
       (which was subsequently never queried)
    
    this commit changes that behavior by `throw`ing in the event one or more
    files cannot be found, and printing a message to the screen. `throw
    Error()` was chosen over jest's `fail()` for 2 reasons:
    1. it doesn't couple us to the jest testing library
    2. (selfishly), it's easier to test
    
    this commit _does_ add tests for the testing utility. at a certain
    point, it does feel a little bit like overkill. however, this testing
    utility is important in verifying that the output targets work properly.
    the situation of the helper being broken for so long does give some
    credence to having ~5 tests to verify it works properly
    rwaskiewicz authored Jun 21, 2022
    Copy the full SHA
    aee5287 View commit details

Commits on Jun 22, 2022

  1. chore(lint): add lint for @returns (#3430)

    this commit enables multiple lint rules provided by the jsdoc plugin
    regarding `@returns` in jsdocs.
    
    the intent behind this commit is to ensure that jsdocs have a documented
    `@returns` field and description where applicable, to catch missing ones
    in ci rather than in code review.
    
    there is one known limitation of these rules - when adding a jsdoc to a
    function that also has a decorator applied:
    
    ```typescript
    /**
     * A description
     * @returns the luckiest number in the world
     */
     @SomeDecorator()
     function getLuckyNumber(): number {
       return 7;
     }
    ```
    
    the rule will error based on the return type of the decorator, rather
    than the function.
    
    there was only a single violation of this in all of stencil's code,
    which was removed. i'm inclined to use this rule and use 'eslint-ignore'
    directives if absolutely necessary, but would be open to arguments
    against it
    rwaskiewicz authored Jun 22, 2022
    Copy the full SHA
    4656dce View commit details

Commits on Jun 23, 2022

  1. fix(compiler): handle null window.location.origin (#2813)

    when using a data URI or file URI (#2582),
    or when using iframe's `srcdoc`, the value for window.location.origin can be `null`.
    in these particular cases, passing `null` to `new URL(url, null)` will throw the 
    following error: "Failed to construct 'URL': Invalid base URL"
    brunor97 authored Jun 23, 2022
    Copy the full SHA
    255cd66 View commit details

Commits on Jun 27, 2022

  1. chore(compiler): remove a few unused exports (#3440)

    delete some unused exports from
    `src/compiler/app-core/bundle-app-core.ts`
    
    add a JSDoc to the `generateRollupOutput` function exported
    from that file.
    alicewriteswrongs authored Jun 27, 2022
    Copy the full SHA
    c96e1d5 View commit details
  2. refactor(cli): refactor parse-flags module (#3427)

    this refactors the parse-flags module, removing some code duplication
    and changing how the `ConfigFlags` interface is declared.
    
    Now the ConfigFlags interface is generated based on the content of a few
    read-only arrays of strings. This means that config flags are listed in
    one and only one placed and cannot drift / get out of sync.
    alicewriteswrongs authored Jun 27, 2022
    Copy the full SHA
    b61afd5 View commit details

Commits on Jun 28, 2022

  1. chore(test): restore doNotExpectFiles (#3435)

    this commit restores the `doNotExpectFiles` utility helper under test.
    this commit is compliment to aee5287,
    which got the `expectFiles` testing utility under test.
    
    `doNotExpectFiles` was renamed to `expectFilesDoNotExist` to give
    the helper's intent better clarity.  similarly, `expectFiles` was renamed
    to `expectFilesExist` for the same reason. all callsites were updated
    accordingly
    
    this commit makes a few assumptions about how we will use this utility
    function. namely, it only throws an exception if one or more files
    provided by a caller are found. it does not check the permissions on the
    file path (it appears that a previous implementation would take this
    into account). should we decide to re-implement file access, we can do
    so at a later date.
    
    similar to aee5287, this
    re-implementation throws instead of using jest's `fail()` utility for
    ease of testing the utility function (and doesn't couple the utility to
    jest itself)
    rwaskiewicz authored Jun 28, 2022
    Copy the full SHA
    247fcaf View commit details
  2. chore(github): clean up github labels (#3442)

    this commit removes the 'reply received' label exemption from ionitron.
    we stopped using this label ~3 months ago. in that time, the issues in
    the backlog have all been re-triaged, and any issues with this label
    today _also_ have an additional exempt label. this is the next step in
    removing the label from the repo.
    
    this also renames the 'reply received' label in the contributing guide
    to 'awaiting reply' to align with the label we actually use.
    
    the 'help wanted' label mention was removed, as we don't use it today
    rwaskiewicz authored Jun 28, 2022
    Copy the full SHA
    4e86d69 View commit details
  3. fix(cli): add explicit support for Jest CLI arguments (#3444)

    This adds explicit support to our CLI argument parsing code for Jest's
    CLI arguments by adding entries to the arrays we use to parse 'known'
    arguments.
    
    We declare all the Jest CLI arguments (as pulled from 
    [the file in which they're implemented](https://github.com/facebook/jest/blob/main/packages/jest-cli/src/cli/args.ts))
    in `src/cli/config-flags.ts`, so all of these flags are now fully-supported
    'first class' (if you will) CLI flags.
    alicewriteswrongs authored Jun 28, 2022
    Copy the full SHA
    700b3a9 View commit details
  4. test(cli): add tests for run.ts (#3441)

    this commit adds initial unit tests for `run.ts`. the goal of these
    tests are to get the minimal amount of coverage under the `run` and
    `runTask` functions so that we can (eventually) begin to change the
    function signatures on the functions they invoke.
    
    specifically, the stencil team is looking to make the configuration
    object that is used throughout the compiler stricter by making fields
    no longer optional on the type (internally). as a part of that effort, we're
    reassessing what data fields functions need. we know that we will be
    changing the signatures of the tasks for 'help' and 'telemetry'. by
    adding tests around the invocation of these tasks, we can have greater
    trust in the changes that we're making
    rwaskiewicz authored Jun 28, 2022
    Copy the full SHA
    a6e0141 View commit details

Commits on Jul 5, 2022

  1. fix(styles): ensure styles are applied before paint (#3452)

    this commit fixes a bug where styles from a stencil component would not
    be applied prior to render. the issue involved stylesheet construction &
    application not blocking render, causing the component to be created
    without styles applied.
    
    this commit moves from the `replace` function to the `replaceSync`
    function to properly await the call
    
    STENCIL-433: Stabilize Browserstack CI Tests
    rwaskiewicz authored Jul 5, 2022
    Copy the full SHA
    c47cec6 View commit details
  2. chore(lint): add the Jest eslint plugin (#3447)

    this does a few things to improve the code quality in our test suite:
    
    - add & configurate the eslint plugin for Jest (`eslint-plugin-jest`)
    - fix the violations of the Jest default ruleset (with the exception of
      a few things that we want to disable)
    - turn on a few non-default rules which are nice
    alicewriteswrongs authored Jul 5, 2022
    Copy the full SHA
    53b5e28 View commit details
  3. refactor(config): add internal strict configuration type (#3436)

    This PR proposes a methodology where we could start to make `Config` entities stricter, by swapping them out with an internal, stricter version. It introduces a new `ValidatedConfig` type that can gradually introduce strictness on the `Config` entity. For this PR, the only field that is made required is the `flags` field.
    
    The `ValidatedConfig` type is used throughout the codebase following the validating of a user-supplied configuration. Public APIs cannot use `ValidatedConfig` without introducing a breaking change. As a result, an instance of `ValidatedConfig` is created and backfilled with the contents of the user provided config and any now necessary fields (defaulting them if the field is not provided).
    
    In making `flags` a required field, the signatures of any function that accessed the field was updated to accept an `ValidatedConfig`. Not every instance of `Config` in a function signature was updated in this PR as a result.
    rwaskiewicz authored Jul 5, 2022
    Copy the full SHA
    6effbc9 View commit details
  4. refactor(style): refactor code in compiler/style/css-imports (#3433)

    This refactors and documents some code in the module responsible
    for parsing css imports (src/compiler/style/css-imports.ts) and adds
    some tests to increase coverage.
    
    This commit also makes some edits to the general 'style' spec
    (`src/compiler/style/test/style.spec.ts`) which has been skipped for a
    while. The tests in this suite were 'end-to-end' unit tests of the style
    handling capabilities of the compiler, which we'd like to have again,
    but we can't reconstitute them until we get unit testing of the compiler
    stood back up again.
    
    So for now this ports a few tests out of `style.spec.ts` and into the
    relevant specfiles (like `css-imports.spec.ts`) and deletes a few tests
    from `style.spec.ts` which are no longer accurate (like testing for
    escaping certain characters).
    alicewriteswrongs authored Jul 5, 2022
    Copy the full SHA
    4ad33a7 View commit details
  5. chore(tests): silence console.{log|warn|error} messages during tests (#…

    …3431)
    
    this adds a little utility for replacing the `console` functions with
    mocks to silence any error messages and get our jest output under
    control.
    
    This function calls `afterAll` internally, so it will clean up after
    itself by restoring the original functions for `console.log`, `.error`,
    etc.
    alicewriteswrongs authored Jul 5, 2022
    Copy the full SHA
    cb8ed20 View commit details

Commits on Jul 6, 2022

  1. docs(karma): add running locally documentation (#3445)

    this commit documents the ability to run the karma tests locally. in
    addition, it also removes hacks that developers once had to do in order
    to connect to browserstack locally, by introducing a new environment
    variable, LOCAL_BROWSERSTACK, that will allow the development team to
    tunnel into browserstack for local testing purposes
    rwaskiewicz authored Jul 6, 2022
    Copy the full SHA
    658fdd8 View commit details
  2. test(prerender): wait for load event (#3455)

    this commit fixes an issue where stencil's prerender tests that would begin to run before
    the entire pre-render application would be loaded. this is accomplished by moving from
    using the 'appload' event to the 'load' event to listen on by moving from the timeout
    associated with `setupDom` to the `waitForChanges` API our testing utilities provides
    
    STENCIL-433: Stabilize Browserstack CI Tests
    rwaskiewicz authored Jul 6, 2022
    Copy the full SHA
    c0aeac1 View commit details

Commits on Jul 8, 2022

  1. chore(exports): remove unused exports (#3415)

    resolve utility unused exports:
    
    this commit resolves issues found in the `src/utils` directory related
    to unused exports. 'ts-prune' seems to have issues when a file includes
    a direct import and an aliased import to the same location:
    ```typescript
    import { foo } from '../somewhere';
    import * as Foo from '../somewhere';
    ```
    doing so causes erroneous unused exports (or so it seems). the import of
    `ParsePackageJsonResult` has been removed in favor of a simple
    namespaced/aliased import (either would work here, this was an arbitrary
    decision that minimizes code churn. we could have just as easily
    directly imported everything from 'util').
    
    cases where helper functions were never used have been removed.
    otherwise, unnecessary export keywords were removed when a
    property/function/etc. was used in the file in which it was defined
    
    ---
    remove unused export TERMINAL_INFO
    
    ---
    remove unused transpilerId const
    
    this commit removes an unused constant from the `version.ts` file. in
    addition to verifying that the identifier and its string contents are
    not used in the codebase, the following was run to look for other
    commits containing the string:
    ```
    git log -S transpilerId --source --all
    ```
    although commits were found containing 'transpilerId', no existing
    usages of the string were found
    
    ---
    remove unused host-config
    
    this commit began by removing two unused exports from `host-config.ts`,
    `generateHostConfig` and `DEFAULT_MODE`. from those two deletions,
    additional functions and constants could be successively deleted, with
    each deletion begetting another deletion, and another deletion, etc. by
    the end, a single constant was left, `HOST_CONFIG_FILENAME`. that
    constant is used in a single file, in a single place. as a result, the
    filename was inlined
    rwaskiewicz authored Jul 8, 2022
    Copy the full SHA
    23fd1f6 View commit details
  2. chore(unused exports): remove unused export from validate-collection.…

    …ts (#3462)
    
    remove a function called `getCollectionDistDir` defined in
    `src/compiler/config/outputs/validate-collection.ts` which does not
    appear to be used anywhere in the codebase.
    alicewriteswrongs authored Jul 8, 2022
    Copy the full SHA
    2756107 View commit details
  3. chore(exports): remove unused export from fetch-utils (#3463)

    This removes an unused export from src/compiler/sys/fetch/fetch-utils.ts
    and inlines a function which was used in only one place. A JSDoc is
    added for the function that is changed.
    alicewriteswrongs authored Jul 8, 2022
    Copy the full SHA
    9b6d0ea View commit details
  4. refactor(config): make logger required on ValidatedConfig (#3457)

    this commit adds the `Logger` instance to `ValidatedConfig`, requiring
    the latter to hold an instance of the former.
    
    the `validateConfig` function has been altered to accept an instance of
    `LoadConfigInit`, the minimal configuration object that is used to
    bootstrap a stencil task. this allows a central place for an unvalidated
    configuration to be validated. Tather than semi-validating a config and
    mutating it after the fact as a part of the load process (which is what
    was previously done), all required fields are set in one place*
    
    the `setupTestingConfig` function signature was altered to accept a
    `ValidatedConfig` rather than a `Config`, as it's only caller has access
    to a `ValidatedConfig`. this allows us to simplify some of the logic for
    generating a validated config for testing purposes.
    
    \* for cases where the config does not pass through `validateConfig`,
    such as `runTask`, we will attempt to pull a `Logger` off the
    unvalidated config, or create one if one does not exist
    
    this commit introduces a mock creation function, `mockLoadConfigInit` to
    init the configuration file that used to bootstrap a task. this mock
    creator is used throughout the test suite, in order to provide a
    `LoadConfigInit` entity for `validateConfig`
    
    this commit does surface the face that `validateConfig` is used
    throughout the testing suite, and that the suite(s) should be refactored
    to use more specific functions under test, rather than calling the
    larger `validateConfig` function. this is being considered
    'out-of-scope' & saved for a future day
    
    this commit removes a flaky test that was discovered in refactoring the
    existing test suites. a top level configuration entity was not being
    properly reset between test runs, causing the test to fail.
    
    looking at the test, it no longer tests a valid path in the codebase -
    in running coverage before and after this change (with jest's cache
    disabled), we see no decrease in code coverage
    
    this commit removes `Logger` instances from telemetry-related calls. as
    a part of the larger effort to make `Logger` always available on the
    `ValidatedConfig` entity, we will always be able to use the instance
    that is stored on the configuration, allowing us to decrease the arity
    of the fn signature
    
    
    
    * review(ap): remove unneeded logger value
    
    * review(ap): inline config var
    rwaskiewicz authored Jul 8, 2022
    Copy the full SHA
    3c95a71 View commit details
  5. chore(test): remove strictNullChecks from dev server validation (#3458)

    this commit removes the strictNullCheck violations from tests for
    validating the dev server. it only removes those associated with an
    unvalidated configuration. we have no intention at the moment to make
    `devServer` or its subfields required on `Config`. regardless of what
    happens on `ValidatedConfig#devServer`, we needed to handle these
    unvalidated `devServer` instances
    rwaskiewicz authored Jul 8, 2022
    Copy the full SHA
    641a101 View commit details

Commits on Jul 11, 2022

  1. 😊 v2.17.1

    rwaskiewicz committed Jul 11, 2022
    Copy the full SHA
    3f2e55f View commit details
Showing with 2,771 additions and 1,820 deletions.
  1. +34 −1 .eslintrc.js
  2. +1 −3 .github/CONTRIBUTING.md
  3. +0 −1 .github/ionic-issue-bot.yml
  4. +11 −0 CHANGELOG.md
  5. +36 −2 package-lock.json
  6. +2 −1 package.json
  7. +5 −0 scripts/bundles/cli.ts
  8. +2 −2 src/cli/check-version.ts
  9. +276 −0 src/cli/config-flags.ts
  10. +1 −0 src/cli/index.ts
  11. +2 −1 src/cli/logs.ts
  12. +261 −180 src/cli/parse-flags.ts
  13. +2 −1 src/cli/public.ts
  14. +20 −15 src/cli/run.ts
  15. +2 −2 src/cli/task-build.ts
  16. +2 −2 src/cli/task-docs.ts
  17. +4 −3 src/cli/task-generate.ts
  18. +10 −2 src/cli/task-help.ts
  19. +3 −3 src/cli/task-prerender.ts
  20. +2 −2 src/cli/task-serve.ts
  21. +11 −3 src/cli/task-telemetry.ts
  22. +6 −2 src/cli/task-test.ts
  23. +2 −2 src/cli/task-watch.ts
  24. +9 −10 src/cli/telemetry/helpers.ts
  25. +2 −2 src/cli/telemetry/shouldTrack.ts
  26. +14 −17 src/cli/telemetry/telemetry.ts
  27. +24 −34 src/cli/telemetry/test/helpers.spec.ts
  28. +42 −32 src/cli/telemetry/test/telemetry.spec.ts
  29. +83 −21 src/cli/test/parse-flags.spec.ts
  30. +259 −0 src/cli/test/run.spec.ts
  31. +3 −3 src/cli/test/task-generate.spec.ts
  32. +2 −2 src/client/client-window.ts
  33. +9 −9 src/client/polyfills/css-shim/css-parser.ts
  34. +5 −5 src/client/polyfills/css-shim/test/css-shim.spec.ts
  35. +1 −1 src/client/polyfills/css-shim/test/init-css-shim.spec.ts
  36. +13 −13 src/client/polyfills/css-shim/test/utils.spec.ts
  37. +12 −10 src/compiler/app-core/bundle-app-core.ts
  38. +1 −1 src/compiler/build/build.ts
  39. +1 −1 src/compiler/build/full-build.ts
  40. +4 −1 src/compiler/build/watch-build.ts
  41. +4 −3 src/compiler/compiler.ts
  42. +3 −2 src/compiler/config/config-utils.ts
  43. +11 −12 src/compiler/config/load-config.ts
  44. +1 −1 src/compiler/config/outputs/index.ts
  45. +12 −14 src/compiler/config/outputs/validate-collection.ts
  46. +1 −1 src/compiler/config/outputs/validate-docs.ts
  47. +2 −2 src/compiler/config/outputs/validate-hydrate-script.ts
  48. +1 −1 src/compiler/config/outputs/validate-stats.ts
  49. +7 −3 src/compiler/config/outputs/validate-www.ts
  50. +3 −2 src/compiler/config/test/load-config.spec.ts
  51. +4 −2 src/compiler/config/test/validate-config-sourcemap.spec.ts
  52. +71 −81 src/compiler/config/test/validate-config.spec.ts
  53. +2 −2 src/compiler/config/test/validate-custom.spec.ts
  54. +70 −64 src/compiler/config/test/validate-dev-server.spec.ts
  55. +5 −5 src/compiler/config/test/validate-docs.spec.ts
  56. +11 −11 src/compiler/config/test/validate-output-dist-custom-element.spec.ts
  57. +4 −4 src/compiler/config/test/validate-output-dist.spec.ts
  58. +29 −23 src/compiler/config/test/validate-output-www.spec.ts
  59. +18 −18 src/compiler/config/test/validate-paths.spec.ts
  60. +2 −1 src/compiler/config/test/validate-rollup-config.spec.ts
  61. +13 −18 src/compiler/config/test/validate-service-worker.spec.ts
  62. +6 −6 src/compiler/config/test/validate-stats.spec.ts
  63. +30 −32 src/compiler/config/test/validate-testing.spec.ts
  64. +5 −5 src/compiler/config/test/validate-workers.spec.ts
  65. +101 −74 src/compiler/config/validate-config.ts
  66. +3 −3 src/compiler/config/validate-dev-server.ts
  67. +6 −2 src/compiler/config/validate-prerender.ts
  68. +2 −3 src/compiler/config/validate-service-worker.ts
  69. +3 −3 src/compiler/config/validate-testing.ts
  70. +5 −7 src/compiler/config/validate-workers.ts
  71. +1 −1 src/compiler/html/test/remove-unused-styles.spec.ts
  72. +36 −5 src/compiler/optimize/autoprefixer.ts
  73. +8 −1 src/compiler/optimize/optimize-css.ts
  74. +2 −1 src/compiler/output-targets/dist-lazy/generate-system.ts
  75. +5 −1 src/compiler/output-targets/index.ts
  76. +3 −0 src/compiler/output-targets/output-utils.ts
  77. +3 −3 src/compiler/output-targets/output-www.ts
  78. +11 −11 src/compiler/output-targets/test/build-conditionals.spec.ts
  79. +4 −4 src/compiler/output-targets/test/output-targets-dist.spec.ts
  80. +4 −4 src/compiler/output-targets/test/output-targets-www-dist.spec.ts
  81. +4 −4 src/compiler/output-targets/test/output-targets-www.spec.ts
  82. +1 −1 src/compiler/plugin/test/plugin.spec.ts
  83. +0 −282 src/compiler/prerender/host-config.ts
  84. +3 −3 src/compiler/prerender/prerender-main.ts
  85. +3 −3 src/compiler/prerender/test/prerendered-write-path.spec.ts
  86. +1 −1 src/compiler/service-worker/generate-sw.ts
  87. +3 −3 src/compiler/service-worker/test/service-worker-util.spec.ts
  88. +1 −1 src/compiler/service-worker/test/service-worker.spec.ts
  89. +130 −112 src/compiler/style/css-imports.ts
  90. +5 −9 src/compiler/style/css-parser/test/parse-serialize.spec.ts
  91. +1 −1 src/compiler/style/optimize-css.ts
  92. +6 −0 src/compiler/style/style-utils.ts
  93. +1 −1 src/compiler/style/test/build-conditionals.spec.ts
  94. +119 −51 src/compiler/style/test/css-imports.spec.ts
  95. +3 −63 src/compiler/style/test/optimize-css.spec.ts
  96. +10 −5 src/compiler/style/test/style-rebuild.spec.ts
  97. +1 −69 src/compiler/style/test/style.spec.ts
  98. +4 −6 src/compiler/sys/config.ts
  99. +22 −11 src/compiler/sys/fetch/fetch-utils.ts
  100. +1 −8 src/compiler/sys/fetch/tests/fetch-module.spec.ts
  101. +6 −3 src/compiler/sys/logger/console-logger.ts
  102. +9 −21 src/compiler/sys/logger/terminal-logger.ts
  103. +5 −18 src/compiler/sys/logger/test/terminal-logger.spec.ts
  104. +1 −1 src/compiler/sys/resolve/resolve-module-sync.ts
  105. +1 −1 src/compiler/transformers/test/parse-component-tags.spec.ts
  106. +12 −12 src/compiler/types/tests/stencil-types.spec.ts
  107. +2 −2 src/declarations/stencil-private.ts
  108. +70 −49 src/declarations/stencil-public-compiler.ts
  109. +2 −2 src/dev-server/test/req-handler.spec.ts
  110. +1 −1 src/hydrate/platform/index.ts
  111. +1 −1 src/mock-doc/test/element.spec.ts
  112. +1 −1 src/mock-doc/test/html-parse.spec.ts
  113. +7 −3 src/runtime/styles.ts
  114. +2 −1 src/runtime/test/attr.spec.tsx
  115. +2 −2 src/runtime/test/before-each.spec.tsx
  116. +0 −3 src/runtime/test/fixtures/cmp-a.tsx
  117. +1 −0 src/runtime/test/globals.spec.tsx
  118. +7 −3 src/runtime/test/hydrate-prop-types.spec.tsx
  119. +2 −2 src/runtime/test/lifecycle-sync.spec.tsx
  120. +18 −9 src/runtime/test/render-vdom.spec.tsx
  121. +1 −1 src/runtime/test/vdom-relocation.spec.tsx
  122. +20 −14 src/runtime/test/watch.spec.tsx
  123. +93 −90 src/runtime/vdom/test/set-accessor.spec.ts
  124. +7 −6 src/sys/node/node-logger.ts
  125. +2 −0 src/testing/index.ts
  126. +1 −1 src/testing/jest/jest-config.ts
  127. +3 −2 src/testing/jest/jest-runner.ts
  128. +1 −1 src/testing/jest/jest-screenshot.ts
  129. +3 −0 src/testing/jest/jest-setup-test-framework.ts
  130. +14 −14 src/testing/jest/test/jest-config.spec.ts
  131. +4 −3 src/testing/jest/test/jest-runner.spec.ts
  132. +56 −5 src/testing/mocks.ts
  133. +1 −1 src/testing/platform/index.ts
  134. +1 −1 src/testing/platform/testing-platform.ts
  135. +2 −2 src/testing/puppeteer/puppeteer-browser.ts
  136. +3 −3 src/testing/puppeteer/puppeteer-page.ts
  137. +114 −0 src/testing/test/testing-utils.spec.ts
  138. +128 −16 src/testing/testing-utils.ts
  139. +28 −20 src/testing/testing.ts
  140. +0 −1 src/utils/constants.ts
  141. +24 −13 src/utils/helpers.ts
  142. +2 −6 src/utils/test/scope-css.spec.ts
  143. +0 −4 src/utils/test/sourcemaps.spec.ts
  144. +4 −5 src/utils/test/util.spec.ts
  145. +1 −1 src/utils/util.ts
  146. +0 −1 src/version.ts
  147. +69 −5 test/karma/README.md
  148. +23 −6 test/karma/karma.config.js
  149. +2 −1 test/karma/package.json
  150. +3 −2 test/karma/test-app/prerender-test/karma.spec.ts
  151. +1 −0 tsconfig.json
35 changes: 34 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'jsdoc'],
plugins: ['@typescript-eslint', 'jsdoc', 'jest'],
extends: [
'plugin:jest/recommended',
// including prettier here ensures that we don't set any rules which will conflict
// with Prettier's formatting. Keep it last in the list so that nothing else messes
// with it!
@@ -14,6 +15,28 @@ module.exports = {
// TODO(STENCIL-452): Investigate using eslint-plugin-react to remove the need for varsIgnorePattern
"varsIgnorePattern": "^(h|Fragment)$"
}],
/**
* Configuration for Jest rules can be found here:
* https://github.com/jest-community/eslint-plugin-jest/tree/main/docs/rules
*/
"jest/expect-expect": [
"error",
{
// we set this to `expect*` so that any function whose name starts with expect will be counted
// as an assertion function, allowing us to use functions to DRY up test suites.
"assertFunctionNames": ["expect*"],
}
],
// we...have a number of things disabled :)
// TODO(STENCIL-488): Turn this rule back on once there are no violations of it remaining
"jest/no-disabled-tests": ["off"],
// we use this in enough places that we don't want to do per-line disables
"jest/no-conditional-expect": ["off"],
// this enforces that Jest hooks (e.g. `beforeEach`) are declared in test files in their execution order
// see here for details: https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-hooks-in-order.md
"jest/prefer-hooks-in-order": ["warn"],
// this enforces that Jest hooks (e.g. `beforeEach`) are declared at the top of `describe` blocks
"jest/prefer-hooks-on-top": ["warn"],
/**
* Configuration for the JSDoc plugin rules can be found at:
* https://github.com/gajus/eslint-plugin-jsdoc
@@ -38,9 +61,19 @@ module.exports = {
// rely on TypeScript types to be the source of truth, minimize verbosity in comments
"jsdoc/require-param-type": ["off"],
"jsdoc/require-param-description": ["error"],
"jsdoc/require-returns-check": ["error"],
"jsdoc/require-returns-description": ["error"],
// rely on TypeScript types to be the source of truth, minimize verbosity in comments
"jsdoc/require-returns-type": ["off"],
"jsdoc/require-returns": ["error"],
'prefer-const': 'error',
'no-var': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
},
// inform ESLint about the global variables defined in a Jest context
// see https://github.com/jest-community/eslint-plugin-jest/#usage
"env": {
"jest/globals": true
}
};
4 changes: 1 addition & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ Please see our [Contributor Code of Conduct](https://github.com/ionic-team/stenc

* The issue list of this repository is exclusively for bug reports and feature requests. Non-conforming issues will be closed immediately.

* Issues with no clear steps to reproduce will not be triaged. If an issue is labeled with "needs reply" and receives no further replies from the author of the issue for more than 5 days, it will be closed.
* Issues with no clear steps to reproduce will not be triaged. If an issue is labeled with "Awaiting Reply" and receives no further replies from the author of the issue for more than 5 days, it will be closed.

* If you think you have found a bug, or have a new feature idea, please start by making sure it hasn't already been [reported](https://github.com/ionic-team/stencil/issues?utf8=%E2%9C%93&q=is%3Aissue). You can search through existing issues to see if there is a similar one reported. Include closed issues as it may have been closed with a solution.

@@ -27,8 +27,6 @@ Please see our [Contributor Code of Conduct](https://github.com/ionic-team/stenc

* We appreciate you taking the time to contribute! Before submitting a pull request, we ask that you please [create an issue](#creating-an-issue) that explains the bug or feature request and let us know that you plan on creating a pull request for it. If an issue already exists, please comment on that issue letting us know you would like to submit a pull request for it. This helps us to keep track of the pull request and make sure there isn't duplicated effort.

* Looking for an issue to fix? Make sure to look through our issues with the [help wanted](https://github.com/ionic-team/stencil/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) label!

### Setup

1. Fork the repo.
1 change: 0 additions & 1 deletion .github/ionic-issue-bot.yml
Original file line number Diff line number Diff line change
@@ -78,7 +78,6 @@ stale:
- "Feature: Want this? Upvote it!"
- good first issue
- help wanted
- Reply Received
- Request For Comments
- "Resolution: Needs Investigation"
- "Resolution: Refine"
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 😊 [2.17.1](https://github.com/ionic-team/stencil/compare/v2.17.0...v2.17.1) (2022-07-11)


### Bug Fixes

* **cli:** add explicit support for Jest CLI arguments ([#3444](https://github.com/ionic-team/stencil/issues/3444)) ([700b3a9](https://github.com/ionic-team/stencil/commit/700b3a9e010072db293a385eb90e30afc746cbef))
* **compiler:** handle null window.location.origin ([#2813](https://github.com/ionic-team/stencil/issues/2813)) ([255cd66](https://github.com/ionic-team/stencil/commit/255cd6619e30e1af738f0690edb9e758871ed950))
* **styles:** ensure styles are applied before paint ([#3452](https://github.com/ionic-team/stencil/issues/3452)) ([c47cec6](https://github.com/ionic-team/stencil/commit/c47cec6581d4409e8261b3516b78532b5c49d079))



# 🚂 [2.17.0](https://github.com/ionic-team/stencil/compare/v2.16.1...v2.17.0) (2022-06-21)


38 changes: 36 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stencil/core",
"version": "2.17.0",
"version": "2.17.1",
"license": "MIT",
"main": "./internal/stencil-core/index.cjs",
"module": "./internal/stencil-core/index.js",
@@ -98,6 +98,7 @@
"dts-bundle-generator": "~5.3.0",
"eslint": "^8.13.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.5.3",
"eslint-plugin-jsdoc": "^39.3.1",
"execa": "4.1.0",
"exit": "^0.1.2",
5 changes: 5 additions & 0 deletions scripts/bundles/cli.ts
Original file line number Diff line number Diff line change
@@ -45,6 +45,11 @@ export async function cli(opts: BuildOptions): Promise<ReadonlyArray<RollupOptio
dts = dts.replace('@stencil/core/internal', '../internal/index');
await fs.writeFile(join(opts.output.cliDir, dtsFilename), dts);

// copy config-flags.d.ts
let configDts = await fs.readFile(join(inputDir, 'config-flags.d.ts'), 'utf8');
configDts = configDts.replace('@stencil/core/declarations', '../internal/index');
await fs.writeFile(join(opts.output.cliDir, 'config-flags.d.ts'), configDts);

// write @stencil/core/compiler/package.json
writePkgJson(opts, opts.output.cliDir, {
name: '@stencil/core/cli',
4 changes: 2 additions & 2 deletions src/cli/check-version.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Config } from '../declarations';
import type { ValidatedConfig } from '../declarations';
import { isFunction } from '@utils';

export const startCheckVersion = async (config: Config, currentVersion: string) => {
export const startCheckVersion = async (config: ValidatedConfig, currentVersion: string) => {
if (config.devMode && !config.flags.ci && !currentVersion.includes('-dev.') && isFunction(config.sys.checkVersion)) {
return config.sys.checkVersion(config.logger, currentVersion);
}
Loading