Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test cli pr title #83

Merged
merged 38 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
39a7fbc
feat: STRF-11523 Add the ability to use Handlebar Partial Blocks (#1167)
jairo-bc Mar 29, 2024
9ed9f62
chore(release): update release 7.4.0 (#1168)
github-actions[bot] Mar 29, 2024
2f70840
fix: STRF-11898 fix undefined variable stencil scss autofix (#1174)
jairo-bc Apr 4, 2024
718ee9f
chore(release): update release 7.4.1 (#1175)
github-actions[bot] Apr 4, 2024
4376c9e
fix: STRF-11856 - Filter the response for getStoreChannels() to only …
bc-jz Apr 4, 2024
0a0d229
fix: STRF-11856 - Filter list of channels from getStoreChannels() to …
bc-jz Apr 5, 2024
1f1fb9b
chore(release): update release 7.4.2
github-actions[bot] Apr 5, 2024
2da4e51
chore(release): update release 7.4.2
github-actions[bot] Apr 5, 2024
dead9b6
chore(release): update release 7.4.2 (#1182)
bc-jz Apr 8, 2024
ca4221b
feat: STRF-11741 Stencil init: auto install dependencies (#1183)
jairo-bc Apr 9, 2024
2abe41c
chore(release): update release 7.5.0 (#1186)
github-actions[bot] Apr 9, 2024
73703a4
fix: STRF-11923 - Handle missing Channels auth permission in getStore…
bc-jz Apr 10, 2024
20e5fcb
fix: STRF-11923 - Handle Missing a New Channels Permission Requiremen…
bc-jz Apr 10, 2024
2fb7b7d
fix: STRF-11741 Provide stencil init options to set up package manage…
jairo-bc Apr 10, 2024
6840228
chore(release): update release 7.5.1 (#1192)
github-actions[bot] Apr 10, 2024
8790190
chore(release): update release 7.5.2 (#1193)
github-actions[bot] Apr 10, 2024
1560f4e
fix: STRF-11934 Move PR Title to env (#1196)
jairo-bc Apr 15, 2024
e40ba16
chore(release): update release 7.5.3 (#1198)
github-actions[bot] Apr 15, 2024
345f698
fix: STRF-11934 Separate Github PR Title check (#1199)
jairo-bc Apr 16, 2024
cc2bc83
chore(release): update release 7.5.4 (#1200)
github-actions[bot] Apr 16, 2024
13a31ba
fix: STRF-11899 Update cart when multiple coupons are removed (#1197)
huntario Apr 16, 2024
2e0fc02
chore(release): update release 7.5.5 (#1201)
github-actions[bot] Jul 31, 2024
cfbb706
feat: STRF-12315 Bump stencil-paper version; BREAKING CHANGE: Drop No…
jairo-bc Aug 5, 2024
c010a0b
chore(release): update release 8.0.0 (#1218)
github-actions[bot] Aug 5, 2024
72758ef
feat: STRF-11900 Bump paper and handlebars for node 20 (#1219)
jairo-bc Aug 21, 2024
7729f18
chore(release): update release 8.1.0 (#1221)
github-actions[bot] Aug 21, 2024
ac55f21
Show channel IDs in channel prompt when starting dev server (#1222)
loganwoolf Aug 29, 2024
5872c13
Revert "Show channel IDs in channel prompt when starting dev server" …
bc-max Aug 29, 2024
df23a36
feat: Show channel IDs in channel prompt when starting dev server (#1…
bc-max Aug 29, 2024
5f907a3
chore(release): update release 8.2.0 (#1226)
github-actions[bot] Aug 29, 2024
ebd4b05
chore(release): update release 8.1.1 (#1224)
github-actions[bot] Sep 5, 2024
94e97d9
feat: STRF-11834 Consolidate css assembing logic (#1231)
jairo-bc Sep 20, 2024
9e462ea
feat: STRF-11903 Migrate to ESM (#1230)
jairo-bc Sep 24, 2024
ee160f9
chore(release): update release 8.3.0 (#1232)
github-actions[bot] Sep 25, 2024
5ed0cf3
fix: semantic release deploy to npm (#1233)
jairo-bc Sep 26, 2024
250bb07
fix: set node 20 for release (#1234)
jairo-bc Sep 26, 2024
77b96b6
bad commit
jairo-bc Nov 4, 2024
df1e5be
ci
jairo-bc Nov 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": true
}
},
"ecmaVersion": "2021"
},
"plugins": ["jest", "node", "prettier"],
"extends": [
Expand Down Expand Up @@ -48,6 +49,7 @@
}
],
// Overwrites airbnb-base because woks badly with prettier making multyline strings ugly
"prefer-template": "off"
"prefer-template": "off",
"import/extensions": "off"
}
}
26 changes: 13 additions & 13 deletions .github/workflows/pull_request_review.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Tests

on:
Expand All @@ -11,29 +8,32 @@ jobs:
build:
strategy:
matrix:
node: [16.x, 18.x]
os: ['ubuntu-latest', 'windows-2019', 'macos-latest']
node: [18.x, 20.x, 22.x]
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
exclude:
- os: windows-latest
node: 22.x
env:
TITLE: ${{ github.event.pull_request.title }}

runs-on: ${{ matrix.os }}

steps:
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Install Dependencies
run: npm ci

- name: Verify Github PR Title
run: echo "${{ github.event.pull_request.title }}" | npx commitlint

- name: Verify Git Commit Name
run: git log -1 --pretty=format:"%s" | npx commitlint

- name: Lint the code
run: npm run lint

Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/pull_request_title_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pull Request Title Check

on:
pull_request:
branches: [master, main]

jobs:
check-pr-title:
name: Pull Request Title Check
env:
TITLE: ${{ github.event.pull_request.title }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install Dependencies
run: npm ci

- name: Verify Github PR Title
run: echo $TITLE | npx commitlint

- name: Verify Git Commit Name
run: git log -1 --pretty=format:"%s" | npx commitlint
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '20.x'
- run: npm i
- name: Check Git Commit name
run: git log -1 --pretty=format:"%s" | npx commitlint
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v2
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.13
20.16
106 changes: 106 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,109 @@
# [8.3.0](https://github.com/bigcommerce/stencil-cli/compare/8.2.0...8.3.0) (2024-09-20)


### Features

* STRF-11834 Consolidate css assembing logic ([#1231](https://github.com/bigcommerce/stencil-cli/issues/1231)) ([94e97d9](https://github.com/bigcommerce/stencil-cli/commit/94e97d90f0e6bd3a6243a4ba93d6ec3e04437f6b))

# [8.2.0](https://github.com/bigcommerce/stencil-cli/compare/8.1.1...8.2.0) (2024-08-29)


### Features

* Show channel IDs in channel prompt when starting dev server ([#1225](https://github.com/bigcommerce/stencil-cli/issues/1225)) ([df23a36](https://github.com/bigcommerce/stencil-cli/commit/df23a3639e2020cdfff1a0ce92181b34f8048820))

## [8.1.1](https://github.com/bigcommerce/stencil-cli/compare/8.1.0...8.1.1) (2024-08-29)


### Reverts

* Revert "Show channel IDs in channel prompt when starting dev server" (#1223) ([5872c13](https://github.com/bigcommerce/stencil-cli/commit/5872c13c267e60e3520c1fca9d10fb395984be6a)), closes [#1223](https://github.com/bigcommerce/stencil-cli/issues/1223) [#1222](https://github.com/bigcommerce/stencil-cli/issues/1222)


# [8.1.0](https://github.com/bigcommerce/stencil-cli/compare/8.0.0...8.1.0) (2024-08-21)


### Features

* STRF-11900 Bump paper and handlebars for node 20 ([#1219](https://github.com/bigcommerce/stencil-cli/issues/1219)) ([72758ef](https://github.com/bigcommerce/stencil-cli/commit/72758ef6228ba9a8be9db830dc5a0c2b37732f22))

# [8.0.0](https://github.com/bigcommerce/stencil-cli/compare/7.5.5...8.0.0) (2024-08-05)


### Features

* STRF-12315 Bump stencil-paper version; BREAKING CHANGE: Drop Node 16 Support ([#1217](https://github.com/bigcommerce/stencil-cli/issues/1217)) ([cfbb706](https://github.com/bigcommerce/stencil-cli/commit/cfbb7064f1f1ff128dad1c4e29c4a89f48c117c8))


### BREAKING CHANGES

* Drop Node 16 Support

## [7.5.5](https://github.com/bigcommerce/stencil-cli/compare/7.5.4...7.5.5) (2024-04-16)


### Bug Fixes

* STRF-11899 Update cart when multiple coupons are removed ([#1197](https://github.com/bigcommerce/stencil-cli/issues/1197)) ([13a31ba](https://github.com/bigcommerce/stencil-cli/commit/13a31ba21b2eea46cf8c8fdb2087a74a6cc3acdc))

## [7.5.4](https://github.com/bigcommerce/stencil-cli/compare/7.5.3...7.5.4) (2024-04-16)


### Bug Fixes

* STRF-11934 Separate Github PR Title check ([#1199](https://github.com/bigcommerce/stencil-cli/issues/1199)) ([345f698](https://github.com/bigcommerce/stencil-cli/commit/345f698f4ff8ac7dca41c308602af8bdc48263cd))

## [7.5.3](https://github.com/bigcommerce/stencil-cli/compare/7.5.2...7.5.3) (2024-04-15)


### Bug Fixes

* STRF-11934 Move PR Title to env ([#1196](https://github.com/bigcommerce/stencil-cli/issues/1196)) ([1560f4e](https://github.com/bigcommerce/stencil-cli/commit/1560f4e45dd3c987d6cdd90683e60e28b1363746))

## [7.5.2](https://github.com/bigcommerce/stencil-cli/compare/7.5.1...7.5.2) (2024-04-10)


### Bug Fixes

* STRF-11741 Provide stencil init options to set up package manager and skip packages install ([#1190](https://github.com/bigcommerce/stencil-cli/issues/1190)) ([2fb7b7d](https://github.com/bigcommerce/stencil-cli/commit/2fb7b7d45425970a72a92c94431f0cc4a5c37f70))

## [7.5.1](https://github.com/bigcommerce/stencil-cli/compare/7.5.0...7.5.1) (2024-04-10)


### Bug Fixes

* STRF-11923 - Handle Missing a New Channels Permission Requirement in Auth Token ([#1191](https://github.com/bigcommerce/stencil-cli/issues/1191)) ([20e5fcb](https://github.com/bigcommerce/stencil-cli/commit/20e5fcb5845570a18329f4d6e6ab6239cbea4fb0))
* STRF-11923 - Handle missing Channels auth permission in getStoreChannels() method. ([73703a4](https://github.com/bigcommerce/stencil-cli/commit/73703a4dbc7243a54e564dfb3c726250f0ece2ee))

# [7.5.0](https://github.com/bigcommerce/stencil-cli/compare/7.4.2...7.5.0) (2024-04-09)


### Features

* STRF-11741 Stencil init: auto install dependencies ([#1183](https://github.com/bigcommerce/stencil-cli/issues/1183)) ([ca4221b](https://github.com/bigcommerce/stencil-cli/commit/ca4221bdb4756352b537b8dc06989c0361e43628))

## [7.4.2](https://github.com/bigcommerce/stencil-cli/compare/7.4.1...7.4.2) (2024-04-05)


### Bug Fixes

* STRF-11856 - Filter list of channels from getStoreChannels() to storefront channels ([#1180](https://github.com/bigcommerce/stencil-cli/issues/1180)) ([0a0d229](https://github.com/bigcommerce/stencil-cli/commit/0a0d2298adb76718671f8e7fb0a89a4532b12e07))
* STRF-11856 - Filter the response for getStoreChannels() to only include type 'storefront' channels. ([4376c9e](https://github.com/bigcommerce/stencil-cli/commit/4376c9e51387c9743dc184330f3416bbb230f6f8))

## [7.4.1](https://github.com/bigcommerce/stencil-cli/compare/7.4.0...7.4.1) (2024-04-04)


### Bug Fixes

* STRF-11898 fix undefined variable stencil scss autofix ([#1174](https://github.com/bigcommerce/stencil-cli/issues/1174)) ([2f70840](https://github.com/bigcommerce/stencil-cli/commit/2f70840b3d97dd51c37134e1c5484343c33391bf))

# [7.4.0](https://github.com/bigcommerce/stencil-cli/compare/7.3.4...7.4.0) (2024-03-29)


### Features

* STRF-11523 Add the ability to use Handlebar Partial Blocks ([#1167](https://github.com/bigcommerce/stencil-cli/issues/1167)) ([39a7fbc](https://github.com/bigcommerce/stencil-cli/commit/39a7fbcad5a45f95fddeecc463a207818bfd8db2))

## [7.3.4](https://github.com/bigcommerce/stencil-cli/compare/7.3.3...7.3.4) (2024-02-27)


Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,4 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
test
25 changes: 7 additions & 18 deletions bin/stencil-bundle.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#!/usr/bin/env node

require('colors');

const program = require('../lib/commander');
const { THEME_PATH, PACKAGE_INFO } = require('../constants');
const ThemeConfig = require('../lib/theme-config');
const Bundle = require('../lib/stencil-bundle');
const { printCliResultErrorAndExit } = require('../lib/cliCommon');
const { prepareCommand } = require('../lib/cliCommon');
const BuildConfigManager = require('../lib/BuildConfigManager');
import 'colors';
import program from '../lib/commander.js';
import { THEME_PATH, PACKAGE_INFO } from '../constants.js';
import ThemeConfig from '../lib/theme-config.js';
import Bundle from '../lib/stencil-bundle.js';
import { printCliResultErrorAndExit, prepareCommand } from '../lib/cliCommon.js';
import BuildConfigManager from '../lib/BuildConfigManager.js';

program
.version(PACKAGE_INFO.version)
Expand All @@ -29,28 +26,23 @@ program
'Set a timeout for the bundle operation. Default is 20 secs',
'60',
);

const cliOptions = prepareCommand(program);
const themeConfig = ThemeConfig.getInstance(THEME_PATH);

async function run() {
try {
if (cliOptions.dest === true) {
throw new Error('You have to specify a value for -d or --dest'.red);
}

if (cliOptions.name === true) {
throw new Error('You have to specify a value for -n or --name'.red);
}

if (!themeConfig.configExists()) {
throw new Error(
`${
'You must have a '.red + 'config.json'.cyan
} file in your top level theme directory.`,
);
}

const rawConfig = await themeConfig.getRawConfig();
const timeout = cliOptions.timeout * 1000; // seconds
const buildConfigManager = new BuildConfigManager({ timeout });
Expand All @@ -61,13 +53,10 @@ async function run() {
cliOptions,
buildConfigManager,
);

const bundlePath = await bundle.initBundle();

console.log(`Bundled saved to: ${bundlePath.cyan}`);
} catch (err) {
printCliResultErrorAndExit(err);
}
}

run();
14 changes: 5 additions & 9 deletions bin/stencil-debug.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
#!/usr/bin/env node

require('colors');
const program = require('../lib/commander');

const StencilDebug = require('../lib/StencilDebug');
const { PACKAGE_INFO } = require('../constants');
const { printCliResultErrorAndExit } = require('../lib/cliCommon');
import 'colors';
import program from '../lib/commander.js';
import StencilDebug from '../lib/StencilDebug.js';
import { PACKAGE_INFO } from '../constants.js';
import { printCliResultErrorAndExit } from '../lib/cliCommon.js';

program
.version(PACKAGE_INFO.version)
.option('-o, --output [filename]', 'If provided will write to file')
.parse(process.argv);

const cliOptions = program.opts();

new StencilDebug().run(cliOptions).catch(printCliResultErrorAndExit);
26 changes: 7 additions & 19 deletions bin/stencil-download.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,29 @@
#!/usr/bin/env node

require('colors');
const inquirer = require('inquirer');
const program = require('../lib/commander');

const { PACKAGE_INFO } = require('../constants');
const stencilDownload = require('../lib/stencil-download');
const { prepareCommand } = require('../lib/cliCommon');
const { printCliResultErrorAndExit } = require('../lib/cliCommon');
import 'colors';
import inquirer from 'inquirer';
import program from '../lib/commander.js';
import { PACKAGE_INFO } from '../constants.js';
import stencilDownload from '../lib/stencil-download.js';
import { prepareCommand, printCliResultErrorAndExit } from '../lib/cliCommon.js';

program
.version(PACKAGE_INFO.version)
.option('-f, --file [filename]', 'specify the filename to download only')
.option('-e, --exclude [exclude]', 'specify a directory to exclude from download')
.option('-c, --channel_id [channelId]', 'specify the channel ID of the storefront', parseInt)
.option('-o, --overwrite', 'overwrite local with remote files');

const cliOptions = prepareCommand(program);
const extraExclude = cliOptions.exclude ? [cliOptions.exclude] : [];
const options = {
exclude: ['parsed', 'manifest.json', ...extraExclude],
apiHost: cliOptions.host,
channelId: cliOptions.channel_id,
overwrite: cliOptions.overwrite,
applyTheme: true, // fix to be compatible with stencil-push.utils
applyTheme: true,
file: cliOptions.file,
};

async function run(opts) {
const overwriteType = opts.file ? opts.file : 'files';

const promptAnswers = await inquirer.prompt([
{
message: `${'Warning'.yellow} -- overwrite local with remote ${overwriteType}?`,
Expand All @@ -40,26 +34,20 @@ async function run(opts) {
},
},
]);

const answers = {
...opts,
...promptAnswers,
};

if (!answers.overwrite) {
console.log(`Request cancelled by user ${'No'.red}`);
return;
}

console.log(`${'ok'.green} -- ${overwriteType} will be overwritten by the changes`);

try {
await stencilDownload(opts);
} catch (err) {
printCliResultErrorAndExit(err);
}

console.log(`${'ok'.green} -- Theme file(s) updated from remote`);
}

run(options);
Loading
Loading