react-modular-datepicker 0.0.1 → 0.0.2-canary.10

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.
package/.gitattributes CHANGED
@@ -1,2 +1,2 @@
1
- # Auto detect text files and perform LF normalization
2
- * text=auto
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
@@ -1,47 +1,60 @@
1
- on:
2
- workflow_dispatch:
3
- inputs:
4
- releaseType:
5
- description: Release stable or canary?
6
- required: true
7
- type: choice
8
- options:
9
- - canary
10
- - stable
11
-
12
- semverType:
13
- description: semver type?
14
- type: choice
15
- options:
16
- - patch
17
- - minor
18
- - major
19
-
20
- secrets:
21
- RELEASE_BOT_GITHUB_TOKEN:
22
- required: true
23
-
24
- name: Release
25
-
26
- jobs:
27
- start:
28
- runs-on: ubuntu-latest
29
-
30
- steps:
31
- - uses: actions/checkout@v4
32
- - uses: pnpm/action-setup@v3
33
- with:
34
- version: 8
35
- - name: Setup node
36
- uses: actions/setup-node@v4
37
- with:
38
- node-version: 18
39
- cache: 'pnpm'
40
- - name: Install dependencies
41
- run: pnpm i --frozen-lockfile
42
- - name: Set publishing config
43
- run: pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
44
- env:
45
- NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
46
- - name: Publish package
47
- run: pnpm publish --access public --tag ${{ github.event.inputs.releaseType }}
1
+ on:
2
+ workflow_dispatch:
3
+ inputs:
4
+ releaseType:
5
+ description: Release stable or canary?
6
+ required: true
7
+ type: choice
8
+ options:
9
+ - canary
10
+ - stable
11
+ semverType:
12
+ description: semver type?
13
+ type: choice
14
+ options:
15
+ - patch
16
+ - minor
17
+ - major
18
+
19
+ permissions:
20
+ contents: write
21
+ id-token: write
22
+
23
+ name: Release
24
+
25
+ env:
26
+ SEMVER_TYPE: ${{ github.event.inputs.semverType }}
27
+ RELEASE_TYPE: ${{ github.event.inputs.releaseType }}
28
+
29
+ jobs:
30
+ release:
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: actions/checkout@v6
34
+ - uses: pnpm/action-setup@v6
35
+ with:
36
+ version: 10
37
+ - uses: actions/setup-node@v6
38
+ with:
39
+ node-version: 22
40
+ cache: 'pnpm'
41
+ registry-url: 'https://registry.npmjs.org'
42
+ - name: Install dependencies
43
+ run: pnpm i --frozen-lockfile
44
+ - name: Configure git
45
+ run: |
46
+ git config user.name "dragate"
47
+ git config user.email "spidfair@gmail.com"
48
+ - name: Bump version and tag
49
+ id: bump
50
+ run: node ./scripts/bump-version.js
51
+ - name: Push version commit
52
+ run: |
53
+ git push origin ${GITHUB_REF#refs/heads/}
54
+ git push origin --tags
55
+ - name: Create release
56
+ run: gh release create v${{ steps.bump.outputs.version }} --target ${GITHUB_REF#refs/heads/} --generate-notes ${{ github.event.inputs.releaseType == 'canary' && '--prerelease' || '' }}
57
+ env:
58
+ GH_TOKEN: ${{ github.token }}
59
+ - name: Publish package
60
+ run: pnpm publish --no-git-checks --provenance --access public --tag ${{ github.event.inputs.releaseType }}
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Dragate
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Dragate
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,2 +1,2 @@
1
- # react-modular-datepicker
2
- A headless datepicker
1
+ # react-modular-datepicker
2
+ A headless datepicker
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
- function test() {
2
- return "Init publish"
3
- }
4
-
1
+ function test() {
2
+ return "Init publish"
3
+ }
4
+
5
5
  module.exports = test
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "react-modular-datepicker",
3
- "version": "0.0.1",
3
+ "version": "0.0.2-canary.10",
4
4
  "description": "Another react datepicker",
5
5
  "main": "index.js",
6
6
  "keywords": [],
7
7
  "author": "",
8
8
  "license": "MIT",
9
+ "devDependencies": {
10
+ "semver": "^7.8.1",
11
+ "typescript": "^6.0.3"
12
+ },
9
13
  "scripts": {
10
14
  "test": "echo \"Error: no test specified\" && exit 1"
11
15
  }
@@ -0,0 +1,41 @@
1
+ const fs = require('fs')
2
+ const path = require('path')
3
+ const { execSync } = require('child_process')
4
+ const semver = require('semver')
5
+
6
+ const packageJsonPath = path.join(__dirname, '../package.json')
7
+ const packageJsonData = fs.readFileSync(packageJsonPath, 'utf8')
8
+ const packageJson = JSON.parse(packageJsonData)
9
+
10
+ let version = packageJson.version
11
+
12
+ switch (process.env.RELEASE_TYPE) {
13
+ case "canary":
14
+ version = semver.prerelease(version)
15
+ ? semver.inc(version, 'prerelease')
16
+ : semver.inc(version, `pre${process.env.SEMVER_TYPE}`, 'canary')
17
+ break
18
+ case "stable":
19
+ if (!process.env.SEMVER_TYPE) {
20
+ console.error('Missing semver type. Expected "patch", "minor" or "major".')
21
+ process.exit(1)
22
+ }
23
+ version = semver.inc(version, process.env.SEMVER_TYPE)
24
+ break
25
+ default:
26
+ console.error('Invalid release type. Expected "canary" or "stable".')
27
+ process.exit(1)
28
+ }
29
+
30
+ fs.appendFileSync(process.env.GITHUB_OUTPUT, `version=${version}\n`)
31
+
32
+ if (process.env.DRY_RUN) {
33
+ console.log(`pnpm version ${version}`)
34
+ } else {
35
+ try {
36
+ execSync(`pnpm version ${version}`, { stdio: 'inherit' })
37
+ } catch (error) {
38
+ console.error('Failed to execute version:', error)
39
+ process.exit(1)
40
+ }
41
+ }