Skip to content
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d0d4bd8
feat(personal-data-erasure): migrate personal data erasure package
ajimae May 16, 2025
4ed679b
feat(resource-deleter): add resource deleter
ajimae May 21, 2025
66d2aef
chore(add-repo-tools): add repository tools
ajimae May 21, 2025
d05f765
chore(prettier-config): configure prettier
ajimae May 21, 2025
57f3552
chore(repo-enhancement): enhance repository
ajimae May 28, 2025
596ed81
chore(add-custom-objects): include custom objects deletion
ajimae Jun 2, 2025
84b1d62
chore(add-codeowners): add github codeowners
ajimae Jun 2, 2025
29bd6bc
fix(workflow): fix workflow missing action.yml
ajimae Jun 2, 2025
250be7b
fix(workflow): fix workflow missing action.yml
ajimae Jun 2, 2025
3254a74
fix(workflow): fix workflow action
ajimae Jun 2, 2025
a60ba4d
fix(workflow): fix workflow action
ajimae Jun 2, 2025
a1dc5cb
fix(workflow): fix workflow action
ajimae Jun 3, 2025
0eed1fa
fix(workflow): fix workflow action
ajimae Jun 3, 2025
c7f6271
fix(workflow): fix workflow action
ajimae Jun 3, 2025
3d4f9f1
fix(workflow): fix workflow action
ajimae Jun 3, 2025
35ada8f
fix(workflow): fix workflow action
ajimae Jun 3, 2025
a4f9dfe
fix(workflow): fix workflow action
ajimae Jun 3, 2025
cd7e3f6
chore(changelog-github): add missing packages
ajimae Jun 3, 2025
4051d8c
fix(workflow): fix workflow action
ajimae Jun 4, 2025
19b1616
fix(workflow): fix workflow action
ajimae Jun 4, 2025
f7c703c
fix(workflow): fix workflow action
ajimae Jun 4, 2025
101e841
fix(workflow): fix workflow action
ajimae Jun 4, 2025
5c349b1
fix(workflow): fix workflow action
ajimae Jun 4, 2025
a223c1e
fix(workflow): fix workflow action
ajimae Jun 4, 2025
67bfa06
chore(clean-up): remove commented blocks
ajimae Jun 10, 2025
b922b43
chore(eslint-rule): add eslint rule
ajimae Jun 10, 2025
6d505e7
Update .github/actions/ci/action.yml
ajimae Jun 10, 2025
1c21e52
Merge branch 'chore/initial-package-migration' of github.com:commerce…
ajimae Jun 10, 2025
c5ae4c9
chore(actions-commit-hash): update github actions versions
ajimae Jun 10, 2025
63f747c
chore(renovate): configure renovate
ajimae Jun 10, 2025
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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
16 changes: 16 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "commercetools/typescript-dev-utilities"
}
],
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
6 changes: 6 additions & 0 deletions .changeset/fine-toes-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@commercetools/personal-data-erasure': major
'@commercetools/resource-deleter': major
---

migrate packages to typescript
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @commercetools/developer-tooling
30 changes: 30 additions & 0 deletions .github/actions/ci/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

description: Shared action to install dependencies

runs:
using: composite

steps:
- name: Read .nvmrc
id: nvm
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT
shell: bash

- name: Enable corepack
run: corepack enable
shell: bash

- name: Setup Node.js
uses: actions/setup-node@v4
Comment thread
ajimae marked this conversation as resolved.
Outdated
with:
node-version-file: ".nvmrc"
cache: "yarn"

# Whenever on a changeset versioning PR
# Then installing can not fail with lockfile changes
# Because the package.json for integration test changes.

- name: Install
run: yarn install --immutable
shell: bash
117 changes: 117 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Qa

on:
push:
branches:
- 'main'
- '!changeset-release/**'
pull_request:

jobs:
immutable-install:
if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }}
name: Immutable Install
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
Comment thread
ajimae marked this conversation as resolved.
Outdated

- name: Setup
uses: ./.github/actions/ci

# The shared install action does not respect the
# `--immutable` flag, so we need to run it here.
- name: Install with lockfile
run: yarn install --immutable

linting:
if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }}
name: Linting
runs-on: ubuntu-latest

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

- name: Setup
uses: ./.github/actions/ci

- name: Lint
run: yarn lint

type-checking:
if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }}
name: Type checking
runs-on: ubuntu-latest

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

- name: Setup
uses: ./.github/actions/ci

- name: TypeScript
run: yarn typecheck

testing:
if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }}
name: Testing
needs: [immutable-install, linting, type-checking]
runs-on: ubuntu-latest

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

- name: Setup
uses: ./.github/actions/ci

- name: Build
run: yarn build

- name: Link cli binaries
run: yarn link

- uses: oNaiPs/secrets-to-env-action@v1
with:
secrets: ${{ toJSON(secrets) }}

- name: Test (with coverage)
run: yarn test:pkg --coverage

regression-testing:
if: ${{ !startsWith(github.ref, 'refs/heads/changeset-release/') }}
name: Regression Testing
needs: [testing]
runs-on: ubuntu-latest
strategy:
matrix:
version: [18, 20]
fail-fast: true
max-parallel: 1

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

- name: Setup
uses: ./.github/actions/ci

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}

- name: Build
run: yarn build

- name: Link cli binaries
run: yarn link

- uses: oNaiPs/secrets-to-env-action@v1
with:
secrets: ${{ toJSON(secrets) }}

- name: Integration tests
run: yarn test:pkg --coverage
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest

steps:
# Get GitHub token via the CT Changesets App
- name: Generate GitHub token (via CT Changesets App)
id: generate_github_token
uses: tibdex/github-app-token@v2.1.0
with:
app_id: ${{ secrets.CT_CHANGESETS_APP_ID }}
private_key: ${{ secrets.CT_CHANGESETS_APP_PEM }}

- name: Checkout
uses: actions/checkout@v4
with:
# Pass a personal access token (using our CT Changesets App) to be able to trigger other workflows
# https://help.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token
# https://github.community/t/action-does-not-trigger-another-on-push-tag-action/17148/8
token: ${{ steps.generate_github_token.outputs.token }}

- name: Setup
uses: ./.github/actions/ci

- name: Creating .npmrc
run: |
cat << EOF > "$HOME/.npmrc"
email=npmjs@commercetools.com
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Building packages
run: yarn build

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@master
with:
publish: pnpm changeset publish
version: pnpm changeset:version-and-format
commit: 'ci(changesets): version packages'
env:
GITHUB_TOKEN: ${{ steps.generate_github_token.outputs.token }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ web_modules/
.env.test.local
.env.production.local
.env.local
.*.env

# parcel-bundler cache (https://parceljs.org/)
.cache
Expand Down Expand Up @@ -134,3 +135,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# custom entries
bin
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yarn commitlint --edit $1
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yarn typecheck
yarn test && yarn lint-staged
1 change: 1 addition & 0 deletions .jest/setEnvVars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('dotenv').config()
Comment thread
ajimae marked this conversation as resolved.
Outdated
15 changes: 15 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"*.ts": [
"eslint",
"prettier . --write"
],
"*.js": [
"eslint",
"prettier . --write"
],
"*.json": [
"eslint",
"prettier . --write"
],
"*.md": "prettier . --write"
}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.14.0
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.*
node_modules
*.d.ts
*yarn*
*.cjs
*.http
*.env
LICENSE
22 changes: 22 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"semi": true,
"tabWidth": 2,
"filepath": "src",
"trailingComma": "es5",
"singleQuote": true,
"parser": "typescript",
"overrides": [
{
"files": "*.json",
"options": {
"parser": "json"
}
},
{
"files": "*.md",
"options": {
"parser": "markdown"
}
}
]
}
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# dev-utilities
# commercetools Typescript Dev Utilities

This repository contains some development utilities for working with the commercetools Platform API
9 changes: 9 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* @type {import('@babel/core').TransformOptions}
*/
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
],
};
13 changes: 13 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
parserPreset: {
parserOpts: {
// Allow to write a "scope" with slashes
// E.g. `refactor(app/my-component): something`
headerPattern: /^(\w*)(?:\(([\w\$\.\/\-\* ]*)\))?\: (.*)$/,
},
},
rules: {
'header-max-length': [0, 'always', 100],
},
};
10 changes: 10 additions & 0 deletions esbuild.base.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const opts = {
bundle: true,
platform: 'node',
target: 'node8',
format: 'cjs',
outbase: 'src',
outdir: '.',
// minify: true,
// sourcemap: true,
};
Loading