Skip to content

Commit

Permalink
Use esbuild --keep-names and update to 2.1.0 (#122)
Browse files Browse the repository at this point in the history
* Keep names in package step

* Add random uuid to end of names

* Update version to `2.1.0`
  • Loading branch information
grant0417 committed Mar 22, 2024
1 parent 3ca1a38 commit ffdd716
Show file tree
Hide file tree
Showing 5 changed files with 939 additions and 932 deletions.
1 change: 1 addition & 0 deletions .ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
1,846 changes: 923 additions & 923 deletions dist/index.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "push-to-fig-autocomplete-action",
"version": "2.0.1",
"version": "2.1.0",
"private": true,
"description": "Action to automatically open a new PR to the withfig/autocomplete repo",
"main": "lib/main.js",
"scripts": {
"format": "prettier --write '**/*.ts'",
"format-check": "prettier --check '**/*.ts'",
"lint": "eslint src/**/*.ts",
"package": "esbuild --bundle src/main.ts --outfile=dist/index.js --minify --sourcemap --platform=node",
"package": "esbuild --bundle src/main.ts --outfile=dist/index.js --minify --keep-names --sourcemap --platform=node",
"test": "jest --passWithNoTests",
"all": "npm run format && npm run lint && npm run package && npm test",
"prepare": "husky install"
Expand Down
14 changes: 10 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async function run(): Promise<void> {
// Run eslint and prettier on top of the generated spec and report eventual errors
await copyFile(path.resolve(newSpecPathInRepo), newSpecPath);
await lintAndFormatSpec(newSpecPath, TMP_FOLDER);
await uploadFilepathArtifact("new-spec.ts", newSpecPath);
await uploadFilepathArtifact(`new-spec-${randomUUID()}.ts`, newSpecPath);

if (!diffBasedVersioning) {
// check if spec already exist in autocomplete repo, if it does => run merge tool and merge it
Expand All @@ -67,15 +67,18 @@ async function run(): Promise<void> {
`src/${autocompleteSpecName}.ts`,
oldSpecPath,
);
await uploadFilepathArtifact("old-spec.ts", oldSpecPath);
await uploadFilepathArtifact(`old-spec-${randomUUID()}.ts`, oldSpecPath);

const mergedSpecPath = path.join(
TMP_AUTOCOMPLETE_SRC_MOCK,
"merged-spec.ts",
);
if (successfullyClonedSpecFile) {
await mergeSpecs(oldSpecPath, newSpecPath, mergedSpecPath, TMP_FOLDER);
await uploadFilepathArtifact("merged-spec.ts", mergedSpecPath);
await uploadFilepathArtifact(
`merged-spec-${randomUUID()}.ts`,
mergedSpecPath,
);
}
localSpecFileOrFolder = {
localPath: successfullyClonedSpecFile ? mergedSpecPath : newSpecPath,
Expand All @@ -101,7 +104,10 @@ async function run(): Promise<void> {
);

if (successfullyClonedSpecFolder) {
await uploadFolderPathArtifact("old-spec-folder", localSpecFolder);
await uploadFolderPathArtifact(
`old-spec-folder-${randomUUID()}`,
localSpecFolder,
);
} else {
// spec-folder does not exist in autocomplete repo so we create a new one locally and then upload to the autocomplete repo
await execAsync(
Expand Down

0 comments on commit ffdd716

Please sign in to comment.