@mrshmllw/campfire 1.0.0-crumbs-feature-adding-some-default-configs.1 → 1.0.0-crumbs-feature-adding-some-default-configs.3

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.
@@ -0,0 +1,29 @@
1
+ import typescriptEslintPlugin from '@typescript-eslint/eslint-plugin';
2
+ import tsParser from '@typescript-eslint/parser';
3
+ import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
4
+ const config = [
5
+ eslintPluginPrettierRecommended,
6
+ {
7
+ ignores: ['node_modules', 'dist', 'build'],
8
+ },
9
+ {
10
+ files: ['**/*.+(ts|tsx)'],
11
+ languageOptions: {
12
+ parser: tsParser,
13
+ },
14
+ plugins: {
15
+ '@typescript-eslint': typescriptEslintPlugin,
16
+ },
17
+ rules: {
18
+ '@typescript-eslint/no-explicit-any': 'warn', // Warns on use of 'any'
19
+ '@typescript-eslint/explicit-function-return-type': 'off', // Disables return type enforcement
20
+ '@typescript-eslint/no-unused-vars': [
21
+ 'warn',
22
+ { argsIgnorePattern: '^_' },
23
+ ],
24
+ 'no-console': 'warn', // Warns on console.log and similar calls
25
+ strict: ['error', 'never'],
26
+ },
27
+ },
28
+ ];
29
+ export default config;
@@ -0,0 +1,5 @@
1
+ const config = {
2
+ '*.+(js|ts|tsx)': ['eslint'],
3
+ '**/*.+(js|json|ts|tsx)': ['prettier --write'],
4
+ };
5
+ export default config;
@@ -0,0 +1,8 @@
1
+ const config = {
2
+ bracketSpacing: true,
3
+ proseWrap: 'always',
4
+ semi: false,
5
+ singleQuote: true,
6
+ trailingComma: 'all',
7
+ };
8
+ export default config;
@@ -0,0 +1,119 @@
1
+ import { readFileSync } from 'fs';
2
+ import path from 'path';
3
+ const branch = process.env.GITHUB_REF_NAME;
4
+ /**
5
+ * Attempt to determine the repository URL.
6
+ * By loading it from the consumer project's package.json.
7
+ * If the URL starts with 'git+', remove that prefix.
8
+ */
9
+ function getRepositoryUrl() {
10
+ try {
11
+ // process.cwd() will point to the consumer repo when semantic-release runs
12
+ const packageJsonPath = path.join(process.cwd(), 'package.json');
13
+ const packageJson = readFileSync(packageJsonPath, 'utf8');
14
+ const pkg = JSON.parse(packageJson);
15
+ if (pkg.repository) {
16
+ let url = typeof pkg.repository === 'object' ? pkg.repository.url : pkg.repository;
17
+ // Remove "git+" prefix if it exists
18
+ if (typeof url === 'string' && url.startsWith('git+')) {
19
+ url = url.slice(4);
20
+ }
21
+ return url;
22
+ }
23
+ }
24
+ catch (err) {
25
+ console.warn('Unable to load repository URL from package.json:', err);
26
+ }
27
+ return undefined;
28
+ }
29
+ const repositoryUrl = getRepositoryUrl();
30
+ /**
31
+ * @type {import('semantic-release').GlobalConfig}
32
+ */
33
+ const config = {
34
+ branches: [
35
+ 'main',
36
+ {
37
+ name: '(feature|fix|chore)/*',
38
+ // The prerelease name uses a dynamic expression to replace '/' with '-'
39
+ prerelease: 'crumbs-${name.replace(/\\//g, "-")}',
40
+ },
41
+ ],
42
+ repositoryUrl,
43
+ plugins: [
44
+ [
45
+ '@semantic-release/commit-analyzer',
46
+ {
47
+ preset: 'angular',
48
+ releaseRules: [
49
+ { type: 'feat', release: 'minor' },
50
+ { type: 'fix', release: 'patch' },
51
+ { type: 'docs', release: 'patch' },
52
+ { type: 'bump', release: 'patch' },
53
+ { type: 'dependabot', release: 'patch' },
54
+ { type: 'style', release: 'patch' },
55
+ { type: 'refactor', release: 'patch' },
56
+ { type: 'perf', release: 'patch' },
57
+ { type: 'test', release: 'patch' },
58
+ { type: 'revert', release: 'patch' },
59
+ { type: 'chore', release: 'patch' },
60
+ ],
61
+ parserOpts: {
62
+ noteKeywords: [
63
+ 'BREAKING CHANGE',
64
+ 'BREAKING-CHANGE',
65
+ 'BREAKING CHANGES',
66
+ 'BREAKING-CHANGES',
67
+ ],
68
+ },
69
+ },
70
+ ],
71
+ [
72
+ '@semantic-release/release-notes-generator',
73
+ {
74
+ preset: 'conventionalcommits',
75
+ presetConfig: {
76
+ types: [
77
+ { type: 'feat', section: 'Features' },
78
+ { type: 'fix', section: 'Bug Fixes' },
79
+ { type: 'docs', section: 'Documentation' },
80
+ { type: 'bump', hidden: true },
81
+ { type: 'dependabot', hidden: true },
82
+ { type: 'style', section: 'Styles' },
83
+ { type: 'refactor', section: 'Refactors' },
84
+ { type: 'perf', section: 'Performance Improvements' },
85
+ { type: 'test', section: 'Tests' },
86
+ { type: 'revert', hidden: true },
87
+ { type: 'chore', hidden: true },
88
+ { type: '*', section: 'Others' },
89
+ ],
90
+ },
91
+ },
92
+ ],
93
+ [
94
+ '@semantic-release/github',
95
+ {
96
+ assets: ['dist'],
97
+ },
98
+ ],
99
+ [
100
+ '@semantic-release/npm',
101
+ {
102
+ npmPublish: true,
103
+ pkgRoot: '.',
104
+ },
105
+ ],
106
+ ],
107
+ };
108
+ // Only add the changelog and git plugins on release (not for prereleases)
109
+ const isPrereleaseBranch = config.branches.some((b) => typeof b === 'object' && branch !== 'main' && b.prerelease);
110
+ if (!isPrereleaseBranch) {
111
+ config.plugins.push('@semantic-release/changelog', [
112
+ '@semantic-release/git',
113
+ {
114
+ assets: ['package.json', 'package-lock.json', 'CHANGELOG.md'],
115
+ message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
116
+ },
117
+ ]);
118
+ }
119
+ export default config;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export {};
1
+ "use strict";
@@ -1 +1 @@
1
- export {};
1
+ "use strict";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrshmllw/campfire",
3
- "version": "1.0.0-crumbs-feature-adding-some-default-configs.1",
3
+ "version": "1.0.0-crumbs-feature-adding-some-default-configs.3",
4
4
  "description": "Collection of toasty utils and configs used by Marshmallow Technology",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "extends": "./tsconfig.json",
3
3
  "compilerOptions": {
4
- "rootDir": "libs"
4
+ "rootDir": "libs",
5
+ "baseUrl": "libs",
6
+ "outDir": "./dist"
5
7
  },
6
8
  "exclude": [
7
9
  "release.config.js",
package/tsconfig.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "outDir": "./dist",
4
- "target": "ESNext",
5
- "module": "NodeNext",
6
- "moduleResolution": "nodenext",
4
+ "module": "esnext",
5
+ "target": "esnext",
6
+ "moduleResolution": "Bundler",
7
+ "allowJs": true,
7
8
  "esModuleInterop": true,
8
9
  "forceConsistentCasingInFileNames": true,
9
10
  "strict": true,
10
- "skipLibCheck": true,
11
- "baseUrl": "libs"
11
+ "skipLibCheck": true
12
12
  },
13
13
  "include": ["libs/**/*"],
14
14
  "exclude": ["node_modules", "dist"]