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

chore(deps-dev): Start publishing python ast #5100

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
46 changes: 46 additions & 0 deletions .github/workflows/publish-base-generator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Generators are registered within seed.yml, once their tests are passing
name: Publish @fern-api/base-generator

on:
push:
branches:
# - main
- vargas/publish-python-ast
# paths:
# - "generators/commons/versions.yml"
# workflow_dispatch:
# inputs:
# version:
# description: "The version of the generator commons to publish."
# required: true
# type: string

env:
PACKAGE_NAME: "@fern-api/base-generator"
GITHUB_TOKEN: ${{ secrets.FERN_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.FERN_NPM_TOKEN }}

jobs:
publish:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install
uses: ./.github/actions/install

- name: 🧪 Build
run: pnpm --filter=${{ env.PACKAGE_NAME }} compile

- name: 🧪 Test
run: pnpm --filter=${{ env.PACKAGE_NAME }} test

- name: Run publish
working-directory: generators/base
run: |
pnpm --filter=${{ env.PACKAGE_NAME }} dist 0.0.6
cd lib
echo "//registry.npmjs.org/:_authToken=${{ env.NPM_TOKEN }}" > ~/.npmrc
npm publish --access public
46 changes: 46 additions & 0 deletions .github/workflows/publish-browser-compatible-base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Generators are registered within seed.yml, once their tests are passing
name: Publish @fern-api/browser-compatible-base-generator

on:
push:
branches:
# - main
- vargas/publish-python-ast
# paths:
# - "generators/commons/versions.yml"
# workflow_dispatch:
# inputs:
# version:
# description: "The version of the generator commons to publish."
# required: true
# type: string

env:
PACKAGE_NAME: "@fern-api/browser-compatible-base-generator"
GITHUB_TOKEN: ${{ secrets.FERN_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.FERN_NPM_TOKEN }}

jobs:
publish:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install
uses: ./.github/actions/install

- name: 🧪 Build
run: pnpm --filter=${{ env.PACKAGE_NAME }} compile

- name: 🧪 Test
run: pnpm --filter=${{ env.PACKAGE_NAME }} test

- name: Run publish
working-directory: generators/browser-compatible-base
run: |
pnpm --filter=${{ env.PACKAGE_NAME }} dist 0.0.2
cd lib
echo "//registry.npmjs.org/:_authToken=${{ env.NPM_TOKEN }}" > ~/.npmrc
npm publish --access public
46 changes: 46 additions & 0 deletions .github/workflows/publish-python-ast.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Generators are registered within seed.yml, once their tests are passing
name: Publish @fern-api/python-ast

on:
push:
branches:
# - main
- vargas/publish-python-ast
# paths:
# - "generators/python-v2/ast/versions.yml"
# workflow_dispatch:
# inputs:
# version:
# description: "The version of the generator to publish."
# required: true
# type: string

env:
PACKAGE_NAME: "@fern-api/python-ast"
GITHUB_TOKEN: ${{ secrets.FERN_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.FERN_NPM_TOKEN }}

jobs:
publish:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install
uses: ./.github/actions/install

- name: 🧪 Build
run: pnpm --filter=${{ env.PACKAGE_NAME }} compile

- name: 🧪 Test
run: pnpm --filter=${{ env.PACKAGE_NAME }} test

- name: Run publish
working-directory: generators/python-v2/ast
run: |
pnpm --filter=${{ env.PACKAGE_NAME }} dist 0.0.20
cd lib
echo "//registry.npmjs.org/:_authToken=${{ env.NPM_TOKEN }}" > ~/.npmrc
npm publish --access public
41 changes: 41 additions & 0 deletions generators/base/build.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const packageJson = require("./package.json");
const { writeFile } = require("fs/promises");
const path = require("path");

lib_main();

async function lib_main() {
process.chdir(path.join(__dirname, "lib"));

await writeFile(
"package.json",
JSON.stringify(
{
name: packageJson.name,
version: process.argv[2] || packageJson.version,
repository: packageJson.repository,
main: "index.js",
types: "index.d.ts",
type: "module",
files: ["*.js", "*.d.ts", "ast/", "project/", "readme/", "reference/", "utils/"],
dependencies: {
"@fern-api/browser-compatible-base-generator": "0.0.2",
"@fern-api/core-utils": "^0.15.0-rc63",
"@fern-api/fs-utils": "^0.15.0-rc63",
"@fern-api/logger": "^0.4.24-rc1",
"@fern-api/logging-execa": "^0.15.0-rc63",
// Maybe we don't need these?
// "@fern-fern/generator-cli-sdk": "0.0.17",
"js-yaml": "^4.1.0",
"lodash-es": "^4.17.21",
"tmp-promise": "^3.0.3"
},
overrides: {
"@fern-api/logger": "^0.4.24-rc1"
}
},
undefined,
2
)
);
}
7 changes: 4 additions & 3 deletions generators/base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fern-api/base-generator",
"version": "0.0.0",
"version": "0.0.6",
"repository": {
"type": "git",
"url": "https://github.com/fern-api/fern.git",
Expand All @@ -25,7 +25,8 @@
"format": "prettier --write --ignore-unknown --ignore-path ../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../shared/.prettierignore \"**\"",
"organize-imports": "organize-imports-cli tsconfig.json",
"depcheck": "depcheck"
"depcheck": "depcheck",
"dist": "pnpm compile && node build.cjs"
},
"dependencies": {
"@fern-api/browser-compatible-base-generator": "workspace:*",
Expand All @@ -49,4 +50,4 @@
"prettier": "^2.7.1",
"typescript": "4.6.4"
}
}
}
36 changes: 36 additions & 0 deletions generators/base/versions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
- version: 0.0.6
createdAt: '2024-12-01'
changelogEntry:
- type: internal
summary: Patch [email protected] dependency.
irVersion: 33
- version: 0.0.5
createdAt: '2024-12-01'
changelogEntry:
- type: internal
summary: Add browser-compatible-base-generator as a dependency.
irVersion: 33
- version: 0.0.4
createdAt: '2024-12-01'
changelogEntry:
- type: internal
summary: Rename to base-generator.
irVersion: 33
- version: 0.0.3
createdAt: '2024-11-05'
changelogEntry:
- type: internal
summary: Fix main field.
irVersion: 33
- version: 0.0.2
createdAt: '2024-11-05'
changelogEntry:
- type: internal
summary: Omit fern-fern dependencies.
irVersion: 33
- version: 0.0.1
createdAt: '2024-11-05'
changelogEntry:
- type: internal
summary: Initial release.
irVersion: 33
34 changes: 34 additions & 0 deletions generators/browser-compatible-base/build.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const packageJson = require("./package.json");
const { writeFile } = require("fs/promises");
const path = require("path");

lib_main();

async function lib_main() {
process.chdir(path.join(__dirname, "lib"));

await writeFile(
"package.json",
JSON.stringify(
{
name: packageJson.name,
version: process.argv[2] || packageJson.version,
repository: packageJson.repository,
main: "index.js",
types: "index.d.ts",
type: "module",
files: ["*.js", "*.d.ts", "ast/", "dynamic-snippets/", "project/", "readme/", "reference/", "utils/"],
dependencies: {
"@fern-api/logger": "^0.4.24-rc1",
// Maybe we don't need these?
// "@fern-fern/generator-exec-sdk": "^0.0.898",
},
overrides: {
"@fern-api/logger": "^0.4.24-rc1"
}
},
undefined,
2
)
);
}
5 changes: 3 additions & 2 deletions generators/browser-compatible-base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fern-api/browser-compatible-base-generator",
"version": "0.0.0",
"version": "0.0.2",
"repository": {
"type": "git",
"url": "https://github.com/fern-api/fern.git",
Expand All @@ -25,7 +25,8 @@
"format": "prettier --write --ignore-unknown --ignore-path ../../shared/.prettierignore \"**\"",
"format:check": "prettier --check --ignore-unknown --ignore-path ../../shared/.prettierignore \"**\"",
"organize-imports": "organize-imports-cli tsconfig.json",
"depcheck": "depcheck"
"depcheck": "depcheck",
"dist": "pnpm compile && node build.cjs"
},
"dependencies": {
"@fern-api/core-utils": "workspace:*",
Expand Down
12 changes: 12 additions & 0 deletions generators/browser-compatible-base/versions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- version: 0.0.2
createdAt: '2024-12-01'
changelogEntry:
- type: internal
summary: Include dynamic-snippets.
irVersion: 33
- version: 0.0.1
createdAt: '2024-12-01'
changelogEntry:
- type: internal
summary: Initial release.
irVersion: 33
70 changes: 70 additions & 0 deletions generators/python-v2/ast/build.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
const packageJson = require("./package.json");
const tsup = require("tsup");
const { writeFile, rename } = require("fs/promises");
const path = require("path");

lib_main();

// async function main() {
// await tsup.build({
// entry: ["src/**/*.ts", "!src/__test__"],
// format: ["cjs"],
// clean: true,
// dts: true,
// outDir: "dist",
// external: ["@wasm-fmt/ruff_fmt"],
// tsconfig: "./build.tsconfig.json"
// });

// process.chdir(path.join(__dirname, "dist"));

// // The module expects the imports defined in the index.d.ts file.
// await rename("index.d.cts", "index.d.ts");

// await writeFile(
// "package.json",
// JSON.stringify(
// {
// name: packageJson.name,
// version: process.argv[2] || packageJson.version,
// repository: packageJson.repository,
// main: "index.cjs",
// types: "index.d.ts",
// type: "module",
// files: ["*.cjs", "*.d.cts", "core/", "*.d.ts"],
// dependencies: {
// "@wasm-fmt/ruff_fmt": "^0.6.1"
// }
// },
// undefined,
// 2
// )
// );
// }

async function lib_main() {
process.chdir(path.join(__dirname, "lib"));

await writeFile(
"package.json",
JSON.stringify(
{
name: packageJson.name,
version: process.argv[2] || packageJson.version,
repository: packageJson.repository,
main: "index.js",
types: "index.d.ts",
type: "module",
files: ["*.js", "*.d.ts", "core/", ],
dependencies: {
"@fern-api/base-generator": "0.0.6",
"@fern-api/core-utils": "^0.15.0-rc63",
"@wasm-fmt/ruff_fmt": "^0.6.1"
}
},
undefined,
2
)
);

}
5 changes: 5 additions & 0 deletions generators/python-v2/ast/build.tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "../../../shared/tsconfig.shared.json",
"include": ["src/**/*.ts"],
"exclude": ["src/**/__test__"]
}
Loading
Loading