zile 0.0.12 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -100,6 +100,100 @@ exports[`Packages.build > builds all packages 1`] = `
100
100
  ],
101
101
  },
102
102
  },
103
+ {
104
+ "packageJson": {
105
+ "exports": {
106
+ ".": {
107
+ "default": "./dist/index.js",
108
+ "src": "./src/index.ts",
109
+ "types": "./dist/index.d.ts",
110
+ },
111
+ "./globals": {
112
+ "src": "./src/globals.d.ts",
113
+ "types": "./dist/globals.d.ts",
114
+ },
115
+ },
116
+ "main": "./dist/index.js",
117
+ "module": "./dist/index.js",
118
+ "name": "dts-exports-object",
119
+ "sideEffects": false,
120
+ "type": "module",
121
+ "types": "./dist/index.d.ts",
122
+ "version": "0.0.0",
123
+ },
124
+ "tsConfig": {
125
+ "compilerOptions": {
126
+ "composite": false,
127
+ "declaration": true,
128
+ "declarationDir": undefined,
129
+ "declarationMap": true,
130
+ "emitDeclarationOnly": false,
131
+ "esModuleInterop": true,
132
+ "isolatedModules": true,
133
+ "module": "nodenext",
134
+ "moduleDetection": "force",
135
+ "moduleResolution": "nodenext",
136
+ "noEmit": false,
137
+ "outDir": "/repos/dts-exports-object/dist",
138
+ "skipLibCheck": true,
139
+ "sourceMap": true,
140
+ "strict": true,
141
+ "target": "es2021",
142
+ "verbatimModuleSyntax": true,
143
+ },
144
+ "exclude": [],
145
+ "include": [
146
+ "/repos/dts-exports-object/src/index.ts",
147
+ ],
148
+ },
149
+ },
150
+ {
151
+ "packageJson": {
152
+ "exports": {
153
+ ".": {
154
+ "default": "./dist/index.js",
155
+ "src": "./src/index.ts",
156
+ "types": "./dist/index.d.ts",
157
+ },
158
+ "./globals": {
159
+ "src": "./src/globals.d.ts",
160
+ "types": "./dist/globals.d.ts",
161
+ },
162
+ },
163
+ "main": "./dist/index.js",
164
+ "module": "./dist/index.js",
165
+ "name": "dts-exports",
166
+ "sideEffects": false,
167
+ "type": "module",
168
+ "types": "./dist/index.d.ts",
169
+ "version": "0.0.0",
170
+ },
171
+ "tsConfig": {
172
+ "compilerOptions": {
173
+ "composite": false,
174
+ "declaration": true,
175
+ "declarationDir": undefined,
176
+ "declarationMap": true,
177
+ "emitDeclarationOnly": false,
178
+ "esModuleInterop": true,
179
+ "isolatedModules": true,
180
+ "module": "nodenext",
181
+ "moduleDetection": "force",
182
+ "moduleResolution": "nodenext",
183
+ "noEmit": false,
184
+ "outDir": "/repos/dts-exports/dist",
185
+ "skipLibCheck": true,
186
+ "sourceMap": true,
187
+ "strict": true,
188
+ "target": "es2021",
189
+ "verbatimModuleSyntax": true,
190
+ },
191
+ "exclude": [],
192
+ "include": [
193
+ "/repos/dts-exports/src/index.ts",
194
+ ],
195
+ },
196
+ },
103
197
  {
104
198
  "packageJson": {
105
199
  "exports": {
@@ -172,10 +172,24 @@ export async function createNew(command: Command) {
172
172
  }
173
173
  cp(templatePath, targetPath)
174
174
 
175
- // Replace "replace-me" in all files
175
+ // Replace "replace-me" and package manager placeholders in all files
176
176
  function replace(dir: string) {
177
177
  const entries = fs.readdirSync(dir, { withFileTypes: true })
178
178
 
179
+ // Determine pmx (package executor) based on package manager
180
+ const pmx = packageManager === 'npm' ? 'npx'
181
+ : packageManager === 'pnpm' ? 'pnpx'
182
+ : packageManager === 'bun' ? 'bunx'
183
+ : packageManager === 'yarn' ? 'yarn dlx'
184
+ : 'npx'
185
+
186
+ // Determine setup step based on package manager
187
+ let setupStep = ''
188
+ if (packageManager === 'pnpm')
189
+ setupStep = `\n - name: Set up pnpm\n uses: pnpm/action-setup@v4\n`
190
+ else if (packageManager === 'bun')
191
+ setupStep = `\n - name: Set up Bun\n uses: oven-sh/setup-bun@v2\n`
192
+
179
193
  for (const entry of entries) {
180
194
  const fullPath = path.join(dir, entry.name)
181
195
 
@@ -183,7 +197,10 @@ export async function createNew(command: Command) {
183
197
  else
184
198
  try {
185
199
  const content = fs.readFileSync(fullPath, 'utf-8')
186
- const updated = content.replace(/replace-me/g, packageName as string)
200
+ let updated = content.replace(/replace-me/g, packageName as string)
201
+ updated = updated.replace(/\{pm\}/g, packageManager)
202
+ updated = updated.replace(/\{pmx\}/g, pmx)
203
+ updated = updated.replace(/\{setupStep\}/g, setupStep)
187
204
  if (content !== updated) fs.writeFileSync(fullPath, updated, 'utf-8')
188
205
  } catch {}
189
206
  }
@@ -0,0 +1,14 @@
1
+ name: 'Install dependencies'
2
+ description: 'Prepare repository and all dependencies'
3
+
4
+ runs:
5
+ using: 'composite'
6
+ steps:{setupStep}
7
+ - name: Set up Node
8
+ uses: actions/setup-node@v4
9
+ with:
10
+ node-version: '24.5'
11
+
12
+ - name: Install dependencies
13
+ shell: bash
14
+ run: {pm} install
@@ -0,0 +1,42 @@
1
+ name: Main
2
+ on:
3
+ push:
4
+ branches: [main]
5
+
6
+ concurrency:
7
+ group: ${{ github.workflow }}-${{ github.ref }}
8
+ cancel-in-progress: true
9
+
10
+ jobs:
11
+ verify:
12
+ name: Verify
13
+ uses: ./.github/workflows/verify.yml
14
+ secrets: inherit
15
+
16
+ changesets:
17
+ name: Changesets
18
+ needs: verify
19
+ permissions:
20
+ contents: write
21
+ id-token: write
22
+ pull-requests: write
23
+ runs-on: ubuntu-latest
24
+ timeout-minutes: 5
25
+
26
+ steps:
27
+ - name: Clone repository
28
+ uses: actions/checkout@v4
29
+
30
+ - name: Install dependencies
31
+ uses: ./.github/actions/install-dependencies
32
+
33
+ - name: PR or publish
34
+ id: changesets
35
+ uses: changesets/action@v1
36
+ with:
37
+ title: 'chore: version packages'
38
+ commit: 'chore: version packages'
39
+ publish: {pm} run changeset:publish
40
+ version: {pm} run changeset:version
41
+ env:
42
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,21 @@
1
+ name: Prerelease
2
+ on: [push, pull_request]
3
+
4
+ jobs:
5
+ build:
6
+ runs-on: ubuntu-latest
7
+
8
+ steps:
9
+ - name: Clone repository
10
+ uses: actions/checkout@v4
11
+
12
+ - name: Install dependencies
13
+ uses: ./.github/actions/install-dependencies
14
+
15
+ - name: Install dependencies
16
+ run: {pm} install
17
+
18
+ - name: Prerelease
19
+ run: |
20
+ {pm} run build
21
+ {pmx} pkg-pr-new publish --{pm}
@@ -0,0 +1,14 @@
1
+ name: Pull Request
2
+ on:
3
+ pull_request:
4
+ types: [opened, reopened, synchronize, ready_for_review]
5
+
6
+ concurrency:
7
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
8
+ cancel-in-progress: true
9
+
10
+ jobs:
11
+ verify:
12
+ name: Verify
13
+ uses: ./.github/workflows/verify.yml
14
+ secrets: inherit
@@ -0,0 +1,37 @@
1
+ name: Verify
2
+ on:
3
+ workflow_call:
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ checks:
8
+ name: Checks
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - name: Clone repository
13
+ uses: actions/checkout@v4
14
+
15
+ - name: Install dependencies
16
+ uses: ./.github/actions/install-dependencies
17
+
18
+ - name: Check code
19
+ run: {pm} check
20
+
21
+ - name: Check types
22
+ run: {pm} check:types
23
+
24
+ test:
25
+ name: Test Runtime
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - name: Clone repository
29
+ uses: actions/checkout@v4
30
+
31
+ - name: Install dependencies
32
+ uses: ./.github/actions/install-dependencies
33
+
34
+ - name: Run tests
35
+ run: {pm} run test --bail=1
36
+ env:
37
+ CI: true