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.22.2
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.22.3
Choose a head ref
  • 6 commits
  • 11 files changed
  • 1 contributor

Commits on Mar 13, 2023

  1. chore(v2): add v2-maintenance to browserstack ci runs (#4158)

    this commit updates the configuration for the browserstack ci
    configuration to run when either:
    - a pull request is opened against the branch
    - a push occurs to the branch
    
    without this, so long as the stencil github repo has a required status
    check for browserstack, commits cannot be merged without overriding
    these checks/guards
    rwaskiewicz authored Mar 13, 2023
    Copy the full SHA
    6c91885 View commit details
  2. test(release): add getOptions coverage (#4097)

    this commit adds test coverage to the `options.ts#getOptions` helper
    function used when cutting a release of stencil, validating the build,
    and generating the license file.
    
    the motivation for this change is to provide a baseline of tests for
    this function, which will change in order to facilitate ci-driven builds
    rwaskiewicz committed Mar 13, 2023
    Copy the full SHA
    57e2fbe View commit details
  3. chore(release): update build id, version generation (#4098)

    this commit changes the method used by the release scripts to generate
    the build id and version number for "development builds", where a
    "development build" is considered a build of stencil performed outside
    using the `npm run release.*` scripts. this includes running `npm run
    build` locally and in ci.
    
    build id generation has changed from a date format 'yyyyMMddHHmmss', to
    be epoch time in seconds. this allows us to easily convert the build
    time to a human readable time if needed, with the added benefits of
    easier de/serialization and a more compact representation. there exists
    no place in the stencil codebase where this value is compared today, and
    given this change only applies to dev builds, we can safely make this
    change without breaking stencil or downstream consmers.
    
    version generation has changed from '0.0.0-dev.BUILD_ID` to use the
    current version stored in stencil's `package.json` as a base (so that it
    is easily identifiable the stable version of stencil a build derives
    from, the new build id, and a seven character sha to pinpoint the base
    commit of the development build.
    
    this commit is motivated by an effort to get development builds working
    in a github actions ci environment. we wish to have this information
    generated by stencil, rather than the ci process, such that commands
    like `npx stencil info` returns the same version info as what's
    published to the npm registry
    rwaskiewicz committed Mar 13, 2023
    Copy the full SHA
    4f2c4d2 View commit details
  4. chore(ci): publish dev builds in ci (#4095)

    this commit adds a new job for the purposes of building development
    versions of stencil, and deploying it to the npm registry
    
    it uses stencil's new build id and version metadata generation to publish
    a version of stencil with that metadata to the npm registry
    
    this commit does _not_ go through the typical `npm run release` scripts.
    while that work is planned in the future, there's still much to be done in order
    for ci to take advantage of them.
    rwaskiewicz committed Mar 13, 2023
    Copy the full SHA
    08e2c48 View commit details

Commits on Mar 14, 2023

  1. fix(compiler): use file system polling events in watch mode (#4146) (#…

    …4147)
    
    this commit updates stencil to use the polling-based file watcher that
    was used prior to the typescript 4.9 upgrade. in ts 4.9, the ts compiler
    was updated to use filesystem events. since then, we've received reports
    of fs events not playing nicely with certain development environments.
    for this reason, we revert back to the polling based implementation.
    rwaskiewicz authored Mar 14, 2023
    Copy the full SHA
    7f3d514 View commit details
  2. 🎆 v2.22.3

    rwaskiewicz committed Mar 14, 2023
    Copy the full SHA
    44b8954 View commit details
5 changes: 5 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -39,6 +39,11 @@ This workflow is responsible for building Stencil and validating the resultant a
This workflow is responsible for validating that the code adheres to the Stencil team's formatting configuration before
a pull request is merged.

### Dev Release (`release-dev.yml`)

This workflow initiates a developer build of Stencil from the `main` branch.
It is intended to be manually invoked by a member of the Stencil team.

### Test Analysis (`test-analysis.yml`)

This workflow is responsible for running the Stencil analysis testing suite.
38 changes: 38 additions & 0 deletions .github/workflows/actions/publish-npm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 'Release'
description: 'Releases Stencil Core'
inputs:
version:
description: 'The type of version to release.'
tag:
description: 'The tag to publish to on NPM.'
token:
description: 'The NPM authentication token required to publish.'
runs:
using: 'composite'
steps:
- name: Checkout Code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0

- name: Get Core Dependencies
uses: ./.github/workflows/actions/get-core-dependencies

- name: Download Build Archive
uses: ./.github/workflows/actions/download-archive
with:
name: stencil-core
path: .
filename: stencil-core-build.zip

- name: Set Version
run: npm version --no-git-tag-version ${{ inputs.version }}
shell: bash

- name: Prepare NPM Token
run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
shell: bash
env:
NPM_TOKEN: ${{ inputs.token }}

- name: Publish to NPM
run: npm publish --tag ${{ inputs.tag }}
shell: bash
61 changes: 61 additions & 0 deletions .github/workflows/release-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: 'Stencil Dev Release'

on:
workflow_dispatch:
# Make this a reusable workflow, no value needed
# https://docs.github.com/en/actions/using-workflows/reusing-workflows

jobs:
build_core:
name: Build
uses: ./.github/workflows/build.yml

get-dev-version:
name: Get Dev Build Version
needs: [build_core]
runs-on: ubuntu-20.04
outputs:
dev-version: ${{ steps.get-dev-version.outputs.DEV_VERSION }}
steps:
- name: Checkout Code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0

- name: Get Core Dependencies
uses: ./.github/workflows/actions/get-core-dependencies

- name: Download Build Archive
uses: ./.github/workflows/actions/download-archive
with:
name: stencil-core
path: .
filename: stencil-core-build.zip

- name: Get Version
id: get-dev-version
run: |
# A unique string to publish Stencil under
# e.g. "3.0.1-dev.1677185104.7c87e34"
#
# Pull this value from the compiled artifacts
DEV_VERSION=$(./bin/stencil version)
echo "Using version $DEV_VERSION"
# store a key/value pair in GITHUB_OUTPUT
# e.g. "DEV_VERSION=3.0.1-dev.1677185104.7c87e34"
echo "DEV_VERSION=$DEV_VERSION" >> $GITHUB_OUTPUT
shell: bash

release-stencil-dev-build:
name: Publish Dev Build
needs: [get-dev-version, build_core]
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- uses: ./.github/workflows/actions/publish-npm
with:
tag: dev
version: ${{ needs.get-dev-version.outputs.dev-version }}
token: ${{ secrets.NPM_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/test-browserstack.yml
Original file line number Diff line number Diff line change
@@ -5,10 +5,12 @@ on:
branches:
- 'main'
- 'v3.0.0-dev'
- 'v2-maintenance'
push:
branches:
- 'main'
- 'v3.0.0-dev'
- 'v2-maintenance'

env:
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 🎆 [2.22.3](https://github.com/ionic-team/stencil/compare/v2.22.2...v2.22.3) (2023-03-14)


### Bug Fixes

* **compiler:** use file system polling events in watch mode ([#4147](https://github.com/ionic-team/stencil/issues/4147)) ([7f3d514](https://github.com/ionic-team/stencil/commit/7f3d514c5a12e6563e315a834329da40026dd538)), fixes [#3952](https://github.com/ionic-team/stencil/issues/3952), [#4011](https://github.com/ionic-team/stencil/issues/4011), [#4044](https://github.com/ionic-team/stencil/issues/4044)



## 🎈 [2.22.2](https://github.com/ionic-team/stencil/compare/v2.22.1...v2.22.2) (2023-01-23)


4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stencil/core",
"version": "2.22.2",
"version": "2.22.3",
"license": "MIT",
"main": "./internal/stencil-core/index.cjs",
"module": "./internal/stencil-core/index.js",
70 changes: 55 additions & 15 deletions scripts/utils/options.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { execSync } from 'child_process';
import { readFileSync } from 'fs-extra';
import { join } from 'path';

@@ -71,7 +72,7 @@ export function getOptions(rootDir: string, inputOpts: BuildOptions = {}): Build
}

if (!opts.version) {
opts.version = '0.0.0-dev.' + opts.buildId;
opts.version = getDevVersionId({ buildId: opts.buildId, semverVersion: opts.packageJson?.version });
}

if (opts.isPublishRelease) {
@@ -195,20 +196,59 @@ export interface BuildOptions {
otp?: '';
}

export interface CmdLineArgs {
'config-version'?: string;
'config-build-id'?: string;
'config-prod'?: string;
/**
* Generate a build identifier, which is the Epoch Time in seconds
* @returns the generated build ID
*/
function getBuildId(): string {
return Date.now().toString(10).slice(0, -3);
}

/**
* Describes the contents of a version string for Stencil used in 'non-production' builds (e.g. a one-off dev build)
*/
interface DevVersionContents {
/**
* The build identifier string, used to uniquely identify when the build was generated
*/
buildId: string;
/**
* A semver-compliant string to add to the one-off build version sting, used to identify a base version of Stencil
* that was used in the build.
*/
semverVersion: string | undefined;
}

function getBuildId() {
const d = new Date();
return [
d.getUTCFullYear() + '',
('0' + (d.getUTCMonth() + 1)).slice(-2),
('0' + d.getUTCDate()).slice(-2),
('0' + d.getUTCHours()).slice(-2),
('0' + d.getUTCMinutes()).slice(-2),
('0' + d.getUTCSeconds()).slice(-2),
].join('');
/**
* Helper function to return the first seven characters of a git SHA
*
* We use the first seven characters for two reasons:
* 1. Seven characters _should_ be enough to uniquely ID a commit in Stencil
* 2. It matches the number of characters used in our CHANGELOG.md
*
* @returns the seven character SHA
*/
function getSevenCharGitSha(): string {
return execSync('git rev-parse HEAD').toString().trim().slice(0, 7);
}

/**
* Helper function to generate a dev build version string of the format:
*
* [BASE_VERSION]-dev.[BUILD_IDENTIFIER].[GIT_SHA]
*
* where:
* - BASE_VERSION is the version of Stencil currently assigned in `package.json`
* - BUILD_IDENTIFIER is a unique identifier for this particular build
* - GIT_SHA is the SHA of the HEAD of the branch this build was created from
*
* @param devVersionContents an object containing the necessary arguments to build a dev-version identifier
* @returns the generated version string
*/
function getDevVersionId(devVersionContents: DevVersionContents): string {
const { buildId, semverVersion } = devVersionContents;
// if `package.json#package` is empty, default to a value that doesn't imply any particular version of Stencil
const version = semverVersion ?? '0.0.0';
// '-' and '-dev.' are a magic substrings that may get checked on startup of a Stencil process.
return version + '-dev.' + buildId + '.' + getSevenCharGitSha();
}
Loading